summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qstring/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/text/qstring/CMakeLists.txt')
-rw-r--r--tests/auto/corelib/text/qstring/CMakeLists.txt60
1 files changed, 39 insertions, 21 deletions
diff --git a/tests/auto/corelib/text/qstring/CMakeLists.txt b/tests/auto/corelib/text/qstring/CMakeLists.txt
index e5f64742a2..80917554d2 100644
--- a/tests/auto/corelib/text/qstring/CMakeLists.txt
+++ b/tests/auto/corelib/text/qstring/CMakeLists.txt
@@ -1,29 +1,47 @@
-# Generated from qstring.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-#####################################################################
-## tst_qstring Test:
-#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qstring LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
-qt_internal_add_test(tst_qstring
- SOURCES
- tst_qstring.cpp
- DEFINES
- QT_DISABLE_DEPRECATED_BEFORE=0
- PUBLIC_LIBRARIES
- Qt::CorePrivate
-)
+if(NOT QT_FEATURE_doubleconversion AND NOT QT_FEATURE_system_doubleconversion)
+ list(APPEND tst_qstring_extra_defines QT_NO_DOUBLECONVERSION)
+endif()
-## Scopes:
-#####################################################################
+if(APPLE)
+ list(APPEND tst_qstring_extra_libraries ${FWFoundation})
+ list(APPEND tst_qstring_extra_sources tst_qstring_mac.mm)
+endif()
+if(WASM)
+ list(APPEND tst_qstring_extra_sources tst_qstring_wasm.cpp)
+endif()
-qt_internal_extend_target(tst_qstring CONDITION NOT QT_FEATURE_doubleconversion AND NOT QT_FEATURE_system_doubleconversion
+foreach(test tst_qstring tst_qstring_restricted_ascii tst_qstring_no_cast_from_ascii)
+ qt_internal_add_test(${test}
+ NO_BATCH
+ SOURCES
+ tst_qstring.cpp
+ ${tst_qstring_extra_sources}
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::TestPrivate
+ ${tst_qstring_extra_libraries}
+ DEFINES
+ ${tst_qstring_extra_defines}
+ )
+endforeach()
+
+qt_internal_extend_target(tst_qstring_restricted_ascii
DEFINES
- QT_NO_DOUBLECONVERSION
+ QT_RESTRICTED_CAST_FROM_ASCII
+ tst_QString=tst_QString_restricted_ascii
)
-qt_internal_extend_target(tst_qstring CONDITION APPLE
- SOURCES
- tst_qstring_mac.mm
- PUBLIC_LIBRARIES
- ${FWFoundation}
+qt_internal_extend_target(tst_qstring_no_cast_from_ascii
+ DEFINES
+ QT_NO_CAST_FROM_ASCII
+ tst_QString=tst_QString_no_cast_from_ascii
)