1 # Copyright © 2018 Intel Corporation
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/shader.list
24 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} shader ${CMAKE_CURRENT_BINARY_DIR}/shader.list
28 static-glslparser-tests
29 BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glslparser.list
30 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} glslparser ${CMAKE_CURRENT_BINARY_DIR}/glslparser.list
34 static-asmparser-tests
35 BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/asmparser.list
36 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} asmparser ${CMAKE_CURRENT_BINARY_DIR}/asmparser.list
41 BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/program.list
42 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} program ${CMAKE_CURRENT_BINARY_DIR}/program.list
46 function(piglit_generate_xml name profile meta_target extra_args)
48 OUTPUT ${CMAKE_BINARY_DIR}/tests/${name}.xml.gz
49 COMMAND ${CMAKE_COMMAND} -E env PIGLIT_BUILD_TREE=${CMAKE_BINARY_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/serializer.py ${name} ${CMAKE_CURRENT_SOURCE_DIR}/${profile}.py ${CMAKE_BINARY_DIR}/tests/${name}.xml.gz ${extra_args}
50 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${profile}.py ${CMAKE_CURRENT_SOURCE_DIR}/serializer.py ${ARGN}
55 DEPENDS ${CMAKE_BINARY_DIR}/tests/${name}.xml.gz
57 add_dependencies(${meta_target} generate-${name}-xml)
60 add_custom_target(gen-gl-xml)
61 piglit_generate_xml(opengl opengl gen-gl-xml "")
62 piglit_generate_xml(quick_gl quick_gl gen-gl-xml "")
63 piglit_generate_xml(llvmpipe_gl llvmpipe_gl gen-gl-xml "")
64 piglit_generate_xml(sanity sanity gen-gl-xml "")
66 add_custom_target(gen-gl-gen-xml)
67 piglit_generate_xml(glslparser glslparser gen-gl-gen-xml "" gen-gl-tests static-glslparser-tests static-asmparser-tests)
68 piglit_generate_xml(glslparser_arb_compat glslparser gen-gl-gen-xml "--glsl-arb-compat" gen-gl-tests static-glslparser-tests static-asmparser-tests)
69 piglit_generate_xml(shader shader gen-gl-gen-xml "" gen-gl-tests static-shader-tests)
70 piglit_generate_xml(quick_shader quick_shader gen-gl-gen-xml "" gen-gl-tests static-shader-tests)
71 piglit_generate_xml(shader.no_isolation shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests static-shader-tests)
72 piglit_generate_xml(quick_shader.no_isolation quick_shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests static-shader-tests)
73 piglit_generate_xml(no_error no_error gen-gl-gen-xml "" gen-gl-tests static-shader-tests)
75 add_custom_target(gen-cl-xml)
76 piglit_generate_xml(cl cl gen-cl-xml "" gen-cl-tests static-program-tests)
78 add_custom_target(gen-xml ALL)
80 if(${PIGLIT_BUILD_GL_TESTS} OR ${PIGLIT_BUILD_GLES2_TESTS} OR ${PIGLIT_BUILD_GLES3_TESTS})
81 add_dependencies(gen-xml gen-gl-xml)
82 add_dependencies(gen-xml gen-gl-gen-xml)
83 endif(${PIGLIT_BUILD_GL_TESTS} OR ${PIGLIT_BUILD_GLES2_TESTS} OR ${PIGLIT_BUILD_GLES3_TESTS})
85 if(${PIGLIT_BUILD_CL_TESTS})
86 add_dependencies(gen-xml gen-cl-xml)
87 endif(${PIGLIT_BUILD_CL_TESTS})