diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-11-23 12:25:17 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-02-27 15:44:46 +0000 |
commit | 44af54419eaceb27bb729717d6363917fd6bb819 (patch) | |
tree | b111875dd8cb8ff653cb0e27cfa766933ca6d589 /tests/baselineserver | |
parent | 85b30fda7ceccecfd3938703979b3431bdedc9a2 (diff) |
Properly use the "process" feature
Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in
qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess
headers, exclude the sources from compilation when switched off, guard
header inclusions in places where compilation without QProcess seems
supported, drop some unused includes, and fix some tests that were
apparently designed to work with QT_NO_PROCESS but failed to.
Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'tests/baselineserver')
-rw-r--r-- | tests/baselineserver/shared/baselineprotocol.cpp | 10 | ||||
-rw-r--r-- | tests/baselineserver/shared/qbaselinetest.cpp | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp index 3335ff8ffc..35ef255255 100644 --- a/tests/baselineserver/shared/baselineprotocol.cpp +++ b/tests/baselineserver/shared/baselineprotocol.cpp @@ -31,7 +31,9 @@ #include <QBuffer> #include <QHostInfo> #include <QSysInfo> -#include <QProcess> +#if QT_CONFIG(process) +# include <QProcess> +#endif #include <QFileInfo> #include <QDir> #include <QTime> @@ -88,7 +90,7 @@ PlatformInfo PlatformInfo::localHostInfo() #if QT_VERSION >= 0x050000 pi.insert(PI_QtBuildMode, QLibraryInfo::isDebugBuild() ? QLS("QtDebug") : QLS("QtRelease")); #endif -#if defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) && QT_CONFIG(process) pi.insert(PI_OSName, QLS("Linux")); QProcess uname; uname.start(QLS("uname"), QStringList() << QLS("-r")); @@ -104,7 +106,7 @@ PlatformInfo PlatformInfo::localHostInfo() pi.insert(PI_OSName, QLS("Other")); #endif -#ifndef QT_NO_PROCESS +#if QT_CONFIG(process) QProcess git; QString cmd; QStringList args; @@ -140,7 +142,7 @@ PlatformInfo PlatformInfo::localHostInfo() pi.insert(PI_PulseGitBranch, QString::fromLatin1(gb)); } } -#endif // !QT_NO_PROCESS +#endif // QT_CONFIG(process) return pi; } diff --git a/tests/baselineserver/shared/qbaselinetest.cpp b/tests/baselineserver/shared/qbaselinetest.cpp index 7e913c1233..ef38e21edb 100644 --- a/tests/baselineserver/shared/qbaselinetest.cpp +++ b/tests/baselineserver/shared/qbaselinetest.cpp @@ -28,7 +28,9 @@ #include "qbaselinetest.h" #include "baselineprotocol.h" -#include <QtCore/QProcess> +#if QT_CONFIG(process) +# include <QtCore/QProcess> +#endif #include <QtCore/QDir> #define MAXCMDLINEARGS 128 @@ -126,7 +128,7 @@ void addClientProperty(const QString& key, const QString& value) */ void fetchCustomClientProperties() { -#ifdef QT_NO_PROCESS +#if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); #else QString script = "hostinfo.sh"; //### TBD: Windows implementation (hostinfo.bat) @@ -151,7 +153,7 @@ void fetchCustomClientProperties() else qDebug() << "Unparseable script output ignored:" << line; } -#endif // !QT_NO_PROCESS +#endif // QT_CONFIG(process) } |