CMakeLists.txt 3.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# Create a custom command that runs the Python script
# ${generator_script} to generate tests.
#
# A list of the files generated will be output to the file
# ${file_list}.  This can be used to run the custom command by itself,
# and is also used by the build system to tell when the files need to
# be rebuilt.
#
# The custom command will automatically depend on ${generator_script}.
# Additional dependencies can be supplied using additional arguments.
function(piglit_make_generated_tests file_list generator_script)
	# Add a custom command which executes ${generator_script}
	# during the build.
	add_custom_command(
		OUTPUT ${file_list}
		COMMAND ${python} ${CMAKE_CURRENT_SOURCE_DIR}/${generator_script} > ${file_list}
		DEPENDS ${generator_script} ${ARGN}
		VERBATIM)
endfunction(piglit_make_generated_tests custom_target generator_script)
20

21
# Create custom commands and targets to build generated tests.
22 23 24
piglit_make_generated_tests(
	builtin_packing_tests.list
	gen_builtin_packing_tests.py)
25 26 27 28
piglit_make_generated_tests(
	builtin_uniform_tests.list
	gen_builtin_uniform_tests.py
	builtin_function.py)
29 30 31 32
piglit_make_generated_tests(
	constant_array_size_tests.list
	gen_constant_array_size_tests.py
	builtin_function.py)
33 34 35
piglit_make_generated_tests(
	const_builtin_equal_tests.list
	gen_const_builtin_equal_tests.py)
36 37 38
piglit_make_generated_tests(
	interpolation_tests.list
	gen_interpolation_tests.py)
39 40 41
piglit_make_generated_tests(
	non-lvalue_tests.list
	gen_non-lvalue_tests.py)
42 43 44
piglit_make_generated_tests(
	texture_query_lod_tests.list
	gen_texture_query_lod_tests.py)
45 46 47
piglit_make_generated_tests(
	shader_bit_encoding_tests.list
	gen_shader_bit_encoding_tests.py)
48 49 50 51 52
piglit_make_generated_tests(
	uniform-initializer_tests.list
	gen_uniform_initializer_tests.py
	uniform-initializer-templates/fs-initializer.template
	uniform-initializer-templates/vs-initializer.template
53 54
	uniform-initializer-templates/fs-initializer-from-const.template
	uniform-initializer-templates/vs-initializer-from-const.template
55 56
	uniform-initializer-templates/fs-initializer-set-by-API.template
	uniform-initializer-templates/vs-initializer-set-by-API.template
57 58
	uniform-initializer-templates/fs-initializer-set-by-other-stage.template
	uniform-initializer-templates/vs-initializer-set-by-other-stage.template
59
	)
60 61 62
piglit_make_generated_tests(
	builtin_cl_int_tests.list
	generate-cl-int-builtins.py)
63 64 65
piglit_make_generated_tests(
	cl_store_tests.list
	generate-cl-store-tests.py)
66 67 68
piglit_make_generated_tests(
	builtin_cl_math_tests.list
	generate-cl-math-builtins.py)
69 70 71
piglit_make_generated_tests(
	builtin_cl_relational_tests.list
	generate-cl-relational-builtins.py)
72 73 74
piglit_make_generated_tests(
	interpolation-qualifier-built-in-variable.list
	interpolation-qualifier-built-in-variable.py)
75 76 77
piglit_make_generated_tests(
	texture_lod_tests.list
	gen_texture_lod_tests.py)
78 79 80
piglit_make_generated_tests(
	outerproduct_invalid_params.list
	gen_outerproduct_invalid_params.py)
81 82 83 84
piglit_make_generated_tests(
	outerproduct_tests.list
	gen_outerproduct_tests.py
	gen_outerproduct_template.mako)
85

86 87 88

# Add a "gen-tests" target that can be used to generate all the
# tests without doing any other compilation.
89
add_custom_target(gen-tests ALL
90
	DEPENDS builtin_packing_tests.list
91
		outerproduct_tests.list
92
		outerproduct_invalid_params.list
93
		builtin_uniform_tests.list
94
		constant_array_size_tests.list
95
		const_builtin_equal_tests.list
96
		builtin_cl_int_tests.list
97
		builtin_cl_math_tests.list
98
		builtin_cl_relational_tests.list
99
		cl_store_tests.list
100
		interpolation_tests.list
101
		non-lvalue_tests.list
102
		texture_query_lod_tests.list
103
		texture_lod_tests.list
104
		shader_bit_encoding_tests.list
105 106
		uniform-initializer_tests.list
		interpolation-qualifier-built-in-variable.list)