diff --git a/tests/auto/corelib/global/CMakeLists.txt b/tests/auto/corelib/global/CMakeLists.txt index 8adf9d74306..2b26c494d04 100644 --- a/tests/auto/corelib/global/CMakeLists.txt +++ b/tests/auto/corelib/global/CMakeLists.txt @@ -4,7 +4,9 @@ if(NOT INTEGRITY) add_subdirectory(qcompare) endif() +if(NOT WASM) # QTBUG-121822 add_subdirectory(qcomparehelpers) +endif() add_subdirectory(qflags) add_subdirectory(q_func_info) add_subdirectory(qgetputenv) diff --git a/tests/auto/corelib/global/qcomparehelpers/CMakeLists.txt b/tests/auto/corelib/global/qcomparehelpers/CMakeLists.txt index 31d8bff0a5b..6b584dc7cac 100644 --- a/tests/auto/corelib/global/qcomparehelpers/CMakeLists.txt +++ b/tests/auto/corelib/global/qcomparehelpers/CMakeLists.txt @@ -11,6 +11,10 @@ qt_internal_add_test(tst_qcomparehelpers SOURCES tst_qcomparehelpers.h tst_qcomparehelpers.cpp tst_qcomparehelpers1.cpp wrappertypes.h + NO_BATCH # QTBUG-121815 + DEFINES + QTEST_THROW_ON_FAIL + QTEST_THROW_ON_SKIP LIBRARIES Qt::TestPrivate ) @@ -22,7 +26,10 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20" AND NOT MACOS AND NOT VXWORKS AND SOURCES tst_qcomparehelpers.h tst_qcomparehelpers.cpp tst_qcomparehelpers1.cpp wrappertypes.h + NO_BATCH # QTBUG-121815 DEFINES + QTEST_THROW_ON_FAIL + QTEST_THROW_ON_SKIP tst_QCompareHelpers=tst_QCompareHelpersCpp23 LIBRARIES Qt::TestPrivate diff --git a/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp b/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp index 466723a271d..a49504db8b3 100644 --- a/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp +++ b/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp @@ -4,6 +4,8 @@ #include "tst_qcomparehelpers.h" #include "wrappertypes.h" +#include + #if defined(__STDCPP_FLOAT16_T__) && __has_include() #include #endif @@ -109,32 +111,12 @@ void tst_QCompareHelpers::compareStringData() void tst_QCompareHelpers::comparisonCompiles() { QTestPrivate::testAllComparisonOperatorsCompile(); - if (QTest::currentTestFailed()) - return; - QTestPrivate::testAllComparisonOperatorsCompile(); - if (QTest::currentTestFailed()) - return; - QTestPrivate::testAllComparisonOperatorsCompile(); - if (QTest::currentTestFailed()) - return; - QTestPrivate::testAllComparisonOperatorsCompile(); - if (QTest::currentTestFailed()) - return; - QTestPrivate::testAllComparisonOperatorsCompile(); - if (QTest::currentTestFailed()) - return; - QTestPrivate::testAllComparisonOperatorsCompile>(); - if (QTest::currentTestFailed()) - return; - QTestPrivate::testAllComparisonOperatorsCompile, QAnyStringView>(); - if (QTest::currentTestFailed()) - return; } void tst_QCompareHelpers::compare_IntWrapper_data() @@ -498,11 +480,14 @@ enum class TestEnum : quint8 { void tst_QCompareHelpers::builtinOrder() { #define TEST_BUILTIN(Left, Right) \ - testOrderForTypes(); \ - if (QTest::currentTestFailed()) { \ - qDebug("Failed Qt::compareThreeWay() test for builtin types " #Left " and " #Right); \ - return; \ - } + do { \ + auto printOnFailure = qScopeGuard([] { \ + qDebug("Failed Qt::compareThreeWay() test for builtin types %s and %s", \ + #Left, #Right); \ + }); \ + testOrderForTypes(); \ + printOnFailure.dismiss(); \ + } while (false); // some combinations TEST_BUILTIN(char, char) diff --git a/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.h b/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.h index 837170d2381..89d8a269475 100644 --- a/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.h +++ b/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.h @@ -9,6 +9,10 @@ #include #include +#ifndef QTEST_THROW_ON_FAIL +# error This test requires QTEST_THROW_ON_FAIL being active. +#endif + class tst_QCompareHelpers : public QObject { Q_OBJECT