summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2022-04-20 14:02:10 +0300
committerTomi Korpipaa <tomi.korpipaa@qt.io>2022-05-11 07:05:18 +0300
commit3c5e2bc94664cff57c11a5229a785803c1b98689 (patch)
tree2e6d79baa94173350c196aeaa3d030b4dc54e48b
parent62a452765f44e23e25dc5a2899854b1c3cab96ac (diff)
Fix a qt-testrunner.py QEMU failure
Fixes: QTBUG-102735 Change-Id: I7e4941ffe6bec251957e6d3fe96e69cc797625b3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 23e093c7bb021a9ae1071e680388286909fbf90f) Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--tests/auto/qmltest/tst_qmltest.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/auto/qmltest/tst_qmltest.cpp b/tests/auto/qmltest/tst_qmltest.cpp
index 26d56de6..d71ad912 100644
--- a/tests/auto/qmltest/tst_qmltest.cpp
+++ b/tests/auto/qmltest/tst_qmltest.cpp
@@ -28,21 +28,33 @@
****************************************************************************/
#include <QtQuickTest/quicktest.h>
+
+class tst_skiptest: public QObject
+{
+ Q_OBJECT
+private slots:
+ void skiptest() { QSKIP("This test will fail, skipping."); };
+};
+
int main(int argc, char **argv)
{
if (!qEnvironmentVariableIsEmpty("QEMU_LD_PREFIX")) {
- qWarning("This test will fail due to QEMU emulation shortcomings.");
- return 0;
+ qWarning("This test would fail due to QEMU emulation shortcomings, so it will be skipped.");
+ tst_skiptest skip;
+ return QTest::qExec(&skip);
}
#ifdef Q_OS_QNX
if (qEnvironmentVariable("QTEST_ENVIRONMENT").split(' ').contains("ci") &&
qEnvironmentVariable("QT_QPA_PLATFORM").split(' ').contains("offscreen")
) {
- qWarning("This test will fail on CI QNX QEMU without OpenGL support.");
- return 0;
+ qWarning("This test would fail on CI QNX QEMU without OpenGL support, so it will be skipped.");
+ tst_skiptest skip;
+ return QTest::qExec(&skip);
}
#endif
qputenv("QSG_RHI_BACKEND", "opengl");
QTEST_SET_MAIN_SOURCE_PATH
return quick_test_main(argc, argv, "qmltest", QUICK_TEST_SOURCE_DIR);
}
+
+#include "tst_qmltest.moc"