diff options
8 files changed, 34 insertions, 13 deletions
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 86c55c3a2a..4c59cf7ee3 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -33,10 +33,8 @@ if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS) return() endif() -# Only configure a single auto test for wasm for now -# Since the linking step at this point is prohibitively long (static linking) if(WASM) - add_subdirectory(corelib/text/qchar) + add_subdirectory(corelib/text) return() endif() diff --git a/tests/auto/corelib/text/qbytearray_large/CMakeLists.txt b/tests/auto/corelib/text/qbytearray_large/CMakeLists.txt index 906e84187a..3a2c6b7216 100644 --- a/tests/auto/corelib/text/qbytearray_large/CMakeLists.txt +++ b/tests/auto/corelib/text/qbytearray_large/CMakeLists.txt @@ -7,11 +7,18 @@ if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) endif() +set(compile_and_link_options "") +if(WASM) + list(APPEND compile_and_link_options "-fexceptions") +endif() + qt_internal_add_test(tst_qbytearray_large SOURCES tst_qbytearray_large.cpp LIBRARIES Qt::Core TESTDATA "rfc3252.txt" + COMPILE_OPTIONS ${compile_and_link_options} + LINK_OPTIONS ${compile_and_link_options} ) diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index f59404bf73..90356781bb 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -9,6 +9,7 @@ #include <QScopeGuard> #include <cstring> +#include <iostream> class tst_QCollator : public QObject { @@ -263,7 +264,11 @@ void tst_QCollator::compare() auto asSign = [](int compared) { return compared < 0 ? -1 : compared > 0 ? 1 : 0; }; - +#if defined(Q_OS_WASM) + if (strcmp(QTest::currentDataTag(), "english5") == 0 + || strcmp(QTest::currentDataTag(), "english8") == 0) + QSKIP("Some en-us locale tests have issues on WASM"); +#endif // Q_OS_WASM #if !QT_CONFIG(icu) && !defined(Q_OS_WIN) && !defined(Q_OS_MACOS) if (collator.locale() != QLocale::c() && collator.locale() != QLocale::system().collation()) QSKIP("POSIX implementation of collation only supports C and system collation locales"); diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index c3867f50ec..5de653138b 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -1988,6 +1988,10 @@ void tst_QLocale::formatDateTime() QFETCH(QString, format); QFETCH(QString, result); +#if defined(Q_OS_WASM) + QEXPECT_FAIL("dd MMMM yyyy, hh:mm:ss", "Year 0001 doesn't get properly formatted on WASM C locale", Abort); +#endif // Q_OS_WASM + QLocale l(localeName); QCOMPARE(l.toString(dateTime, format), result); QCOMPARE(l.toString(dateTime, QStringView(format)), result); @@ -2010,16 +2014,16 @@ void tst_QLocale::formatTimeZone() if (europeanTimeZone) { // Time definitely in Standard Time QDateTime dt4 = QDate(2013, 1, 1).startOfDay(); -#ifdef Q_OS_WIN - QEXPECT_FAIL("", "Windows only returns long name (QTBUG-32759)", Continue); -#endif // Q_OS_WIN +#if defined(Q_OS_WIN) || defined(Q_OS_WASM) + QEXPECT_FAIL("", "Windows and Wasm only returns long name (QTBUG-32759)", Continue); +#endif // Q_OS_WIN || Q_OS_WASM QCOMPARE(enUS.toString(dt4, "t"), QLatin1String("CET")); // Time definitely in Daylight Time QDateTime dt5 = QDate(2013, 6, 1).startOfDay(); -#ifdef Q_OS_WIN - QEXPECT_FAIL("", "Windows only returns long name (QTBUG-32759)", Continue); -#endif // Q_OS_WIN +#if defined(Q_OS_WIN) || defined(Q_OS_WASM) + QEXPECT_FAIL("", "Windows and Wasm only returns long name (QTBUG-32759)", Continue); +#endif // Q_OS_WIN || Q_OS_WASM QCOMPARE(enUS.toString(dt5, "t"), QLatin1String("CEST")); } else { qDebug("(Skipped some CET-only tests)"); diff --git a/tests/auto/corelib/text/qstring/CMakeLists.txt b/tests/auto/corelib/text/qstring/CMakeLists.txt index 716953aaad..93bf582e6b 100644 --- a/tests/auto/corelib/text/qstring/CMakeLists.txt +++ b/tests/auto/corelib/text/qstring/CMakeLists.txt @@ -21,6 +21,7 @@ endif() 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} diff --git a/tests/auto/corelib/text/qstring/tst_qstring_wasm.cpp b/tests/auto/corelib/text/qstring/tst_qstring_wasm.cpp index df5ebddc96..c0eda42020 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring_wasm.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring_wasm.cpp @@ -8,9 +8,10 @@ void tst_QString_wasmTypes() { + const QLatin1StringView testString("test string"); // QString <-> emscripten::val { - QString qtString("test string"); + QString qtString = testString; const emscripten::val jsString = qtString.toJsString(); QString qtStringCopy(qtString); qtString = qtString.toUpper(); // modify @@ -19,7 +20,7 @@ void tst_QString_wasmTypes() { QString longString; for (uint64_t i = 0; i < 1000; ++i) - longString += "Lorem ipsum FTW"; + longString += testString; const emscripten::val jsString = longString.toJsString(); QString qtStringCopy(longString); longString = longString.toUpper(); // modify diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index 0d3797b1c3..9664f2ef83 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -23,6 +23,8 @@ Q_DECLARE_METATYPE(QLatin1String) +namespace { + struct QAnyStringViewUsingL1 : QAnyStringView {}; // QAnyStringView with Latin-1 content struct QAnyStringViewUsingU8 : QAnyStringView {}; // QAnyStringView with Utf-8 content struct QAnyStringViewUsingU16 : QAnyStringView {}; // QAnyStringView with Utf-16 content @@ -82,6 +84,8 @@ MAKE_ALL(QUtf8StringView, QLatin1String) #undef MAKE_RELOP // END FIXME +} // namespace + static constexpr int sign(int i) noexcept { return i < 0 ? -1 : diff --git a/tests/auto/corelib/text/qstringtokenizer/tst_qstringtokenizer.cpp b/tests/auto/corelib/text/qstringtokenizer/tst_qstringtokenizer.cpp index 48d053364b..40c4263212 100644 --- a/tests/auto/corelib/text/qstringtokenizer/tst_qstringtokenizer.cpp +++ b/tests/auto/corelib/text/qstringtokenizer/tst_qstringtokenizer.cpp @@ -9,7 +9,7 @@ #include <string> Q_DECLARE_METATYPE(Qt::SplitBehavior) - +namespace { class tst_QStringTokenizer : public QObject { Q_OBJECT @@ -45,6 +45,7 @@ QStringList toQStringList(const Container &c) r.push_back(toQString(e)); return r; } +} // namespace void tst_QStringTokenizer::constExpr() const { |