aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2011-07-22 13:10:01 -0700
committerPaul Berry <stereotype441@gmail.com>2011-08-05 13:01:30 -0700
commitcccc419e2c88f0c4d34de4ae4e49db09ecb6f88e (patch)
tree4f510f7751cef97d6dd9d22d316f54be87ce5aa9 /CMakeLists.txt
parentfb2d09ee1b0eb57a20595326d917776be650ca3f (diff)
downloadpiglit-cccc419e2c88f0c4d34de4ae4e49db09ecb6f88e.tar.gz
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 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1015165d..8bbbd79c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,27 @@ find_package(GLUT REQUIRED)
find_package(PNG REQUIRED)
find_package(X11)
+# Check for presence of Python 2.6 or greater.
+execute_process(
+ COMMAND python -c "import sys; assert sys.version >= '2.6'"
+ OUTPUT_QUIET
+ ERROR_QUIET
+ RESULT_VARIABLE python_version_check_error_code)
+if(NOT(python_version_check_error_code EQUAL 0))
+ message(FATAL_ERROR "python version 2.6 or greater required")
+endif(NOT(python_version_check_error_code EQUAL 0))
+
+# Check for the presence of numpy, which is needed to build generated
+# tests.
+execute_process(
+ COMMAND python -c "import numpy"
+ OUTPUT_QUIET
+ ERROR_QUIET
+ RESULT_VARIABLE import_numpy_error_code)
+if(NOT(import_numpy_error_code EQUAL 0))
+ message(FATAL_ERROR "numpy library not found")
+endif(NOT(import_numpy_error_code EQUAL 0))
+
if (NOT MSVC)
CHECK_C_COMPILER_FLAG("-Wall" C_COMPILER_FLAG_WALL)
IF (C_COMPILER_FLAG_WALL)
@@ -81,3 +102,4 @@ configure_file(
include_directories(src)
add_subdirectory(cmake/target_api)
+add_subdirectory(generated_tests)