diff options
author | Paul Berry <stereotype441@gmail.com> | 2011-07-22 13:10:01 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2011-08-05 13:01:30 -0700 |
commit | cccc419e2c88f0c4d34de4ae4e49db09ecb6f88e (patch) | |
tree | 4f510f7751cef97d6dd9d22d316f54be87ce5aa9 /tests | |
parent | fb2d09ee1b0eb57a20595326d917776be650ca3f (diff) |
Add comprehensive tests of builtin functions with uniform input.
This patch adds 462 tests to piglit, which comprehensively test the
behavior of GLSL built-in functions on vertex and fragment shaders.
The test vectors are auto-generated in Python, by using the numpy
library to simulate the behavior of the built-in functions on a
variety of inputs (in builtin_function.py), and then producing
shader_runner tests to verify the expected behavior (in
gen_builtin_uniform_tests.py).
Test generation happens as part of the piglit build process. To run
the test generation step by itself, use "make gen-tests" from the root
of the piglit tree (after configuring using cmake). The generated
tests may be found in generated_tests/spec.
The auto-generation code depends on Python 2.6 and on the numpy
library (www.numpy.org). I've updated the README to reflect these
dependencies, and added code to CMakeLists.txt to check for them at
configure time. (Note: other parts of Piglit already depend on Python
2.6, but the dependency wasn't previously explicit).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/all.tests | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/all.tests b/tests/all.tests index bac5b22a..62deb873 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -20,6 +20,15 @@ blacklist = [ 'shaders/glsl-vs-inline-explosion', ] +# Find the generated_tests directory, by looking either in +# $PIGLIT_BUILD_DIR (if that environment variable exists) or in the +# parent directory of the directory containing this file. +generatedTestDir = os.path.join( + os.environ.get( + 'PIGLIT_BUILD_DIR', + os.path.join(os.path.dirname(__file__), '..')), + 'generated_tests') + ###### # Collecting all tests profile = TestProfile() @@ -727,6 +736,9 @@ spec['glsl-1.10']['execution'] = Group() add_shader_test_dir(spec['glsl-1.10']['execution'], os.path.join(os.path.dirname(__file__), 'spec', 'glsl-1.10', 'execution'), recursive=True) +add_shader_test_dir(spec['glsl-1.10']['execution'], + os.path.join(generatedTestDir, 'spec', 'glsl-1.10', 'execution'), + recursive=True) # Group spec/glsl-1.20 spec['glsl-1.20'] = Group() @@ -737,6 +749,9 @@ spec['glsl-1.20']['execution'] = Group() add_shader_test_dir(spec['glsl-1.20']['execution'], os.path.join(os.path.dirname(__file__), 'spec', 'glsl-1.20', 'execution'), recursive=True) +add_shader_test_dir(spec['glsl-1.20']['execution'], + os.path.join(generatedTestDir, 'spec', 'glsl-1.20', 'execution'), + recursive=True) # Group spec/glsl-1.30 spec['glsl-1.30'] = Group() |