summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/tst_qmltest.cpp
blob: 86482f65d5fd8808fbce887ae7f4c3f91fb18cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#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 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 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"