diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-05-08 11:01:22 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-05-12 08:37:49 +0000 |
commit | 221522770b7a280d189743a00bcd2e9466bd6a68 (patch) | |
tree | ca53a4c246e6d017cee5f0619c8f6ff516f17f3c | |
parent | f3c87d21271aa44dd9983093ebc5904f666c4fd7 (diff) |
Fix qml file loading for tst_affectors
Change-Id: Ifb1b6f6d71d42c1642167725526c054f1dce0c90
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
(cherry picked from commit 9064d077e411aab9a2aea9f9e5a14ae029a94e14)
-rw-r--r-- | tests/benchmarks/particles/affectors/affectors.pro | 5 | ||||
-rw-r--r-- | tests/benchmarks/particles/affectors/tst_affectors.cpp | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/benchmarks/particles/affectors/affectors.pro b/tests/benchmarks/particles/affectors/affectors.pro index eb6190a649..d35ce14fe8 100644 --- a/tests/benchmarks/particles/affectors/affectors.pro +++ b/tests/benchmarks/particles/affectors/affectors.pro @@ -1,11 +1,10 @@ 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 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/benchmarks/particles/affectors/tst_affectors.cpp b/tests/benchmarks/particles/affectors/tst_affectors.cpp index a838c36fa4..c68d284187 100644 --- a/tests/benchmarks/particles/affectors/tst_affectors.cpp +++ b/tests/benchmarks/particles/affectors/tst_affectors.cpp @@ -53,6 +53,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<int> ("dt"); @@ -74,7 +79,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<QQuickParticleSystem*>("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; @@ -114,7 +119,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<QQuickParticleSystem*>("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; |