summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@theqtcompany.com>2015-02-05 09:06:25 +0100
committerRainer Keller <rainer.keller@theqtcompany.com>2015-02-05 08:25:14 +0000
commit5d935008641cfd625678468bdcf84cbd69c37bee (patch)
treed75197793f62079d725c2d40edb5dc2015ded751 /tests
parent1e3b91b5d95f43d88a6f188f52b7b46197854a07 (diff)
Autotest: Use resources for test data
Change-Id: I011b6be94b56baf58f3ee47d0b805932bb94a7f8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/data/data.qrc6
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro2
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp4
3 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativecomponent/data/data.qrc b/tests/auto/declarative/qdeclarativecomponent/data/data.qrc
new file mode 100644
index 00000000..f0405f9b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativecomponent/data/data.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>createObject.qml</file>
+ <file>createObjectWithScript.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
index da7352e5..270eef36 100644
--- a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
+++ b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativecomponent.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+RESOURCES += data/data.qrc
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
index e1cd68d5..27e9634e 100644
--- a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
+++ b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
@@ -87,7 +87,7 @@ void tst_qdeclarativecomponent::loadEmptyUrl()
void tst_qdeclarativecomponent::qmlCreateObject()
{
QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/createObject.qml"));
+ QDeclarativeComponent component(&engine, QUrl("qrc:/createObject.qml"));
QObject *object = component.create();
QVERIFY(object != 0);
@@ -112,7 +112,7 @@ void tst_qdeclarativecomponent::qmlCreateObject()
void tst_qdeclarativecomponent::qmlCreateObjectWithProperties()
{
QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/createObjectWithScript.qml"));
+ QDeclarativeComponent component(&engine, QUrl("qrc:/createObjectWithScript.qml"));
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
QObject *object = component.create();
QVERIFY(object != 0);