aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/test_qml_app_deployment/main.cpp
blob: 00ee6cf8eb64e3c5d184f1740bb6a6a9189bdf2f (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
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtQml/QQmlEngine>
#include <QtQuick/QQuickView>
#include <QtTest/QTest>

#include <QtQuickTestUtils/private/viewtestutils_p.h>

class test_qml_app_deployment : public QObject
{
    Q_OBJECT
private slots:
    void canRun();
};


void test_qml_app_deployment::canRun()
{
    QQuickView view;
#ifdef QT_STATIC
    // Need to add qrc:/// as an import path when using Qt static builds,
    // to ensure that user module qmldir files are found from the embedded resources
    // and not from the filesystem.
    view.engine()->addImportPath(QLatin1String("qrc:///"));
#endif
    QVERIFY(QQuickTest::showView(view, QUrl("qrc:///main.qml")));
}

QTEST_MAIN(test_qml_app_deployment)

#include "main.moc"