diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-09-27 15:07:50 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-28 02:14:48 +0200 |
commit | 3d6977d0f0371ca2211b86d6cbe67fe74647b1de (patch) | |
tree | 30183087fefae7adf078b8b5f25bed5fe93d96b7 /tests/auto/declarative/qdeclarativepixmapcache | |
parent | 40864ee84e41d53c412dd1b350624dcde07b009a (diff) |
Improved testdata deployment.
Don't embed the source path into the binary, instead find the testdata
relative to the test's binary at runtime.
Use DEPLOYMENT hints for installing testdata to a device.
Change-Id: I4005422bb76adf214166fe75d66e82fb18ded04e
Reviewed-on: http://codereview.qt-project.org/5578
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativepixmapcache')
-rw-r--r-- | tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro | 10 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp | 11 |
2 files changed, 6 insertions, 15 deletions
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro index aaf94ea291..e5dfbe505d 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro +++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro @@ -9,13 +9,9 @@ INCLUDEPATH += ../shared/ HEADERS += ../shared/testhttpserver.h SOURCES += ../shared/testhttpserver.cpp -symbian: { - importFiles.files = data - importFiles.path = . - DEPLOYMENT += importFiles -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" -} +importFiles.files = data +importFiles.path = . +DEPLOYMENT += importFiles # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage # LIBS += -lgcov diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp index e810e1e8a8..e0f7a66566 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp +++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp @@ -55,20 +55,15 @@ // These don't let normal people run tests! //#include "../network-settings.h" -#ifdef Q_OS_SYMBIAN -// In Symbian OS test data is located in applications private dir -#define SRCDIR "." -#endif - class tst_qdeclarativepixmapcache : public QObject { Q_OBJECT public: tst_qdeclarativepixmapcache() : - thisfile(QUrl::fromLocalFile(__FILE__)), + thisfile(QUrl::fromLocalFile(QCoreApplication::applicationFilePath())), server(14452) { - server.serveDirectory(SRCDIR "/data/http"); + server.serveDirectory(QCoreApplication::applicationDirPath() + "/data/http"); } private slots: @@ -368,7 +363,7 @@ void createNetworkServer() { QEventLoop eventLoop; TestHTTPServer server(14453); - server.serveDirectory(SRCDIR "/data/http"); + server.serveDirectory(QCoreApplication::applicationDirPath() + "/data/http"); QTimer::singleShot(100, &eventLoop, SLOT(quit())); eventLoop.exec(); } |