diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2022-02-09 16:24:24 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2022-02-11 21:54:44 +0100 |
commit | fdf5d11ff6f3f5034d7d7f7664f4cc76deb26ef5 (patch) | |
tree | 22e1c4b93f718930b8c40c2ab68f1b2bc790f97e /tests/auto/gui/rhi | |
parent | 52492ff7209d2c91cbd0d549282459b58fbf3b0f (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/rhi')
-rw-r--r-- | tests/auto/gui/rhi/qrhi/CMakeLists.txt | 21 | ||||
-rw-r--r-- | tests/auto/gui/rhi/qshader/CMakeLists.txt | 21 |
2 files changed, 16 insertions, 26 deletions
diff --git a/tests/auto/gui/rhi/qrhi/CMakeLists.txt b/tests/auto/gui/rhi/qrhi/CMakeLists.txt index 65d072c6b9..e0e97f6509 100644 --- a/tests/auto/gui/rhi/qrhi/CMakeLists.txt +++ b/tests/auto/gui/rhi/qrhi/CMakeLists.txt @@ -4,23 +4,18 @@ ## tst_qrhi Test: ##################################################################### +# Resources: +file(GLOB_RECURSE qrhi_resource_files + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + data/* +) + qt_internal_add_test(tst_qrhi SOURCES tst_qrhi.cpp PUBLIC_LIBRARIES Qt::Gui Qt::GuiPrivate + TESTDATA ${qrhi_resource_files} + BUILTIN_TESTDATA ) - -# Resources: -set(qrhi_resource_files - "data" -) - -qt_internal_add_resource(tst_qrhi "qrhi" - PREFIX - "/" - FILES - ${qrhi_resource_files} -) - diff --git a/tests/auto/gui/rhi/qshader/CMakeLists.txt b/tests/auto/gui/rhi/qshader/CMakeLists.txt index 9a0e246aa4..9807b19e53 100644 --- a/tests/auto/gui/rhi/qshader/CMakeLists.txt +++ b/tests/auto/gui/rhi/qshader/CMakeLists.txt @@ -4,23 +4,18 @@ ## tst_qshader Test: ##################################################################### +# Resources: +file(GLOB_RECURSE qshader_resource_files + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + "data/*" +) + qt_internal_add_test(tst_qshader SOURCES tst_qshader.cpp PUBLIC_LIBRARIES Qt::Gui Qt::GuiPrivate + TESTDATA ${qshader_resource_files} + BUILTIN_TESTDATA ) - -# Resources: -set(qshader_resource_files - "data" -) - -qt_internal_add_resource(tst_qshader "qshader" - PREFIX - "/" - FILES - ${qshader_resource_files} -) - |