util: Move MSVC's inline macro to piglit-util.h

So that it is more widely defined.

This should fix MSVC build.

Trivial change, which does not affect non-Windows builds in any way.
Allow setting a cwd to execute tests from.

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/core.py: Add pre_run and post_run hooks to TestProfile

These hooks no-op in the default TestProfile class, however they are
intended to give versatility and power to external test suites, which
may have specific environment requirements, setup requirements, or
teardown requirements, by allowing them to subclass TestProfile and set
these methods.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
python: Add results_dir to TestProfile

This is needed specifically by XTS, but it might be useful for other
external suites that want to move files out of their runtime directories
into the saved directory. Specifically if those files are linked into
the summary.

v3: - Add the results_dir name definition to the constructor

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
tests/xts.py: Add a tests file for the X Test suite.

This adds support for running XTS from piglit.

This patch was original written by Eric Anholt, but I've cleaned it up
and reworked parts of it for upstreaming, and as a result I've attached
my name as the author so ``git bisect'' and ``git blame'' will send
angry mail my way instead of Eric's.

v2: - Don't break dmesg reporting
    - Use str.format consistently
    - populate profile after check for xtest symlink
v3: - rebase against master
    - fix spelling errors

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
fbo-depth-sample-compare: Eliminate dependency on glutSolidSphere.

Reviewed-by: Brian Paul <brianp@vmware.com>
util: Create core profiles with GLUT when supported by freeglut.

Handy until we have waffle everywhere.

Reviewed-by: Brian Paul <brianp@vmware.com>
junit: Results' stdout and stderr is now in `out` in `err`.
profile: Fix mixed concurrency runs

Currently we call join after initializing both of the pools, which means
that they run simultaneously. This patch fixes that by creating a helper
function which sets off the pool, closes it, and then joins it. This
fixes the problem by forcing each pool to run in series.

v2: - Fix typo that put all tests in a multithreaded pool
    - split lines differently for improved readability

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
framework/core.py: Remove unused imports and fix __all__

After profile was split out of the core module it's imports were not
removed. This has a small overhead cost and drive the code quality
checking tools crazy.

__all__ is a module name that controls the values exported when running
help() or pydoc. Setting these to reflect proper values helps python
tools to function better and makes the documentation accurate.

None of these changes affect running code at all.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
profile.py: Remove uses of keys, items and values as appropriate

These methods compute and return a list in python 2, Their iter* cousins
however do not return a list, but an iterator. This has memory saving
properties.
profile.py: use dict.iteritems() instead of keys

Doing dictionary lookup in a loop using a key is not a pythonic
constuct, use iteritems() to provide both the key and value as names in
the loop.
profile: Remove unnecessary if statement

This particular if doesn't present big performance wins, nor does it
affect the result of the code, but does make it harder to understand, so
just remove it.
profile.py: replace map() with generator expression

map() is considered semi-deprecated in python, since map() + lambda will
always be more expensive than a comprehension or generator expression.
profile.py: Update docstrings and comments

Adds or fixes docstrings and comments
profile.py: Cleanup a few pylint wawrnings
profile.py: stop exposing private methods of TestProfile

This patch stops exposing flatten_group_hierarchy and prepare_test_list
by marking them with a leading underscore. These methods weren't meant
to be called outside, and this is the pythonic way of letting users know
that these are "private" methods.
profile.py: set __all__

Setting the __all__ name in a module controls which names it exposes
when imported.
framework: rename profile.loadTestProfile to profile.load_test_profile

This is a more pythonic name for this method.

This patch was created with the following shell command:
find . -name '*py' | \
xargs sed -i -e 's!loadTestProfile!load_test_profile!g'