summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/testlib/selftests/CMakeLists.txt')
-rw-r--r--tests/auto/testlib/selftests/CMakeLists.txt47
1 files changed, 27 insertions, 20 deletions
diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt
index 2dd26211f2..9e17638a66 100644
--- a/tests/auto/testlib/selftests/CMakeLists.txt
+++ b/tests/auto/testlib/selftests/CMakeLists.txt
@@ -1,9 +1,25 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# The whole file is written manually.
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_selftests LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
include(../../../../src/testlib/selfcover.cmake)
# ------------- Test runner -------------
+# Resources:
+
+file(GLOB qmake_expected_files_resource_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "expected_*")
+foreach(file IN LISTS qmake_expected_files_resource_files)
+ set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
+endforeach()
+
qt_internal_add_test(tst_selftests
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
EXCEPTIONS
@@ -11,8 +27,12 @@ qt_internal_add_test(tst_selftests
SOURCES
tst_selftests.cpp
catch.cpp
- PUBLIC_LIBRARIES
+ NO_PCH_SOURCES
+ tst_selftests.cpp # undef QT_NO_FOREACH
+ LIBRARIES
Qt::TestPrivate
+ TESTDATA ${qmake_expected_files_resource_files}
+ BUILTIN_TESTDATA
# These lines need to be commented out as they need to be enabled
# COMPILE_OPTIONS
# conditionally
@@ -24,25 +44,6 @@ qt_internal_add_test(tst_selftests
# "$$COVERAGE_OPTIONS"
)
-file(GLOB resource_glob_0 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "expected_*")
-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_expected_files_resource_files
- ${resource_glob_0}
-)
-
-qt_internal_add_resource(tst_selftests "qmake_expected_files"
- PREFIX
- "/"
- BASE
- "${CMAKE_CURRENT_SOURCE_DIR}"
- FILES
- ${qmake_expected_files_resource_files}
-)
-
qt_internal_apply_testlib_coverage_options(tst_selftests)
# ------------- Sub tests -------------
@@ -66,9 +67,12 @@ set(subprograms
deleteLater
deleteLater_noApp
differentexec
+ eventloop
exceptionthrow
expectfail
+ extendedcompare
failcleanup
+ failcleanuptestcase
faildatatype
failfetchtype
failinit
@@ -87,10 +91,13 @@ set(subprograms
printdatatagswithglobaltags
qexecstringlist
silent
+ silent_fatal
signaldumper
singleskip
skip
+ skipblacklisted
skipcleanup
+ skipcleanuptestcase
skipinit
skipinitdata
sleep