summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2024-01-10 15:00:42 +0100
committerRobert Griebl <robert.griebl@qt.io>2024-01-12 15:11:17 +0100
commit8a50dd3a812a76b35e3174e90e5c9ff65210aa85 (patch)
treee3cbdc76197f3ba3062ac6790b3f74db5509f8d8
parenta193e59eebcaab22fd390339a13a83b2b5d0e947 (diff)
Disable the crash test on ASAN builds
Change-Id: I201c609153d87ad3bf35ace3a46559aaca0c966a Fixes: QTBUG-120326 Pick-to: 6.7 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
-rw-r--r--src/tools/testrunner/amtest.cpp9
-rw-r--r--src/tools/testrunner/amtest.h2
-rw-r--r--tests/auto/qml/crash/tst_crash.qml3
3 files changed, 14 insertions, 0 deletions
diff --git a/src/tools/testrunner/amtest.cpp b/src/tools/testrunner/amtest.cpp
index 52d3912b..cd2631e6 100644
--- a/src/tools/testrunner/amtest.cpp
+++ b/src/tools/testrunner/amtest.cpp
@@ -46,6 +46,15 @@ QString AmTest::qtVersion() const
return QString::fromLatin1(QT_VERSION_STR);
}
+bool AmTest::isAsanBuild() const
+{
+#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
+ return true;
+#else
+ return false;
+#endif
+}
+
static QtMsgType convertMsgType(AmTest::MsgType type)
{
QtMsgType ret;
diff --git a/src/tools/testrunner/amtest.h b/src/tools/testrunner/amtest.h
index 3c03df21..a138e92b 100644
--- a/src/tools/testrunner/amtest.h
+++ b/src/tools/testrunner/amtest.h
@@ -18,6 +18,7 @@ class AmTest : public QObject
Q_PROPERTY(int timeoutFactor READ timeoutFactor CONSTANT FINAL)
Q_PROPERTY(QVariant buildConfig READ buildConfig CONSTANT FINAL)
Q_PROPERTY(QString qtVersion READ qtVersion CONSTANT FINAL)
+ Q_PROPERTY(bool asanBuild READ isAsanBuild CONSTANT FINAL)
AmTest();
@@ -30,6 +31,7 @@ public:
int timeoutFactor() const;
QVariant buildConfig() const;
QString qtVersion() const;
+ bool isAsanBuild() const;
Q_INVOKABLE void ignoreMessage(QtAM::AmTest::MsgType type, const char* msg);
Q_INVOKABLE void ignoreMessage(QtAM::AmTest::MsgType type, const QRegularExpression &expression);
diff --git a/tests/auto/qml/crash/tst_crash.qml b/tests/auto/qml/crash/tst_crash.qml
index 00940ce6..0f42561f 100644
--- a/tests/auto/qml/crash/tst_crash.qml
+++ b/tests/auto/qml/crash/tst_crash.qml
@@ -39,6 +39,9 @@ TestCase {
}
function test_crash(data) {
+ if (AmTest.asanBuild)
+ skip("This test is not compatible with ASAN builds")
+
ApplicationManager.startApplication(appId);
runStateChangedSpy.wait(spyTimeout);
runStateChangedSpy.wait(spyTimeout);