Commit b008ef2e authored by Dylan Baker's avatar Dylan Baker
Browse files

Cmake: generate tests based on configure options



Currently all OpenGL and OpenCL tests are generated regardless of
whether a user has configured piglit to test that API. That means we
waste cycles and disk space on tests that are probably not interesting.

This patch changes that by creating two separate targets, one for OpenCL
tests and one for OpenGL tests (these targets are always available, so
developers working on generators can still run ninja gen-{gl,cl}-tests
to generate those tests even if they didn't configure them), but are
conditionally added to the meta-target gen-tests.
Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
parent a6ed9bcb
......@@ -18,7 +18,7 @@ function(piglit_make_generated_tests file_list generator_script)
VERBATIM)
endfunction(piglit_make_generated_tests custom_target generator_script)
# Create custom commands and targets to build generated tests.
# Generators for OpenGL tests
piglit_make_generated_tests(
builtin_packing_tests.list
gen_builtin_packing_tests.py
......@@ -75,18 +75,6 @@ piglit_make_generated_tests(
templates/gen_uniform_initializer_tests/fs-initializer-set-by-other-stage.shader_test.mako
templates/gen_uniform_initializer_tests/vs-initializer-set-by-other-stage.shader_test.mako
)
piglit_make_generated_tests(
builtin_cl_int_tests.list
generate-cl-int-builtins.py)
piglit_make_generated_tests(
cl_store_tests.list
generate-cl-store-tests.py)
piglit_make_generated_tests(
builtin_cl_math_tests.list
generate-cl-math-builtins.py)
piglit_make_generated_tests(
builtin_cl_relational_tests.list
generate-cl-relational-builtins.py)
piglit_make_generated_tests(
interpolation-qualifier-built-in-variable.list
interpolation-qualifier-built-in-variable.py
......@@ -123,19 +111,32 @@ piglit_make_generated_tests(
gen_constant_array_size_tests_fp64.py
builtin_function_fp64.py)
# Add a "gen-tests" target that can be used to generate all the
# tests without doing any other compilation.
add_custom_target(gen-tests ALL
# OpenCL Test generators
piglit_make_generated_tests(
builtin_cl_int_tests.list
generate-cl-int-builtins.py)
piglit_make_generated_tests(
cl_store_tests.list
generate-cl-store-tests.py)
piglit_make_generated_tests(
builtin_cl_math_tests.list
generate-cl-math-builtins.py)
piglit_make_generated_tests(
builtin_cl_relational_tests.list
generate-cl-relational-builtins.py)
# Create a custom target for generating OpenGL tests
# This is not added to the default target, instead it is added
# as a dependency of gen-tests if OpenGL or OpenGLES{2,3} tests
# are enabled
add_custom_target(gen-gl-tests
DEPENDS builtin_packing_tests.list
outerproduct_tests.list
outerproduct_invalid_params.list
builtin_uniform_tests.list
constant_array_size_tests.list
const_builtin_equal_tests.list
builtin_cl_int_tests.list
builtin_cl_math_tests.list
builtin_cl_relational_tests.list
cl_store_tests.list
builtin_packing_tests.list
interpolation_tests.list
non-lvalue_tests.list
texture_query_lod_tests.list
......@@ -144,4 +145,30 @@ add_custom_target(gen-tests ALL
uniform-initializer_tests.list
interpolation-qualifier-built-in-variable.list
builtin_uniform_tests_fp64.list
constant_array_size_tests_fp64.list)
constant_array_size_tests_fp64.list
)
# Create a custom target for generating OpenCL tests
# This is not added to the default target, instead it is added
# as a dependency of gen-etsts if OpenCL tests are enabled
add_custom_target(gen-cl-tests
DEPENDS builtin_cl_int_tests.list
builtin_cl_math_tests.list
builtin_cl_relational_tests.list
cl_store_tests.list
)
# Add a "gen-tests" target that can be used to generate all the
# tests without doing any other compilation.
add_custom_target(gen-tests ALL COMMENT "meta-target for other test generators")
# Add gen-gl-tests as a dependency of the gen-tests if OpenGL or OpenGL ES {2,3}
# are requested. there are no GLES1 tests to generate
if(${PIGLIT_BUILD_GL_TESTS} OR ${PIGLIT_BUILD_GLES2_TESTS} OR ${PIGLIT_BUILD_GLES3_TESTS})
add_dependencies(gen-tests gen-gl-tests)
endif(${PIGLIT_BUILD_GL_TESTS} OR ${PIGLIT_BUILD_GLES2_TESTS} OR ${PIGLIT_BUILD_GLES3_TESTS})
# Add gen-cl-tests as a dependency of the gen-tests if OpenCL is requested
if(${PIGLIT_BUILD_CL_TESTS})
add_dependencies(gen-tests gen-cl-tests)
endif(${PIGLIT_BUILD_CL_TESTS})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment