diff options
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" |