diff options
author | Ulf Hermann <[email protected]> | 2025-04-11 13:02:07 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2025-04-15 19:27:07 +0200 |
commit | afb51a7e91607a6c99c14d0ae8cd46f8d2954fd2 (patch) | |
tree | 206d99310ab677d79dcaaab50dd67db20a2ed60c /tests | |
parent | 373782c1c094c22f0efe03b5d2f726631f9ccf46 (diff) |
qmltc: Cleanly reject custom parsed properties
Process all properties of custom parsed types and generate errors if the
custom parsed properties are actually used. Then print an extra error
stating that qmltc does not support custom parsers.
Pick-to: 6.9 6.8
Fixes: QTBUG-134206
Change-Id: I37e4f3f8d0ee4e0926c0d64c99a4a521b093a1ab
Reviewed-by: Sami Shalayel <[email protected]>
Reviewed-by: Olivier De Cannière <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmltc_qprocess/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/qml/qmltc_qprocess/data/customParsed.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp | 16 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltc_qprocess/CMakeLists.txt b/tests/auto/qml/qmltc_qprocess/CMakeLists.txt index bcde6ac3bb..0145c48657 100644 --- a/tests/auto/qml/qmltc_qprocess/CMakeLists.txt +++ b/tests/auto/qml/qmltc_qprocess/CMakeLists.txt @@ -48,6 +48,7 @@ qt6_add_qml_module(tst_qmltc_qprocess data/componentDefinitionInnerRequiredProperty.qml data/componentDefinitionInnerRequiredPropertyFromOutside.qml data/innerLevelRequiredProperty.qml + data/customParsed.qml NO_GENERATE_EXTRA_QMLDIRS ) diff --git a/tests/auto/qml/qmltc_qprocess/data/customParsed.qml b/tests/auto/qml/qmltc_qprocess/data/customParsed.qml new file mode 100644 index 0000000000..c33aa2f0c8 --- /dev/null +++ b/tests/auto/qml/qmltc_qprocess/data/customParsed.qml @@ -0,0 +1,7 @@ +import QtQuick + +Item { + ListModel { + ListElement { a: 5 } + } +} diff --git a/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp b/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp index 0caff18ebf..13b2caa330 100644 --- a/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp +++ b/tests/auto/qml/qmltc_qprocess/tst_qmltc_qprocess.cpp @@ -58,6 +58,7 @@ private slots: void componentDefinitionInnerRequiredProperty(); void componentDefinitionInnerRequiredPropertyFromOutside(); void innerLevelRequiredProperty(); + void customParsed(); }; #ifndef TST_QMLTC_QPROCESS_RESOURCES @@ -364,5 +365,20 @@ void tst_qmltc_qprocess::innerLevelRequiredProperty() } } +void tst_qmltc_qprocess::customParsed() +{ + const auto errors = runQmltc(u"customParsed.qml"_s, false); + QVERIFY(errors.contains( + u"customParsed.qml:5:9: Cannot assign to non-existent default property [missing-property]" + )); + QVERIFY(errors.contains( + u"customParsed.qml:5:23: Could not find property \"a\". [missing-property]" + )); + QVERIFY(errors.contains( + u"customParsed.qml:: qmltc does not support custom parsers such as ListModel or old forms " + "of Connections and PropertyChanges. [compiler]" + )); +} + QTEST_MAIN(tst_qmltc_qprocess) #include "tst_qmltc_qprocess.moc" |