diff --git a/tests/auto/corelib/text/CMakeLists.txt b/tests/auto/corelib/text/CMakeLists.txt index 4d24e674ba3..bee0c5cf44c 100644 --- a/tests/auto/corelib/text/CMakeLists.txt +++ b/tests/auto/corelib/text/CMakeLists.txt @@ -15,7 +15,9 @@ add_subdirectory(qchar) add_subdirectory(qcollator) add_subdirectory(qlatin1stringmatcher) add_subdirectory(qlatin1stringview) +if (NOT WASM) # QTBUG-121822 add_subdirectory(qregularexpression) +endif() add_subdirectory(qstring) add_subdirectory(qstring_no_cast_from_bytearray) add_subdirectory(qstringapisymmetry) diff --git a/tests/auto/corelib/text/qregularexpression/CMakeLists.txt b/tests/auto/corelib/text/qregularexpression/CMakeLists.txt index a7a7fe298f2..2c67a161843 100644 --- a/tests/auto/corelib/text/qregularexpression/CMakeLists.txt +++ b/tests/auto/corelib/text/qregularexpression/CMakeLists.txt @@ -14,6 +14,10 @@ endif() qt_internal_add_test(tst_qregularexpression SOURCES tst_qregularexpression.cpp + NO_BATCH # QTBUG-121815 + DEFINES + QTEST_THROW_ON_FAIL + QTEST_THROW_ON_SKIP LIBRARIES Qt::TestPrivate ) diff --git a/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp index d0ce4140953..53a6d83d502 100644 --- a/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp +++ b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp @@ -16,6 +16,10 @@ #include #include +#ifndef QTEST_THROW_ON_FAIL +# error This test requires QTEST_THROW_ON_FAIL being active. +#endif + Q_DECLARE_METATYPE(QRegularExpression::PatternOptions) Q_DECLARE_METATYPE(QRegularExpression::MatchType) Q_DECLARE_METATYPE(QRegularExpression::MatchOptions) @@ -292,11 +296,7 @@ void consistencyCheck(const QRegularExpressionMatchIterator &iterator) QRegularExpressionMatch peeked = i.peekNext(); QRegularExpressionMatch match = i.next(); consistencyCheck(peeked); - if (QTest::currentTestFailed()) - return; consistencyCheck(match); - if (QTest::currentTestFailed()) - return; QVERIFY(match.isValid()); QVERIFY(match.hasMatch() || match.hasPartialMatch()); QCOMPARE(i.regularExpression(), match.regularExpression()); @@ -544,8 +544,6 @@ void tst_QRegularExpression::moveSemanticsMatch() QCOMPARE(match2.capturedStart(), 3); QCOMPARE(match2.capturedEnd(), 7); consistencyCheck(match2); - if (QTest::currentTestFailed()) - return; QRegularExpressionMatch match3 = re.match("test1"); QCOMPARE(match3.hasMatch(), true); @@ -558,8 +556,6 @@ void tst_QRegularExpression::moveSemanticsMatch() QCOMPARE(match1.capturedStart(), 0); QCOMPARE(match1.capturedEnd(), 4); consistencyCheck(match1); - if (QTest::currentTestFailed()) - return; // here match3 is in the moved-from state, so destructor call for moved-from // object is also checked @@ -578,8 +574,6 @@ void tst_QRegularExpression::moveSemanticsMatchIterator() QVERIFY(it2.hasNext()); QT_TEST_EQUALITY_OPS(it2.regularExpression(), re, true); consistencyCheck(it2); - if (QTest::currentTestFailed()) - return; QRegularExpression re2("test"); QRegularExpressionMatchIterator it3 = re2.globalMatch("123test456"); @@ -593,8 +587,6 @@ void tst_QRegularExpression::moveSemanticsMatchIterator() QVERIFY(it1.hasNext()); QT_TEST_EQUALITY_OPS(it1.regularExpression(), re2, true); consistencyCheck(it1); - if (QTest::currentTestFailed()) - return; // here it3 is in the moved-from state, so destructor call for moved-from // object is also checked