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 --- .../particles/qquickcustomparticle/qquickcustomparticle.pro | 5 ++--- .../qquickcustomparticle/tst_qquickcustomparticle.cpp | 12 ++++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'tests/auto/particles/qquickcustomparticle') diff --git a/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro b/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro index a12c1af62c..6666c91d7e 100644 --- a/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro +++ b/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro @@ -3,9 +3,8 @@ TARGET = tst_qquickcustomparticle SOURCES += tst_qquickcustomparticle.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/qquickcustomparticle/tst_qquickcustomparticle.cpp b/tests/auto/particles/qquickcustomparticle/tst_qquickcustomparticle.cpp index 237fc301d9..a54e10afc6 100644 --- a/tests/auto/particles/qquickcustomparticle/tst_qquickcustomparticle.cpp +++ b/tests/auto/particles/qquickcustomparticle/tst_qquickcustomparticle.cpp @@ -44,24 +44,28 @@ #include #include -class tst_qquickcustomparticle : public QObject +#include "../../shared/util.h" + +class tst_qquickcustomparticle : public QQmlDataTest { Q_OBJECT public: - tst_qquickcustomparticle(); + tst_qquickcustomparticle() {} private slots: + void initTestCase(); void test_basic(); }; -tst_qquickcustomparticle::tst_qquickcustomparticle() +void tst_qquickcustomparticle::initTestCase() { + QQmlDataTest::initTestCase(); QUnifiedTimer::instance()->setConsistentTiming(true); } void tst_qquickcustomparticle::test_basic() { - QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(testFileUrl("basic.qml"), 600); QVERIFY(view); QQuickParticleSystem* system = view->rootObject()->findChild("system"); ensureAnimTime(600, system->m_animation); -- cgit v1.2.3