summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2022-02-09 16:24:24 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2022-02-11 21:54:44 +0100
commitfdf5d11ff6f3f5034d7d7f7664f4cc76deb26ef5 (patch)
tree22e1c4b93f718930b8c40c2ab68f1b2bc790f97e /tests/auto/gui/painting
parent52492ff7209d2c91cbd0d549282459b58fbf3b0f (diff)
CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test
Multiple tests use qt_internal_add_resource that copies the functionality that is already implemented inside the qt_internal_add_test function. Simplify these test by replacing the qt_internal_add_resource call with the new BUILTIN_TESTDATA option. Change-Id: I18475b817d6f87264f0de53817d6c26c5ccab4e2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r--tests/auto/gui/painting/qcolorspace/CMakeLists.txt29
1 files changed, 8 insertions, 21 deletions
diff --git a/tests/auto/gui/painting/qcolorspace/CMakeLists.txt b/tests/auto/gui/painting/qcolorspace/CMakeLists.txt
index 9e3460d363..ef53c50551 100644
--- a/tests/auto/gui/painting/qcolorspace/CMakeLists.txt
+++ b/tests/auto/gui/painting/qcolorspace/CMakeLists.txt
@@ -5,10 +5,14 @@
#####################################################################
# Collect test data
-file(GLOB_RECURSE test_data_glob
+file(GLOB_RECURSE test_data
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
- resources/*)
-list(APPEND test_data ${test_data_glob})
+ resources/*
+)
+
+foreach(file IN LISTS test_data)
+ set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
+endforeach()
qt_internal_add_test(tst_qcolorspace
SOURCES
@@ -18,22 +22,5 @@ qt_internal_add_test(tst_qcolorspace
Qt::Gui
Qt::GuiPrivate
TESTDATA ${test_data}
+ BUILTIN_TESTDATA
)
-
-file(GLOB resource_glob_0 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "resources/*")
-foreach(file IN LISTS resource_glob_0)
- set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
-endforeach()
-
-# Resources:
-set(qmake_immediate_resource_files
- ${resource_glob_0}
-)
-
-qt_internal_add_resource(tst_qcolorspace "qmake_immediate"
- PREFIX
- "/"
- FILES
- ${qmake_immediate_resource_files}
-)
-