diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-03-02 13:25:04 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-12 14:23:15 +0000 |
commit | 4cb8667d20ff9f4af1451c54560ea864630f49b9 (patch) | |
tree | 800c187243f86e5e655c261ff895f519ffe43bb2 /tests | |
parent | 1ace238ce0347857a5ba55d6fa30ba81fed204b9 (diff) |
Fix problems when building with -no-feature-process
Guard the QProcess includes, modernize some ifdefs, exclude tests and
examples that don't work without processes, and use QT_CONFIG(process)
rather than QT_BOOTSTRAPPED as discriminator where we are actually
checking for QProcess support. Also, don't try to build linguist and
designer without QProcess.
Change-Id: I4e1c7485a96ff02f2f6241113add35e44dc54b1d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 3 | ||||
-rw-r--r-- | tests/auto/qtdiag/tst_qtdiag.cpp | 8 | ||||
-rw-r--r-- | tests/auto/windeployqt/tst_windeployqt.cpp | 15 |
3 files changed, 2 insertions, 24 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 53466702f..15a7cf569 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -25,5 +25,6 @@ cross_compile:SUBDIRS -= linguist qhelpindexmodel \ qhelpprojectdata \ -android|ios|qnx|winrt: SUBDIRS -= qtdiag +!qtConfig(process): SUBDIRS -= qtattributionsscanner linguist qtdiag windeployqt +android|qnx: SUBDIRS -= qtdiag !win32|winrt: SUBDIRS -= windeployqt diff --git a/tests/auto/qtdiag/tst_qtdiag.cpp b/tests/auto/qtdiag/tst_qtdiag.cpp index 96c33abab..207c450c2 100644 --- a/tests/auto/qtdiag/tst_qtdiag.cpp +++ b/tests/auto/qtdiag/tst_qtdiag.cpp @@ -46,9 +46,6 @@ private: void tst_QtDiag::initTestCase() { -#ifdef QT_NO_PROCESS - QSKIP("This test requires QProcess support"); -#else QString binary = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QStringLiteral("/qtdiag"); # ifdef Q_OS_WIN binary += QStringLiteral(".exe"); @@ -62,14 +59,10 @@ void tst_QtDiag::initTestCase() + QByteArrayLiteral("' does not exist."); QSKIP(message.constData()); } -#endif // !QT_NO_PROCESS } void tst_QtDiag::run() { -#ifdef QT_NO_PROCESS - QSKIP("This test requires QProcess support"); -#else if (m_binary.isEmpty()) QSKIP("Binary could not be found"); QProcess process; @@ -83,7 +76,6 @@ void tst_QtDiag::run() QVERIFY(!output.isEmpty()); output.replace('\r', ""); qDebug("\n%s", output.constData()); -#endif // !QT_NO_PROCESS } QTEST_MAIN(tst_QtDiag) diff --git a/tests/auto/windeployqt/tst_windeployqt.cpp b/tests/auto/windeployqt/tst_windeployqt.cpp index 30da829e7..f20e59180 100644 --- a/tests/auto/windeployqt/tst_windeployqt.cpp +++ b/tests/auto/windeployqt/tst_windeployqt.cpp @@ -37,7 +37,6 @@ #include <QtCore/QTextStream> #include <QtTest/QtTest> -#ifndef QT_NO_PROCESS static const QString msgProcessError(const QProcess &process, const QString &what, const QByteArray &stdOut = QByteArray(), const QByteArray &stdErr = QByteArray()) @@ -98,8 +97,6 @@ static bool runProcess(const QString &binary, return true; } -#endif // !QT_NO_PROCESS - class tst_windeployqt : public QObject { Q_OBJECT @@ -116,9 +113,6 @@ private: void tst_windeployqt::initTestCase() { -#ifdef QT_NO_PROCESS - QSKIP("This test requires QProcess support"); -#else m_windeployqtBinary = QStandardPaths::findExecutable("windeployqt"); QVERIFY(!m_windeployqtBinary.isEmpty()); m_testApp = QFINDTESTDATA("testapp"); @@ -126,14 +120,10 @@ void tst_windeployqt::initTestCase() const QFileInfo testAppBinary(m_testApp + QLatin1String("/testapp.exe")); QVERIFY2(testAppBinary.isFile(), qPrintable(testAppBinary.absoluteFilePath())); m_testAppBinary = testAppBinary.absoluteFilePath(); -#endif // QT_NO_PROCESS } void tst_windeployqt::help() { -#ifdef QT_NO_PROCESS - QSKIP("This test requires QProcess support"); -#else QString errorMessage; QByteArray stdOut; QByteArray stdErr; @@ -141,7 +131,6 @@ void tst_windeployqt::help() QString(), QProcessEnvironment(), 5000, &stdOut, &stdErr), qPrintable(errorMessage)); QVERIFY2(!stdOut.isEmpty(), stdErr); -#endif // QT_NO_PROCESS } // deploy(): Deploys the test application and launches it with Qt removed from the environment @@ -149,9 +138,6 @@ void tst_windeployqt::help() void tst_windeployqt::deploy() { -#ifdef QT_NO_PROCESS - QSKIP("This test requires QProcess support"); -#else QString errorMessage; // Deploy application QStringList deployArguments; @@ -189,7 +175,6 @@ void tst_windeployqt::deploy() // Verify that application still runs QVERIFY2(runProcess(m_testAppBinary, QStringList(), &errorMessage, QString(), env, 10000), qPrintable(errorMessage)); -#endif // QT_NO_PROCESS } QTEST_MAIN(tst_windeployqt) |