aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativecomponent
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-10-12 13:46:02 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-14 02:39:59 +0200
commit6b497734df0c4f13f6b7185801fc69ce680c698c (patch)
tree66b0b8cd32a91f8c7e753a3ef124050188035c3c /tests/auto/declarative/qdeclarativecomponent
parent5f7c22001163eb4bce25be1cfee4e84c5a25ff09 (diff)
Use TESTDATA macro in declarative tests.
Includes a few other minor cleanups as well. Task-number: QTBUG-21721 Change-Id: I5b1c2c116e63748c6b4199183212de8a00037af1 Reviewed-on: http://codereview.qt-project.org/6473 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativecomponent')
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro4
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp12
2 files changed, 7 insertions, 9 deletions
diff --git a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
index 156512efee..155d615721 100644
--- a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
+++ b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -4,7 +4,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativecomponent.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+testDataFiles.files = data
+testDataFiles.path = .
+DEPLOYMENT += testDataFiles
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
index 89148812c5..78beee6f59 100644
--- a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
+++ b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
@@ -47,13 +47,9 @@
#include <QtDeclarative/qdeclarativeproperty.h>
#include <QtDeclarative/qdeclarativeincubator.h>
#include <qcolor.h>
+#include "../shared/util.h"
#include "../../../shared/util.h"
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-#define SRCDIR "."
-#endif
-
class MyIC : public QObject, public QDeclarativeIncubationController
{
Q_OBJECT
@@ -113,7 +109,7 @@ void tst_qdeclarativecomponent::loadEmptyUrl()
void tst_qdeclarativecomponent::qmlIncubateObject()
{
- QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/incubateObject.qml"));
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("incubateObject.qml")));
QObject *object = component.create();
QVERIFY(object != 0);
QCOMPARE(object->property("test1").toBool(), true);
@@ -127,7 +123,7 @@ void tst_qdeclarativecomponent::qmlIncubateObject()
void tst_qdeclarativecomponent::qmlCreateObject()
{
QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/createObject.qml"));
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("createObject.qml")));
QObject *object = component.create();
QVERIFY(object != 0);
@@ -144,7 +140,7 @@ void tst_qdeclarativecomponent::qmlCreateObject()
void tst_qdeclarativecomponent::qmlCreateObjectWithProperties()
{
QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/createObjectWithScript.qml"));
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("createObjectWithScript.qml")));
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
QObject *object = component.create();
QVERIFY(object != 0);