diff options
Diffstat (limited to 'tests/auto/testlib/selftests/subtest')
-rw-r--r-- | tests/auto/testlib/selftests/subtest/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/subtest/tst_subtest.cpp | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/tests/auto/testlib/selftests/subtest/CMakeLists.txt b/tests/auto/testlib/selftests/subtest/CMakeLists.txt index 588c764b5c..3dad026cf3 100644 --- a/tests/auto/testlib/selftests/subtest/CMakeLists.txt +++ b/tests/auto/testlib/selftests/subtest/CMakeLists.txt @@ -1,15 +1,14 @@ # Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -# Generated from subtest.pro. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## subtest Binary: ##################################################################### qt_internal_add_executable(subtest - NO_INSTALL # special case - OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + NO_INSTALL + EXCEPTIONS + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} SOURCES tst_subtest.cpp LIBRARIES @@ -19,6 +18,4 @@ qt_internal_add_executable(subtest ## Scopes: ##################################################################### -# special case begin qt_internal_apply_testlib_coverage_options(subtest) -# special case end diff --git a/tests/auto/testlib/selftests/subtest/tst_subtest.cpp b/tests/auto/testlib/selftests/subtest/tst_subtest.cpp index 86969bc590..023c43e2af 100644 --- a/tests/auto/testlib/selftests/subtest/tst_subtest.cpp +++ b/tests/auto/testlib/selftests/subtest/tst_subtest.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#undef QTEST_THROW_ON_FAILURE // code expects old behavior +#undef QTEST_THROW_ON_SKIP // code expects old behavior #include <QtCore/QCoreApplication> #include <QtCore/QDebug> @@ -111,6 +113,7 @@ void tst_Subtest::test3() void tst_Subtest::multiFail() { + const QTest::ThrowOnFailDisabler nothrow; // tests repeated QFAILs // Simulates tests which call a shared function that does common checks, or // that do checks in code run asynchronously from a message loop. for (int i = 0; i < 10; ++i) @@ -120,6 +123,7 @@ void tst_Subtest::multiFail() void tst_Subtest::multiSkip() { + const QTest::ThrowOnSkipDisabler nothrow; // tests repeated QSKIPs // Similar to multiFail() for (int i = 0; i < 10; ++i) []() { QSKIP("This skip should be repeated ten times"); }(); |