From 6540fc6ac57f8347805a7a92e9d351268d5a2135 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 19 Sep 2018 12:28:34 +0200 Subject: qmlplugindump: Make manual test work with shadow builds Change-Id: Ifaf87ba32f0c864ea264e78fba1ffc3d12c88a13 Reviewed-by: Ulf Hermann --- tests/manual/qmlplugindump/qmlplugindump.pro | 2 ++ tests/manual/qmlplugindump/tst_qmlplugindump.cpp | 11 +++++------ 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)); -- cgit v1.2.3