aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2018-09-19 12:28:34 +0200
committerKai Koehne <kai.koehne@qt.io>2018-09-24 06:36:48 +0000
commit6540fc6ac57f8347805a7a92e9d351268d5a2135 (patch)
treeec3874756ff304a92d2cc90d135c99d0bdccf92e /tests
parent7bf8d4d3772959f06d4dd0168af7774adde29d76 (diff)
qmlplugindump: Make manual test work with shadow builds
Change-Id: Ifaf87ba32f0c864ea264e78fba1ffc3d12c88a13 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/qmlplugindump/qmlplugindump.pro2
-rw-r--r--tests/manual/qmlplugindump/tst_qmlplugindump.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/manual/qmlplugindump/qmlplugindump.pro b/tests/manual/qmlplugindump/qmlplugindump.pro
index b072cdc0cf..51a5e82781 100644
--- a/tests/manual/qmlplugindump/qmlplugindump.pro
+++ b/tests/manual/qmlplugindump/qmlplugindump.pro
@@ -4,5 +4,7 @@ QT += testlib gui-private
osx:CONFIG -= app_bundle
CONFIG += parallel_test
+DEFINES += QT_TEST_DIR=\\\"$${_PRO_FILE_PWD_}/\\\"
+
SOURCES += tst_qmlplugindump.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qmlplugindump/tst_qmlplugindump.cpp b/tests/manual/qmlplugindump/tst_qmlplugindump.cpp
index 1bedd4427b..c5047a63a7 100644
--- a/tests/manual/qmlplugindump/tst_qmlplugindump.cpp
+++ b/tests/manual/qmlplugindump/tst_qmlplugindump.cpp
@@ -273,7 +273,7 @@ tst_qmlplugindump::tst_qmlplugindump()
QString tst_qmlplugindump::samplePath(const QString &name)
{
- return QCoreApplication::applicationDirPath()
+ return QT_TEST_DIR
+ QLatin1Char('/')
+ QString(QLatin1String(prefix)).replace(QRegularExpression(QLatin1String("\\.")),
QLatin1String("/")).append(name);
@@ -282,7 +282,7 @@ QString tst_qmlplugindump::samplePath(const QString &name)
bool tst_qmlplugindump::compileSample(const QString &name)
{
const QString path = samplePath(name);
- return run(path, QLatin1String("qmake"))
+ return run(path, QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake"))
&& run(path, QLatin1String(systemMakeProgram));
}
@@ -305,8 +305,7 @@ bool tst_qmlplugindump::cleanUpSample(const QString &name)
void tst_qmlplugindump::initTestCase()
{
dumper = QLibraryInfo::location(QLibraryInfo::BinariesPath);
- tests = readAllTestDefinitions(QCoreApplication::applicationDirPath()
- + QLatin1String("/definitions"));
+ tests = readAllTestDefinitions(QT_TEST_DIR "/definitions");
dumper += QLatin1Char('/') + QLatin1String(systemQmlplugindumpProgram);
@@ -322,7 +321,7 @@ void tst_qmlplugindump::builtins()
QStringList args;
args += QLatin1String("-builtins");
RegexpsChecker check(QStringList(QLatin1String("Module {")));
- QString cwd = QCoreApplication::applicationDirPath();
+ QString cwd = QT_TEST_DIR;
QVERIFY(run(cwd, dumper, args, &check));
}
@@ -349,7 +348,7 @@ void tst_qmlplugindump::plugin()
QStringList args;
QString url = QLatin1String("tests.dumper.") + project;
- QString cwd = QCoreApplication::applicationDirPath();
+ QString cwd = QT_TEST_DIR;
args << QLatin1String("-nonrelocatable") << url << version << cwd;
RegexpsChecker check(expected);
QVERIFY(run(cwd, dumper, args, &check));