CMakeLists.txt 5.28 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
piglit_make_generated_tests(
	builtin_packing_tests.list
24
25
26
27
28
29
30
31
	gen_builtin_packing_tests.py
	templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
	templates/gen_builtin_packing_tests/vs_pack.shader_test.mako
	templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
	templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
	templates/gen_builtin_packing_tests/const_pack.shader_test.mako
	templates/gen_builtin_packing_tests/const_unpack.shader_test.mako
	)
32
33
34
35
piglit_make_generated_tests(
	builtin_uniform_tests.list
	gen_builtin_uniform_tests.py
	builtin_function.py)
36
37
38
39
piglit_make_generated_tests(
	constant_array_size_tests.list
	gen_constant_array_size_tests.py
	builtin_function.py)
40
41
piglit_make_generated_tests(
	const_builtin_equal_tests.list
42
43
44
	gen_const_builtin_equal_tests.py
	templates/gen_const_builtin_equal_tests/template.shader_test.mako
	)
45
46
47
piglit_make_generated_tests(
	interpolation_tests.list
	gen_interpolation_tests.py)
48
49
50
piglit_make_generated_tests(
	non-lvalue_tests.list
	gen_non-lvalue_tests.py)
51
52
piglit_make_generated_tests(
	texture_query_lod_tests.list
53
54
55
	gen_texture_query_lod_tests.py
	templates/gen_texture_query_lod_tests/template.glsl_parser_test.mako
	)
56
57
piglit_make_generated_tests(
	shader_bit_encoding_tests.list
58
59
60
	gen_shader_bit_encoding_tests.py
	templates/gen_shader_bit_encoding_tests/template.shader_test.mako
	)
61
62
63
piglit_make_generated_tests(
	uniform-initializer_tests.list
	gen_uniform_initializer_tests.py
64
65
66
67
68
69
70
71
	templates/gen_uniform_initializer_tests/fs-initializer.shader_test.mako
	templates/gen_uniform_initializer_tests/vs-initializer.shader_test.mako
	templates/gen_uniform_initializer_tests/fs-initializer-from-const.shader_test.mako
	templates/gen_uniform_initializer_tests/vs-initializer-from-const.shader_test.mako
	templates/gen_uniform_initializer_tests/fs-initializer-set-by-API.shader_test.mako
	templates/gen_uniform_initializer_tests/vs-initializer-set-by-API.shader_test.mako
	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
72
	)
73
74
75
piglit_make_generated_tests(
	builtin_cl_int_tests.list
	generate-cl-int-builtins.py)
76
77
78
piglit_make_generated_tests(
	cl_store_tests.list
	generate-cl-store-tests.py)
79
80
81
piglit_make_generated_tests(
	builtin_cl_math_tests.list
	generate-cl-math-builtins.py)
82
83
84
piglit_make_generated_tests(
	builtin_cl_relational_tests.list
	generate-cl-relational-builtins.py)
85
86
piglit_make_generated_tests(
	interpolation-qualifier-built-in-variable.list
87
88
89
90
91
92
93
	interpolation-qualifier-built-in-variable.py
	templates/interpolation-qualifier-built-in-variable/fs-vs-unused.shader_test.mako
	templates/interpolation-qualifier-built-in-variable/vs-unused.shader_test.mako
	templates/interpolation-qualifier-built-in-variable/fs-unused.shader_test.mako
	templates/interpolation-qualifier-built-in-variable/vs-fs-flip.shader_test.mako
	templates/interpolation-qualifier-built-in-variable/vs-fs.shader_test.mako
	)
94
95
piglit_make_generated_tests(
	texture_lod_tests.list
96
97
98
99
100
	gen_texture_lod_tests.py
	templates/gen_texture_lod_tests/tex_grad.vert.mako
	templates/gen_texture_lod_tests/tex_grad.frag.mako
	templates/gen_texture_lod_tests/frag_lod.glsl_parser_test.mako
	)
101
102
103
piglit_make_generated_tests(
	outerproduct_invalid_params.list
	gen_outerproduct_invalid_params.py)
104
105
106
piglit_make_generated_tests(
	outerproduct_tests.list
	gen_outerproduct_tests.py
107
108
	templates/gen_outerproduct_tests/template.shader_test.mako
	)
109

110
111
112
113
114
115
116
117
piglit_make_generated_tests(
	builtin_uniform_tests_fp64.list
	gen_builtin_uniform_tests_fp64.py
	builtin_function_fp64.py)
piglit_make_generated_tests(
	constant_array_size_tests_fp64.list
	gen_constant_array_size_tests_fp64.py
	builtin_function_fp64.py)
118
119
120

# Add a "gen-tests" target that can be used to generate all the
# tests without doing any other compilation.
121
add_custom_target(gen-tests ALL
122
	DEPENDS builtin_packing_tests.list
123
		outerproduct_tests.list
124
		outerproduct_invalid_params.list
125
		builtin_uniform_tests.list
126
		constant_array_size_tests.list
127
		const_builtin_equal_tests.list
128
		builtin_cl_int_tests.list
129
		builtin_cl_math_tests.list
130
		builtin_cl_relational_tests.list
131
		cl_store_tests.list
132
		interpolation_tests.list
133
		non-lvalue_tests.list
134
		texture_query_lod_tests.list
135
		texture_lod_tests.list
136
		shader_bit_encoding_tests.list
137
		uniform-initializer_tests.list
138
139
140
		interpolation-qualifier-built-in-variable.list
		builtin_uniform_tests_fp64.list
		constant_array_size_tests_fp64.list)