summaryrefslogtreecommitdiff
path: root/tests/auto/gui/kernel
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/kernel
parent52492ff7209d2c91cbd0d549282459b58fbf3b0f (diff)
downloadqtbase-fdf5d11ff6f3f5034d7d7f7664f4cc76deb26ef5.tar.gz
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/kernel')
-rw-r--r--tests/auto/gui/kernel/CMakeLists.txt4
-rw-r--r--tests/auto/gui/kernel/qguiapplication/CMakeLists.txt34
-rw-r--r--tests/auto/gui/kernel/qguivariant/test/CMakeLists.txt21
-rw-r--r--tests/auto/gui/kernel/qkeysequence/CMakeLists.txt22
4 files changed, 27 insertions, 54 deletions
diff --git a/tests/auto/gui/kernel/CMakeLists.txt b/tests/auto/gui/kernel/CMakeLists.txt
index 74657ed1b6..1e72872516 100644
--- a/tests/auto/gui/kernel/CMakeLists.txt
+++ b/tests/auto/gui/kernel/CMakeLists.txt
@@ -22,7 +22,9 @@ add_subdirectory(qpalette)
add_subdirectory(qscreen)
add_subdirectory(qsurfaceformat)
add_subdirectory(qwindow)
-add_subdirectory(qguiapplication)
+if(QT_FEATURE_private_tests)
+ add_subdirectory(qguiapplication)
+endif()
add_subdirectory(qpixelformat)
add_subdirectory(qrasterwindow)
add_subdirectory(qaddpostroutine)
diff --git a/tests/auto/gui/kernel/qguiapplication/CMakeLists.txt b/tests/auto/gui/kernel/qguiapplication/CMakeLists.txt
index ffd07cad26..1518df22a4 100644
--- a/tests/auto/gui/kernel/qguiapplication/CMakeLists.txt
+++ b/tests/auto/gui/kernel/qguiapplication/CMakeLists.txt
@@ -1,9 +1,5 @@
# Generated from qguiapplication.pro.
-if(NOT QT_FEATURE_private_tests)
- return()
-endif()
-
#####################################################################
## tst_qguiapplication Test:
#####################################################################
@@ -16,6 +12,12 @@ else()
endif()
# special case end
+# Resources:
+set(tst_qguiapplication_resource_files
+ "icons/appicon.png"
+ "icons/usericon.png"
+)
+
qt_internal_add_test(tst_qguiapplication
VERSION ${target_version} # special case
SOURCES
@@ -28,19 +30,8 @@ qt_internal_add_test(tst_qguiapplication
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
-)
-
-# Resources:
-set(tst_qguiapplication_resource_files
- "icons/appicon.png"
- "icons/usericon.png"
-)
-
-qt_internal_add_resource(tst_qguiapplication "tst_qguiapplication"
- PREFIX
- "/"
- FILES
- ${tst_qguiapplication_resource_files}
+ TESTDATA ${tst_qguiapplication_resource_files}
+ BUILTIN_TESTDATA
)
# special case begin
@@ -49,12 +40,3 @@ if (APPLE)
set_property(TARGET tst_qguiapplication PROPERTY PROPERTY MACOSX_BUNDLE TRUE)
endif()
# special case end
-
-## Scopes:
-#####################################################################
-
-#### Keys ignored in scope 3:.:../../../corelib/kernel/qcoreapplication:../../../corelib/kernel/qcoreapplication/qcoreapplication.pro:WIN32:
-# VERSION = "1.2.3.4"
-
-#### Keys ignored in scope 4:.:../../../corelib/kernel/qcoreapplication:../../../corelib/kernel/qcoreapplication/qcoreapplication.pro:else:
-# VERSION = "1.2.3"
diff --git a/tests/auto/gui/kernel/qguivariant/test/CMakeLists.txt b/tests/auto/gui/kernel/qguivariant/test/CMakeLists.txt
index a3292511bd..49e985fa82 100644
--- a/tests/auto/gui/kernel/qguivariant/test/CMakeLists.txt
+++ b/tests/auto/gui/kernel/qguivariant/test/CMakeLists.txt
@@ -4,6 +4,12 @@
## tst_qguivariant Test:
#####################################################################
+# Resources:
+file(GLOB_RECURSE qguivariant_resource_files
+ RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
+ "data/*"
+)
+
qt_internal_add_test(tst_qguivariant
SOURCES
tst_qguivariant.cpp
@@ -11,17 +17,6 @@ qt_internal_add_test(tst_qguivariant
../../../../other/qvariant_common
PUBLIC_LIBRARIES
Qt::Gui
+ TESTDATA ${qguivariant_resource_files}
+ BUILTIN_TESTDATA
)
-
-# Resources:
-set(qguivariant_resource_files
- "data"
-)
-
-qt_internal_add_resource(tst_qguivariant "qguivariant"
- PREFIX
- "/"
- FILES
- ${qguivariant_resource_files}
-)
-
diff --git a/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt b/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt
index 9d0e25d356..ea71ce3870 100644
--- a/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt
+++ b/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt
@@ -4,6 +4,12 @@
## tst_qkeysequence Test:
#####################################################################
+# Resources:
+set(qkeysequence_resource_files
+ "keys_de.qm"
+ "qt_de.qm"
+)
+
qt_internal_add_test(tst_qkeysequence
SOURCES
tst_qkeysequence.cpp
@@ -11,18 +17,6 @@ qt_internal_add_test(tst_qkeysequence
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
+ TESTDATA ${qkeysequence_resource_files}
+ BUILTIN_TESTDATA
)
-
-# Resources:
-set(qkeysequence_resource_files
- "keys_de.qm"
- "qt_de.qm"
-)
-
-qt_internal_add_resource(tst_qkeysequence "qkeysequence"
- PREFIX
- "/"
- FILES
- ${qkeysequence_resource_files}
-)
-