summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
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/corelib/io
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/corelib/io')
-rw-r--r--tests/auto/corelib/io/qfileselector/CMakeLists.txt19
-rw-r--r--tests/auto/corelib/io/qsettings/CMakeLists.txt31
2 files changed, 20 insertions, 30 deletions
diff --git a/tests/auto/corelib/io/qfileselector/CMakeLists.txt b/tests/auto/corelib/io/qfileselector/CMakeLists.txt
index 5f254044df..1ceb91212a 100644
--- a/tests/auto/corelib/io/qfileselector/CMakeLists.txt
+++ b/tests/auto/corelib/io/qfileselector/CMakeLists.txt
@@ -4,13 +4,6 @@
## tst_qfileselectors Test:
#####################################################################
-qt_internal_add_test(tst_qfileselectors
- SOURCES
- tst_qfileselector.cpp
- PUBLIC_LIBRARIES
- Qt::CorePrivate
-)
-
# Resources:
set(qfileselector_resource_files
"extras/+custom1/test"
@@ -62,10 +55,12 @@ set(qfileselector_resource_files
"platforms/test5"
)
-qt_internal_add_resource(tst_qfileselectors "qfileselector"
- PREFIX
- "/"
- FILES
- ${qfileselector_resource_files}
+qt_internal_add_test(tst_qfileselectors
+ SOURCES
+ tst_qfileselector.cpp
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ TESTDATA ${qfileselector_resource_files}
+ BUILTIN_TESTDATA
)
diff --git a/tests/auto/corelib/io/qsettings/CMakeLists.txt b/tests/auto/corelib/io/qsettings/CMakeLists.txt
index 55a360166b..c9ba64f0ca 100644
--- a/tests/auto/corelib/io/qsettings/CMakeLists.txt
+++ b/tests/auto/corelib/io/qsettings/CMakeLists.txt
@@ -4,19 +4,7 @@
## tst_qsettings Test:
#####################################################################
-qt_internal_add_test(tst_qsettings
- SOURCES
- tst_qsettings.cpp
- DEFINES
- QT_DISABLE_DEPRECATED_BEFORE=0
- INCLUDE_DIRECTORIES
- ../../kernel/qmetatype
- PUBLIC_LIBRARIES
- Qt::CorePrivate
- Qt::Gui
-)
-
-# Resources:
+# Test:
set(qsettings_resource_files
"bom.ini"
"resourcefile.ini"
@@ -29,11 +17,18 @@ set(qsettings_resource_files
"float.ini"
)
-qt_internal_add_resource(tst_qsettings "qsettings"
- PREFIX
- "/"
- FILES
- ${qsettings_resource_files}
+qt_internal_add_test(tst_qsettings
+ SOURCES
+ tst_qsettings.cpp
+ DEFINES
+ QT_DISABLE_DEPRECATED_BEFORE=0
+ INCLUDE_DIRECTORIES
+ ../../kernel/qmetatype
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Gui
+ TESTDATA ${qsettings_resource_files}
+ BUILTIN_TESTDATA
)