diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 21:06:47 +0200 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 21:06:47 +0200 |
commit | 42e4ae042a4c86e58bcb8b6d2d59ba4a988285b4 (patch) | |
tree | a7f25b1d335a834a7c3ae104cee913ef3a4dd4fb /tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp | |
parent | 4ee4fc18b4067b90efa46ca9baba74f53b54d9ec (diff) | |
parent | 168ff3419f256fdb35b586275d293fc0cd773fe1 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl
Change-Id: Iaff6b55275e50d19973e1020853d8622587069f9
Diffstat (limited to 'tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp')
-rw-r--r-- | tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp index fa2d5e3723..6be2744f3e 100644 --- a/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp +++ b/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp @@ -35,6 +35,7 @@ #include <QTest> #include <QThread> #include <QElapsedTimer> +#include <QScopeGuard> #define EXISTING_SHARE "existing" #define EXISTING_SIZE 1024 @@ -444,8 +445,20 @@ void tst_QSharedMemory::readOnly() QSKIP("No qprocess support", SkipAll); #elif defined(Q_OS_MACOS) QSKIP("QTBUG-59936: Times out on macOS", SkipAll); +#elif defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) + QSKIP("ASan prevents the crash this test is looking for.", SkipAll); #else rememberKey("readonly_segfault"); + + // Add the executable's directory to path so that we can find the test helper next to it + // in a cross-platform way. We must do this because the CWD is not pointing to this directory + // in debug-and-release builds. + QByteArray path = qgetenv("PATH"); + qputenv("PATH", + path + QDir::listSeparator().toLatin1() + + QCoreApplication::applicationDirPath().toLocal8Bit()); + auto restore = qScopeGuard([&] { qputenv("PATH", path); }); + // ### on windows disable the popup somehow QProcess p; p.start(m_helperBinary, QStringList("readonly_segfault")); @@ -747,6 +760,15 @@ void tst_QSharedMemory::simpleProcessProducerConsumer() rememberKey("market"); + // Add the executable's directory to path so that we can find the test helper next to it + // in a cross-platform way. We must do this because the CWD is not pointing to this directory + // in debug-and-release builds. + QByteArray path = qgetenv("PATH"); + qputenv("PATH", + path + QDir::listSeparator().toLatin1() + + QCoreApplication::applicationDirPath().toLocal8Bit()); + auto restore = qScopeGuard([&] { qputenv("PATH", path); }); + QProcess producer; producer.start(m_helperBinary, QStringList("producer")); QVERIFY2(producer.waitForStarted(), "Could not start helper binary"); |