From 3d6977d0f0371ca2211b86d6cbe67fe74647b1de Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 27 Sep 2011 15:07:50 +1000 Subject: 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 Reviewed-by: Michael Brasser --- .../qdeclarativepixmapcache/qdeclarativepixmapcache.pro | 10 +++------- .../qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp | 11 +++-------- 2 files changed, 6 insertions(+), 15 deletions(-) (limited to 'tests/auto/declarative/qdeclarativepixmapcache') 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(); } -- cgit v1.2.3