aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltc/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmltc/CMakeLists.txt')
-rw-r--r--tests/auto/qml/qmltc/CMakeLists.txt143
1 files changed, 15 insertions, 128 deletions
diff --git a/tests/auto/qml/qmltc/CMakeLists.txt b/tests/auto/qml/qmltc/CMakeLists.txt
index 258a330fad..4f468c41e9 100644
--- a/tests/auto/qml/qmltc/CMakeLists.txt
+++ b/tests/auto/qml/qmltc/CMakeLists.txt
@@ -1,148 +1,35 @@
-set(cpp_sources
- tst_qmltc.h tst_qmltc.cpp
+add_subdirectory(data)
- # test files:
+set(test_sources
nameconflict.h nameconflict.cpp
- # attached types:
- cpptypes/testattachedtype.h cpptypes/testattachedtype.cpp
- # grouped types:
- cpptypes/testgroupedtype.h cpptypes/testgroupedtype.cpp
- # private properties:
- cpptypes/testprivateproperty.h cpptypes/testprivateproperty.cpp
- cpptypes/private/testprivateproperty_p.h
-
- cpptypes/typewithproperties.h cpptypes/typewithproperties.cpp
-)
-
-set(qml_sources
- data/HelloWorld.qml
- data/NameConflict.qml
- data/simpleQtQuickTypes.qml
- data/typeWithEnums.qml
- data/methods.qml
- data/properties.qml
- data/ObjectWithId.qml
- data/documentWithIds.qml
- data/importNamespace.qml
- data/ComponentType.qml
- data/componentTypes.qml
-
- data/signalHandlers.qml
- data/javaScriptFunctions.qml
- data/changingBindings.qml
- data/propertyAlias.qml
- data/propertyAlias_external.qml
- data/propertyChangeHandler.qml
- data/NestedHelloWorld.qml
- data/ComponentHelloWorld.qml
- data/listProperty.qml
- data/listPropertySameName.qml
- data/defaultProperty.qml
- data/defaultPropertyCorrectSelection.qml
- # data/defaultAlias.qml
- data/propertyReturningFunction.qml
- data/attachedProperty.qml
- data/groupedProperty.qml
- data/groupedProperty_qquicktext.qml
- data/localImport.qml
- data/localImport_explicit.qml
- data/newPropertyBoundToOld.qml
- data/oldPropertyBoundToNew.qml
- data/nonLocalQmlPropertyBoundToAny.qml
- data/localDerived.qml
- data/justAnimation.qml
- data/justAnimationOnAlias.qml
- data/behaviorAndAnimation.qml
- data/behaviorAndAnimationOnAlias.qml
- data/singletonUser.qml
- data/bindingsThroughIds.qml
- data/localImport_context.qml
- data/neighbors_context.qml
- data/delegate_context.qml
- data/nontrivial_context.qml
- data/javascriptCaller.qml
- data/listView.qml
- data/bindingOnValueType.qml
- data/keyEvents.qml
- data/complexAliases.qml
- data/PrivateProperty.qml
- data/privatePropertySubclass.qml
- data/calqlatrBits.qml
- data/propertyChangeAndSignalHandlers.qml
-
- # support types:
- data/DefaultPropertySingleChild.qml
- data/DefaultPropertyManyChildren.qml
- data/LocallyImported.qml
- data/LocalWithOnCompleted.qml
- data/LocallyImported_context.qml
- data/SingletonThing.qml
-)
-
-set(js_sources
- data/subfolder/code.js
+ tst_qmltc.h tst_qmltc.cpp
)
-set(common_libraries
- Qt::Core
- Qt::QmlPrivate
- Qt::QuickPrivate
- Qt::TestPrivate
- Qt::Gui # QColor, QMatrix4x4, ...
+set(qmltc_module_libs
+ qmltc_test_module
+ # We need to link against a <module>plugin here for the following:
+ # - Properly see `import QmltcTests` (that could be resolved differently
+ # but this works as well)
+ # - Properly see C++ types exposed to QML in the engine (we need C++
+ # automatic type registration that comes from the plugin)
+ qmltc_test_moduleplugin
)
-set_source_files_properties(data/NameConflict.qml PROPERTIES
- QT_QMLTC_FILE_BASENAME ResolvedNameConflict)
-
qt_internal_add_test(tst_qmltc_diskcache
- SOURCES
- ${cpp_sources}
- LIBRARIES
- ${common_libraries}
- INCLUDE_DIRECTORIES
- cpptypes/
-)
-qt6_add_qml_module(tst_qmltc_diskcache
- VERSION 1.0
- URI QmltcTests
- QML_FILES
- ${qml_sources}
- ${js_sources}
- OUTPUT_DIRECTORY diskcache/QmltcTests
+ SOURCES ${test_sources}
+ LIBRARIES ${qmltc_module_libs}
)
target_compile_definitions(tst_qmltc_diskcache PRIVATE
QMLTC_TESTS_DISABLE_CACHE=0
)
-qt_internal_target_compile_qml_to_cpp(tst_qmltc_diskcache
- NAMESPACE QmltcTest
- QML_FILES
- ${qml_sources}
-)
qt_internal_add_test(tst_qmltc_nodiskcache
- SOURCES
- ${cpp_sources}
- LIBRARIES
- ${common_libraries}
- INCLUDE_DIRECTORIES
- cpptypes/
-)
-qt6_add_qml_module(tst_qmltc_nodiskcache
- VERSION 1.0
- URI QmltcTests
- QML_FILES
- ${qml_sources}
- ${js_sources}
- OUTPUT_DIRECTORY nodiskcache/QmltcTests
+ SOURCES ${test_sources}
+ LIBRARIES ${qmltc_module_libs}
)
target_compile_definitions(tst_qmltc_nodiskcache PRIVATE
QMLTC_TESTS_DISABLE_CACHE=1
)
-qt_internal_target_compile_qml_to_cpp(tst_qmltc_nodiskcache
- # NAMESPACE QmltcTest # use QT_NAMESPACE instead
- QML_FILES
- ${qml_sources}
-)
# Add qmltc documentation example to the tests. This is not beautiful but allows
# to nicely test the documentation snippets automatically (and so making sure