From e847c99555e057ef7646bd572130af9da9b92cb5 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 4 Apr 2022 09:44:16 +0200 Subject: Properly declare test data in qqmlstatemachine test Pick-to: 6.2 6.3 Fixes: QTBUG-102252 Change-Id: I84b0f3841b8677e15b287ad6dab2c038d8107043 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmlstatemachine/CMakeLists.txt | 14 +++++++------- tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/auto') 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 obj(component.create()); SignalTransition *st1 = qobject_cast(obj->findChild("st1")); SignalTransition *st2 = qobject_cast(obj->findChild("st2")); -- cgit v1.2.3