From 9064d077e411aab9a2aea9f9e5a14ae029a94e14 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 8 May 2017 11:01:22 +0200 Subject: Fix qml file loading for tst_affectors Change-Id: Ifb1b6f6d71d42c1642167725526c054f1dce0c90 Reviewed-by: Robin Burchell --- tests/benchmarks/particles/affectors/affectors.pro | 5 ++--- tests/benchmarks/particles/affectors/tst_affectors.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'tests/benchmarks/particles') diff --git a/tests/benchmarks/particles/affectors/affectors.pro b/tests/benchmarks/particles/affectors/affectors.pro index 3351228a4b..2eae07fcc5 100644 --- a/tests/benchmarks/particles/affectors/affectors.pro +++ b/tests/benchmarks/particles/affectors/affectors.pro @@ -1,10 +1,9 @@ CONFIG += benchmark +TEMPLATE = app TARGET = tst_affectors SOURCES += tst_affectors.cpp macx:CONFIG -= app_bundle -testDataFiles.files = data -testDataFiles.path = . -DEPLOYMENT += testDataFiles +DEFINES += SRCDIR=\\\"$$PWD\\\" QT += quickparticles-private testlib diff --git a/tests/benchmarks/particles/affectors/tst_affectors.cpp b/tests/benchmarks/particles/affectors/tst_affectors.cpp index 99d175564b..4c611c6faa 100644 --- a/tests/benchmarks/particles/affectors/tst_affectors.cpp +++ b/tests/benchmarks/particles/affectors/tst_affectors.cpp @@ -48,6 +48,11 @@ tst_affectors::tst_affectors() { } +inline QUrl TEST_FILE(const QString &filename) +{ + return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); +} + void tst_affectors::test_basic_data() { QTest::addColumn ("dt"); @@ -69,7 +74,7 @@ void tst_affectors::test_filtered_data() void tst_affectors::test_basic() { QFETCH(int, dt); - QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml"); + QQuickView* view = createView(TEST_FILE("basic.qml")); QQuickParticleSystem* system = view->rootObject()->findChild("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; @@ -109,7 +114,7 @@ void tst_affectors::test_basic() void tst_affectors::test_filtered() { QFETCH(int, dt); - QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/filtered.qml"); + QQuickView* view = createView(TEST_FILE("filtered.qml")); QQuickParticleSystem* system = view->rootObject()->findChild("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; -- cgit v1.2.3