diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qmltest/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/qmltest/tst_qmltest.cpp | 20 |
2 files changed, 22 insertions, 4 deletions
diff --git a/tests/auto/qmltest/CMakeLists.txt b/tests/auto/qmltest/CMakeLists.txt index 8ab433b4..3a53e40f 100644 --- a/tests/auto/qmltest/CMakeLists.txt +++ b/tests/auto/qmltest/CMakeLists.txt @@ -1,9 +1,15 @@ +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *) +list(APPEND test_data ${test_data_glob}) + qt_internal_add_test(tst_qmltest QMLTEST SOURCES tst_qmltest.cpp PUBLIC_LIBRARIES Qt::Gui + TESTDATA ${test_data} ) set(qmltest_resource_files diff --git a/tests/auto/qmltest/tst_qmltest.cpp b/tests/auto/qmltest/tst_qmltest.cpp index 26d56de6..cde45b0b 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_qmltest: 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_qmltest skip; + return QTest::qExec(&skip, argc, argv); } #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_qmltest skip; + return QTest::qExec(&skip, argc, argv); } #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" |