framework/shader_test.py: Remove standalone capability

Shader_test has a bizarre capability to be run as a standalone script as
well as be used as a module. This was probably useful when developing
the original shader_test implementation, but at this point it's unused
code just waiting to bit-rot adding needless complexity

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/shader_test.py: Replace ShaderTest class with function

This replaces the ShaderTest class with a shader_test function that
returns a PlainExecTest instance. The reason to make this transition is
simple, ShaderTest never actually modified any of the methods in
PlainExecTest, it never needed to be a class, making it a function
reduces the amount of code required, vastly reduces the complexity of
the code, and makes testing much simpler.

This also removes the dmesg_test for ShaderTest, since shader_test just
returns a PlainExecTest, there isn't any reason for dmesg to test it
specially.

v2: - remove shader_test_tests. This only had an initializer test, and
      that no longer applies since ShaderTest is now a function

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
shader_tests_tests.py: Adds some tests for the shader_test module

This adds a couple of tests for the regex searches in
shader_test.shader_test(), and some simple tests for the
add_shader_test* functions.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Replace end_config with 'end config' in glsl parser tests

The example glsl parser test doesn't list end_config as acceptable, and
there are only 5 tests using end_config, so it makes sense to just fix
those tests rather than generating slower more complicated regex for
handling end_config.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: Remove standalone functionality.

This removes the standalone run functionality from glsl_parser_test.
Like shader_test this was probably useful for testing while in
development, but at this point it's just dead code.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: Replace GLSLParserTest class with function

This is a rough 'port' of the class to a function. It deviates only to
make idiomatic changes and to remove references to self, with a one
notable exception: the class always returned a result when something went
wrong, this function raises an exception. Some of these cases can
probably be better handled, but returning a result seems like the wrong
decision in every case; since getting back 'failed' is not likely to
lead a developer to say "bad python code, bad!", but to go digging
through the test or driver. Raising an exception will cause piglit to
record the exception in the json, much more useful for realizing
something went wrong at the python level.

v2: - remove tests that no longer apply
    - fix tests/gpu.py

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: Vastly simplify the way the config is parsed

This reduces the complexity of the code that searches for config section
and writes it into a StringIO. The new code just looks for a comment
followed by [config] to open the section and a comment followed by [end
config] to close it. It naively slurps up everything in between.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Adds some tests for glsl_parser_tests.py

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: simplify and cleanup add_glsl_parser_dir

This removes some unnecessary code, and fixes a few pylint warnings.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: Move Test from core to exectest

Since Test is exclusively used as a parent for ExecTest, the two classes
should be in the same module.
framework: move testBinDir to exectest

This is mostly consumed by Test's children, so putting it in the same
module makes sense
exectest.py: Merge Test and ExecTest into a single class

Rather than have 2 base classes, let's just have one.

v2: - remove test that no longer is valid

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Allow setting a cwd to execute tests from.

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Build a tests file for the X Test suite.

Build the test suite externally, then drop a symlink from that xtest
top level directory into bin/

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

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