diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-02-07 13:57:22 +0100 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2022-02-14 18:05:06 +0100 |
commit | 116ba6f3846569359450424b66f8786ec00ed7cd (patch) | |
tree | 0c4a8e5109351f8b500843a87ff565a49617bf14 /tests | |
parent | 4728efae2c6b7f2f0beae5773472af1817649aaa (diff) |
qmltc: Explicitly unsupport singleton types
Change-Id: I05525f884f239c954527f24ad8842b108b32aff1
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
(cherry picked from commit 121457933dfa40de188063fefe86fa78881e18cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmltc_qprocess/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmltc_qprocess/data/SingletonThing.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltc_qprocess/CMakeLists.txt b/tests/auto/qml/qmltc_qprocess/CMakeLists.txt index 46f1d856d3..1c98cc7e68 100644 --- a/tests/auto/qml/qmltc_qprocess/CMakeLists.txt +++ b/tests/auto/qml/qmltc_qprocess/CMakeLists.txt @@ -12,7 +12,11 @@ qt6_add_qml_module(tst_qmltc_qprocess QML_FILES data/dummy.qml data/inlineComponent.qml + data/SingletonThing.qml ) +# special setup for singleton files: +set_source_files_properties(SingletonThing.qml PROPERTIES QT_QML_SINGLETON_TYPE true) + add_dependencies(tst_qmltc_qprocess Qt::qmltc) # fetch --resource arguments manually (mimics the logic of qmltc compilation diff --git a/tests/auto/qml/qmltc_qprocess/data/SingletonThing.qml b/tests/auto/qml/qmltc_qprocess/data/SingletonThing.qml new file mode 100644 index 0000000000..599b54eddd --- /dev/null +++ b/tests/auto/qml/qmltc_qprocess/data/SingletonThing.qml @@ -0,0 +1,7 @@ +pragma Singleton +import QtQml + +QtObject { + property int integerProperty: 42 + property string stringProperty: "hello" +} diff --git a/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp b/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp index 7ba31fc652..684c57eabf 100644 --- a/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp +++ b/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp @@ -68,6 +68,7 @@ private slots: void noBuiltins(); void noQtQml(); void inlineComponent(); + void singleton(); }; #ifndef TST_QMLTC_QPROCESS_RESOURCES @@ -200,5 +201,12 @@ void tst_qmltc_qprocess::inlineComponent() QVERIFY(!errors.contains(u"Inline components are not supported"_qs)); } +void tst_qmltc_qprocess::singleton() +{ + const auto errors = runQmltc(u"SingletonThing.qml"_qs, false); + QEXPECT_FAIL("", "qmltc does not support singletons at the moment", Continue); + QVERIFY(!errors.contains(u"Singleton types are not supported"_qs)); +} + QTEST_MAIN(tst_qmltc_qprocess) #include "tst_qmltc_qprocess.moc" |