summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-01-12 15:38:49 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-01-12 15:47:07 (GMT)
commit405aafcfe2d9d591d62c72f00bbc095c2ad52309 (patch)
tree7d8a4b5b021a3dc46916d4684ef214c67e172bf0
parenteaf2e2187d9fec2102e3301098f85efe93518761 (diff)
downloadQt-405aafcfe2d9d591d62c72f00bbc095c2ad52309.zip
Qt-405aafcfe2d9d591d62c72f00bbc095c2ad52309.tar.gz
Qt-405aafcfe2d9d591d62c72f00bbc095c2ad52309.tar.bz2
Use runtime path instead of compile time on Maemo
Since maemo programs are cross-compiled, we need to use the runtime application path to locate script files here. Reviewed-by: aavit
-rw-r--r--tests/auto/lancelot/lancelot.pro1
-rw-r--r--tests/auto/lancelot/tst_lancelot.cpp8
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/lancelot/lancelot.pro b/tests/auto/lancelot/lancelot.pro
index 6d6edf8..93841a3 100644
--- a/tests/auto/lancelot/lancelot.pro
+++ b/tests/auto/lancelot/lancelot.pro
@@ -10,3 +10,4 @@ RESOURCES += $$QT_SOURCE_TREE/tests/arthur/common/images.qrc
include($$QT_SOURCE_TREE/tests/arthur/common/qbaselinetest.pri)
!symbian:!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+linux-g++-maemo:DEFINES += USE_RUNTIME_DIR
diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp
index 4bde927..0e8757b 100644
--- a/tests/auto/lancelot/tst_lancelot.cpp
+++ b/tests/auto/lancelot/tst_lancelot.cpp
@@ -54,8 +54,6 @@
#define SRCDIR "."
#endif
-static const QLatin1String scriptsDir(SRCDIR "/scripts/");
-
class tst_Lancelot : public QObject
{
Q_OBJECT
@@ -80,6 +78,7 @@ private:
ImageItemList baseList;
QHash<QString, QStringList> scripts;
bool dryRunMode;
+ QString scriptsDir;
private slots:
void initTestCase();
@@ -116,6 +115,11 @@ void tst_Lancelot::initTestCase()
if (!proto.connect(QLatin1String("tst_Lancelot"), &dryRunMode))
QSKIP(qPrintable(proto.errorMessage()), SkipAll);
+#if defined(USE_RUNTIME_DIR)
+ scriptsDir = QCoreApplication::applicationDirPath() + "/scripts/";
+#else
+ scriptsDir = SRCDIR "/scripts/";
+#endif
QDir qpsDir(scriptsDir);
QStringList files = qpsDir.entryList(QStringList() << QLatin1String("*.qps"), QDir::Files | QDir::Readable);
if (files.isEmpty()) {