summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEven Oscar Andersen <even.oscar.andersen@qt.io>2024-02-21 10:42:24 +0100
committerEven Oscar Andersen <even.oscar.andersen@qt.io>2024-05-06 16:01:28 +0200
commita99285c9779a0b1290d1daadee7d9e923a86d479 (patch)
tree74d0f581dcd48f12ab8110c6931caa7832c376f7
parent7b738ffc583a19138d9772d7ed84c8d771c85a77 (diff)
wasm: Enable qstandardpaths test
Also log if the entries does not exist in the filesystem Change-Id: Id7d4dec1610af13869e645cf96b5bf6a1e26b956 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--tests/auto/CMakeLists.txt1
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp8
2 files changed, 8 insertions, 1 deletions
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<QString> (*)(QDir &);