From a99285c9779a0b1290d1daadee7d9e923a86d479 Mon Sep 17 00:00:00 2001 From: Even Oscar Andersen Date: Wed, 21 Feb 2024 10:42:24 +0100 Subject: wasm: Enable qstandardpaths test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also log if the entries does not exist in the filesystem Change-Id: Id7d4dec1610af13869e645cf96b5bf6a1e26b956 Reviewed-by: Morten Johan Sørvig --- tests/auto/CMakeLists.txt | 1 + tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 171e83a57a..1297db9b8a 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -66,6 +66,7 @@ if(QT_BUILD_WASM_BATCHED_TESTS) add_subdirectory(corelib/io/qbuffer) add_subdirectory(corelib/io/qabstractfileengine) add_subdirectory(corelib/io/qsettings) + add_subdirectory(corelib/io/qstandardpaths) add_subdirectory(corelib/io/qfileselector) add_subdirectory(corelib/io/qfile) add_subdirectory(corelib/serialization) diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 4bb7042790..84d0a505a4 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -430,7 +430,7 @@ void tst_qstandardpaths::testAppConfigLocation() #endif } -#ifndef Q_OS_WIN +#if !defined(Q_OS_WIN) && !defined(Q_OS_WASM) // Find "sh" on Unix. // It may exist twice, in /bin/sh and /usr/bin/sh, in that case use the PATH order. static inline QFileInfo findSh() @@ -484,6 +484,7 @@ void tst_qstandardpaths::testFindExecutable_data() << QString() << logo << logoPath; } #else +# ifndef Q_OS_WASM const QFileInfo shFi = findSh(); Q_ASSERT(shFi.exists()); const QString shPath = shFi.absoluteFilePath(); @@ -493,6 +494,7 @@ void tst_qstandardpaths::testFindExecutable_data() << QString() << shPath << shPath; QTest::newRow("unix-sh-relativepath") << QString(shFi.absolutePath()) << QString::fromLatin1("./sh") << shPath; +#endif /* !WASM */ #endif QTest::newRow("idontexist") << QString() << QString::fromLatin1("idontexist") << QString(); @@ -524,6 +526,9 @@ void tst_qstandardpaths::testFindExecutable() void tst_qstandardpaths::testFindExecutableLinkToDirectory() { +#ifdef Q_OS_WASM + QSKIP("No applicationdir on wasm"); +#else // link to directory const QString target = QDir::tempPath() + QDir::separator() + QLatin1String("link.lnk"); QFile::remove(target); @@ -531,6 +536,7 @@ void tst_qstandardpaths::testFindExecutableLinkToDirectory() QVERIFY(appFile.link(target)); QVERIFY(QStandardPaths::findExecutable(target).isEmpty()); QFile::remove(target); +#endif } using RuntimeDirSetup = std::optional (*)(QDir &); -- cgit v1.2.3