framework/exectest.py: Fix a few pylint warnings

This removes some unreachable code, adds an name definition to the Test
constructor, and comments a bare except. There are only a couple of
cases where a bare except is appropriate, most of the time it is a
problem, but we are using one the few cases where it is okay, we're
logging all exceptions to a file.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/exectest.py: Use flyweight pattern for Test

This uses python's __slots__ attribute on Test. This limits the
attributes of the class to exclusively those defined by the __slots__
attribute. This saves memory since python doesn't need to allocate
additional memory for new attributes that might be added.

It is perfectly valid to extend this in a subclass by setting __slots__,
that list is appended to the lists in the parent classes, so only new
names need to be added.

This cut the memory usage of loading tests.quick (and only loading) on
my system from ~32M to ~24M.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: put GleanTest class in exectest module

This is the first step to merging the builtin test classes into a single
module. It also fixes some problems with GleanTest.interpret_result()

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/exectest.py: Actually pass *args and **kwags in GleanTest

GleanTest has accepted **kwargs for some time, but didn't actually pass
them to the super() call in it's constructor. This patch fixes that and
also adds *args. At the moment we don't take addition args for the
constructor, but we might at some point want to.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/exectest.py: Make glean_executable constant PEP8 compliant

Changes internally used glean_executable to _GLEAN_EXECUTABLE, this is in
keeping with python interface standards and PEP8.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: rename GleanTest.globalParams to GleanTest.GLOBAL_PARAMS

This is in keeping with PEP8

This commit generated via:
find . -name '*py' | xargs sed -i -e 's!globalParams!GLOBAL_PARAMS!g'

With manual cleanups in framework/tests/exectest_tests.py

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/exectest.py: add check_for_skip_scenario to GleanTest

This moves the glean check out PiglitTest (since GleanTest doesn't
descend from PiglitTest there could never be a PiglitTest with glean as
an executable) and into GleanTest. If PIGLIT_PLATFORM is gbm glean tests
will skip.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: Merge glsl_parser_test into exectest

Merging the glsl_parser_test module into exectest has all the same
advantages as merging the gleantest module did. Fewer imports across the
board, fewer namespaces to deal with, and clearer class relationships.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: merge shadertest into exectest

This has all of the same advantages as merging GLSLParserTest did.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/exectest.py: Use abc metaclass for Test

Using the abc (Abstract Base Class) module is nice for a couple of
reasons. First, you cant initialize a class marked as an abc period,
second; decorators are used to define methods and properties that
children must implement, but super() can be used to call the code in the
base class (unlike raising NotImplementedError).

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/exectest.py: Mark several Test methods as not API

Python doesn't have private or protected methods or members, instead it
subscribes to the "we're all consenting adults" theory of programming.
However, it does have conventions for marking methods as "don't use
these, they are subject to change". Any method marked with a leading
underscore is marked as "This is not a safe API, it's not guaranteed to
not change". These methods act as a sort of pseudo-private method.

This patch changes Test.interpret_result to Test._interpret_result,
Test.check_for_skip_scenario() to Test._check_for_skip_scenario(), and
Test.get_command_result to Test._run_command(). These methods shouldn't
be called externally. It also changes the PIGLIT_PLATFORM constant to
_PIGLIT_PLATFORM, again marking that it is meant for use in the module
exclusively.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/exectest.py: update docstrings and comments

Adds or updates docstrings to be accurate and fixes numerous spelling
errors.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>