From 83b4f5cc4f2661a41bbed4e17606a5e40bd06b7c Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Wed, 7 Mar 2012 08:02:44 +1000 Subject: Changed particles tests to work from install directory - Changed particles tests to use TESTDATA - Changed particles tests to inherit from QQmlDataTest and use testFileUrl() to find test data Change-Id: Iae7c5111d976ec3efe473c40a3bab2f0a38c0969 Reviewed-by: Michael Brasser Reviewed-by: Jason McDonald --- .../qquickcustomaffector/qquickcustomaffector.pro | 5 ++--- .../qquickcustomaffector/tst_qquickcustomaffector.cpp | 14 +++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'tests/auto/particles/qquickcustomaffector') diff --git a/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro b/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro index fdc2445bd1..b1533d6be1 100644 --- a/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro +++ b/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro @@ -3,9 +3,8 @@ TARGET = tst_qquickcustomaffector SOURCES += tst_qquickcustomaffector.cpp macx:CONFIG -= app_bundle -testDataFiles.files = data -testDataFiles.path = . -DEPLOYMENT += testDataFiles +include (../../shared/util.pri) +TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib diff --git a/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp b/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp index c854ebe0ae..b63cde14f3 100644 --- a/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp +++ b/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp @@ -44,25 +44,29 @@ #include #include -class tst_qquickcustomaffector : public QObject +#include "../../shared/util.h" + +class tst_qquickcustomaffector : public QQmlDataTest { Q_OBJECT public: - tst_qquickcustomaffector(); + tst_qquickcustomaffector() {} private slots: + void initTestCase(); void test_basic(); void test_move(); }; -tst_qquickcustomaffector::tst_qquickcustomaffector() +void tst_qquickcustomaffector::initTestCase() { + QQmlDataTest::initTestCase(); QUnifiedTimer::instance()->setConsistentTiming(true); } void tst_qquickcustomaffector::test_basic() { - QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(testFileUrl("basic.qml"), 600); QQuickParticleSystem* system = view->rootObject()->findChild("system"); ensureAnimTime(600, system->m_animation); @@ -95,7 +99,7 @@ void tst_qquickcustomaffector::test_basic() void tst_qquickcustomaffector::test_move() { - QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/move.qml", 600); + QQuickView* view = createView(testFileUrl("move.qml"), 600); QQuickParticleSystem* system = view->rootObject()->findChild("system"); ensureAnimTime(600, system->m_animation); -- cgit v1.2.3