[Piglit] [PATCH 34/35] Generate xml for builtin profiles

Dylan Baker dylan at pnwbakers.com
Wed Apr 4 22:27:22 UTC 2018


This creates and installs xml for all builtin profiles. Using these
profiles I see startup times of ~1 second as opposed to more than 10
with current master, and runtimes that drop by ~1 minute.
---
 CMakeLists.txt              |  8 ++-
 tests/CMakeLists.no_api.txt | 89 ++++++++++++++++++++++++++++++++++++++-
 tests/CMakeLists.txt        |  2 +-
 3 files changed, 98 insertions(+), 1 deletion(-)
 create mode 100644 tests/CMakeLists.no_api.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc80ece..db047b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -534,7 +534,13 @@ install (
 	DIRECTORY tests
 	DESTINATION ${PIGLIT_INSTALL_LIBDIR}
 	FILES_MATCHING REGEX ".*\\.(xml|py|program_test|shader_test|frag|vert|geom|tesc|tese|comp|ktx|cl|txt|inc)$"
-	REGEX "CMakeFiles|CMakeLists" EXCLUDE
+	REGEX "CMakeFiles|CMakeLists|serializer.py|opengl.py|cl.py|quick_gl.py|glslparser.py|shader.py|quick_shader.py|no_error.py|llvmpipe_gl.py|sanity.py" EXCLUDE
+)
+
+install (
+	DIRECTORY ${CMAKE_BINARY_DIR}/tests
+	DESTINATION ${PIGLIT_INSTALL_LIBDIR}
+	FILES_MATCHING REGEX ".*\\.xml"
 )
 
 install (
diff --git a/tests/CMakeLists.no_api.txt b/tests/CMakeLists.no_api.txt
new file mode 100644
index 0000000..d7f95af
--- /dev/null
+++ b/tests/CMakeLists.no_api.txt
@@ -0,0 +1,89 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+add_custom_target(
+	static-shader-tests
+	BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/shader.list
+	COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} shader ${CMAKE_CURRENT_BINARY_DIR}/shader.list
+	VERBATIM
+)
+add_custom_target(
+	static-glslparser-tests
+	BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glslparser.list
+	COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} glslparser ${CMAKE_CURRENT_BINARY_DIR}/glslparser.list
+	VERBATIM
+)
+add_custom_target(
+	static-asmparser-tests
+	BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/asmparser.list
+	COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} asmparser ${CMAKE_CURRENT_BINARY_DIR}/asmparser.list
+	VERBATIM
+)
+add_custom_target(
+	static-program-tests
+	BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/program.list
+	COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find_static_tests.py ${CMAKE_CURRENT_SOURCE_DIR} program ${CMAKE_CURRENT_BINARY_DIR}/program.list
+	VERBATIM
+)
+
+function(piglit_generate_xml name profile meta_target extra_args)
+	add_custom_command(
+		OUTPUT ${CMAKE_BINARY_DIR}/tests/${name}.xml
+		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  ${extra_args}
+		DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${profile}.py ${CMAKE_CURRENT_SOURCE_DIR}/serializer.py ${ARGN}
+		VERBATIM
+	)
+	add_custom_target(
+		generate-${name}-xml
+		DEPENDS ${CMAKE_BINARY_DIR}/tests/${name}.xml
+	)
+	add_dependencies(${meta_target} generate-${name}-xml)
+endfunction()
+
+add_custom_target(gen-gl-xml)
+piglit_generate_xml(opengl opengl gen-gl-xml "")
+piglit_generate_xml(no_error no_error gen-gl-xml "")
+piglit_generate_xml(quick_gl quick_gl gen-gl-xml "")
+piglit_generate_xml(llvmpipe_gl llvmpipe_gl gen-gl-xml "")
+piglit_generate_xml(sanity sanity gen-gl-xml "")
+
+add_custom_target(gen-gl-gen-xml)
+piglit_generate_xml(glslparser glslparser gen-gl-gen-xml "" gen-gl-tests ${CMAKE_CURRENT_BINARY_DIR}/glslparser.list ${CMAKE_CURRENT_BINARY_DIR}/asmparser.list)
+piglit_generate_xml(glslparser_arb_compat glslparser gen-gl-gen-xml "--glsl-arb-compat" gen-gl-tests ${CMAKE_CURRENT_BINARY_DIR}/glslparser.list ${CMAKE_CURRENT_BINARY_DIR}/asmparser.list)
+piglit_generate_xml(shader shader gen-gl-gen-xml "" gen-gl-tests ${CMAKE_CURRENT_BINARY_DIR}/shader.list)
+piglit_generate_xml(quick_shader quick_shader gen-gl-gen-xml "" gen-gl-tests ${CMAKE_CURRENT_BINARY_DIR}/shader.list)
+piglit_generate_xml(shader_multi shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests ${CMAKE_CURRENT_BINARY_DIR}/shader.list)
+piglit_generate_xml(quick_shader_multi quick_shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests ${CMAKE_CURRENT_BINARY_DIR}/shader.list)
+
+add_custom_target(gen-cl-xml)
+piglit_generate_xml(cl cl gen-cl-xml "" gen-cl-tests ${CMAKE_CURRENT_BINARY_DIR}/program.list)
+
+add_custom_target(gen-xml ALL)
+
+if(${PIGLIT_BUILD_GL_TESTS} OR ${PIGLIT_BUILD_GLES2_TESTS} OR ${PIGLIT_BUILD_GLES3_TESTS})
+	add_dependencies(gen-xml gen-gl-xml)
+	add_dependencies(gen-xml gen-gl-gen-xml)
+endif(${PIGLIT_BUILD_GL_TESTS} OR ${PIGLIT_BUILD_GLES2_TESTS} OR ${PIGLIT_BUILD_GLES3_TESTS})
+
+if(${PIGLIT_BUILD_CL_TESTS})
+	add_dependencies(gen-xml gen-cl-xml)
+endif(${PIGLIT_BUILD_CL_TESTS})
+
+# vim: ft=cmake
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c588dfc..0255d87 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -25,3 +25,5 @@ ENDIF(EGL_FOUND)
 IF(PIGLIT_BUILD_CL_TESTS)
 	add_subdirectory (cl)
 ENDIF(PIGLIT_BUILD_CL_TESTS)
+
+piglit_include_target_api()
-- 
git-series 0.9.1


More information about the Piglit mailing list