diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-04-04 09:44:16 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-04-04 13:51:23 +0200 |
commit | e847c99555e057ef7646bd572130af9da9b92cb5 (patch) | |
tree | 3c0227c93f3fa509783780655364c9e652fba0e3 | |
parent | 381bbae1bb5c9a400841fe8511baf231d46a469b (diff) |
Properly declare test data in qqmlstatemachine test
Pick-to: 6.2 6.3
Fixes: QTBUG-102252
Change-Id: I84b0f3841b8677e15b287ad6dab2c038d8107043
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | tests/auto/qml/qqmlstatemachine/CMakeLists.txt | 14 | ||||
-rw-r--r-- | tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmlstatemachine/CMakeLists.txt b/tests/auto/qml/qqmlstatemachine/CMakeLists.txt index 04a975d..70f3da8 100644 --- a/tests/auto/qml/qqmlstatemachine/CMakeLists.txt +++ b/tests/auto/qml/qqmlstatemachine/CMakeLists.txt @@ -3,6 +3,12 @@ ## tst_qqmlstatemachine Test: ##################################################################### +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) + qt_internal_add_test(tst_qqmlstatemachine SOURCES ../../shared/util.cpp ../../shared/util.h @@ -16,6 +22,7 @@ qt_internal_add_test(tst_qqmlstatemachine Qt::QmlPrivate Qt::StateMachineQmlPrivate Qt::TestPrivate + TESTDATA ${test_data} ) ## Scopes: @@ -30,10 +37,3 @@ qt_internal_extend_target(tst_qqmlstatemachine CONDITION NOT ANDROID AND NOT IOS DEFINES QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" ) - -qt_internal_add_resource(tst_qqmlstatemachine "tst_qqmlstatemachine" - PREFIX - "/" - FILES - "data/signaltransition.qml" -) diff --git a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp index 938821a..2f1f7a6 100644 --- a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp +++ b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp @@ -121,7 +121,7 @@ void tst_qqmlstatemachine::tst_bindings() // Generating QQmlScriptString requires proper qml context setup, and here we // use same the element that we are testing to create the testing material QQmlEngine engine; - QQmlComponent component(&engine, QUrl(QLatin1String("qrc:///data/signaltransition.qml"))); + QQmlComponent component(&engine, testFileUrl("signaltransition.qml")); std::unique_ptr<QObject> obj(component.create()); SignalTransition *st1 = qobject_cast<SignalTransition*>(obj->findChild<QObject*>("st1")); SignalTransition *st2 = qobject_cast<SignalTransition*>(obj->findChild<QObject*>("st2")); |