diff options
Diffstat (limited to 'tests/auto/core/qqmlsettings')
-rw-r--r-- | tests/auto/core/qqmlsettings/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/data/aliases.qml | 2 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/data/basic.qml | 2 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/data/categories.qml | 2 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/data/cpp-aliases.qml | 2 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/data/resources.qml | 10 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/data/siblings.qml | 2 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/data/types.qml | 2 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/test_settings.ini | 3 | ||||
-rw-r--r-- | tests/auto/core/qqmlsettings/tst_qqmlsettings.cpp | 14 |
10 files changed, 40 insertions, 8 deletions
diff --git a/tests/auto/core/qqmlsettings/CMakeLists.txt b/tests/auto/core/qqmlsettings/CMakeLists.txt index 0f8b04bbef..2a61b758dd 100644 --- a/tests/auto/core/qqmlsettings/CMakeLists.txt +++ b/tests/auto/core/qqmlsettings/CMakeLists.txt @@ -4,7 +4,7 @@ if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) cmake_minimum_required(VERSION 3.16) project(tst_qqmlsettings LANGUAGES C CXX ASM) - find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) endif() # Collect test data @@ -23,6 +23,13 @@ qt_internal_add_test(tst_qqmlsettings TESTDATA ${test_data} ) +qt_add_resources(tst_qqmlsettings "test_settings" + PREFIX + "/" + FILES + "test_settings.ini" +) + qt_internal_extend_target(tst_qqmlsettings CONDITION ANDROID OR IOS DEFINES QT_QMLTEST_DATADIR=":/data" diff --git a/tests/auto/core/qqmlsettings/data/aliases.qml b/tests/auto/core/qqmlsettings/data/aliases.qml index 547b4d5c13..de05370804 100644 --- a/tests/auto/core/qqmlsettings/data/aliases.qml +++ b/tests/auto/core/qqmlsettings/data/aliases.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQml import QtCore import QtQuick diff --git a/tests/auto/core/qqmlsettings/data/basic.qml b/tests/auto/core/qqmlsettings/data/basic.qml index 2c395b56e3..f23284e199 100644 --- a/tests/auto/core/qqmlsettings/data/basic.qml +++ b/tests/auto/core/qqmlsettings/data/basic.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQml import QtCore diff --git a/tests/auto/core/qqmlsettings/data/categories.qml b/tests/auto/core/qqmlsettings/data/categories.qml index 54cd22a8b1..bac1eb5ebb 100644 --- a/tests/auto/core/qqmlsettings/data/categories.qml +++ b/tests/auto/core/qqmlsettings/data/categories.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQml import QtCore diff --git a/tests/auto/core/qqmlsettings/data/cpp-aliases.qml b/tests/auto/core/qqmlsettings/data/cpp-aliases.qml index 22d7338986..146feb7c80 100644 --- a/tests/auto/core/qqmlsettings/data/cpp-aliases.qml +++ b/tests/auto/core/qqmlsettings/data/cpp-aliases.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQml import QtCore import QtQuick diff --git a/tests/auto/core/qqmlsettings/data/resources.qml b/tests/auto/core/qqmlsettings/data/resources.qml new file mode 100644 index 0000000000..84cf89fbf2 --- /dev/null +++ b/tests/auto/core/qqmlsettings/data/resources.qml @@ -0,0 +1,10 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +import QtQml +import QtCore + +Settings { + category: "test" + location: "qrc:/test_settings.ini" + property string text +} diff --git a/tests/auto/core/qqmlsettings/data/siblings.qml b/tests/auto/core/qqmlsettings/data/siblings.qml index e483623d82..f26312ec67 100644 --- a/tests/auto/core/qqmlsettings/data/siblings.qml +++ b/tests/auto/core/qqmlsettings/data/siblings.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQml import QtCore import QtQuick diff --git a/tests/auto/core/qqmlsettings/data/types.qml b/tests/auto/core/qqmlsettings/data/types.qml index 3f38594323..990a908d02 100644 --- a/tests/auto/core/qqmlsettings/data/types.qml +++ b/tests/auto/core/qqmlsettings/data/types.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQml import QtCore import QtQuick diff --git a/tests/auto/core/qqmlsettings/test_settings.ini b/tests/auto/core/qqmlsettings/test_settings.ini new file mode 100644 index 0000000000..7fc7334438 --- /dev/null +++ b/tests/auto/core/qqmlsettings/test_settings.ini @@ -0,0 +1,3 @@ +# ini file in resources +[test] +text=from resource diff --git a/tests/auto/core/qqmlsettings/tst_qqmlsettings.cpp b/tests/auto/core/qqmlsettings/tst_qqmlsettings.cpp index 1b6ab3f68b..236ce4b3e9 100644 --- a/tests/auto/core/qqmlsettings/tst_qqmlsettings.cpp +++ b/tests/auto/core/qqmlsettings/tst_qqmlsettings.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtTest/QtTest> #include <QtCore/QCoreApplication> @@ -33,6 +33,7 @@ private slots: void siblings(); void initial(); void noApplicationIdentifiersSet(); + void fromResources(); }; // ### Replace keyValueMap("foo", "bar") with QVariantMap({{"foo", "bar"}}) @@ -493,6 +494,17 @@ void tst_QQmlSettings::noApplicationIdentifiersSet() QVERIFY(!settings.value("success").toBool()); } +void tst_QQmlSettings::fromResources() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("resources.qml")); + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + QScopedPointer<QObject> root(component.create()); + QVERIFY(!root.isNull()); + + QCOMPARE(root->property("text").toString(), QLatin1String("from resource")); +} + QTEST_MAIN(tst_QQmlSettings) #include "tst_qqmlsettings.moc" |