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/auto/widgets | |
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/auto/widgets')
3 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index d6f3728663..13994e3b02 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -35,7 +35,9 @@ #include <QtCore/QAbstractEventDispatcher> #include <QtCore/QFileInfo> #include <QtCore/QDir> -#include <QtCore/QProcess> +#if QT_CONFIG(process) +# include <QtCore/QProcess> +#endif #include <QtCore/private/qeventloop_p.h> #include <QtGui/QFontDatabase> @@ -1432,7 +1434,7 @@ void tst_QApplication::testDeleteLaterProcessEvents() */ void tst_QApplication::desktopSettingsAware() { -#ifndef QT_NO_PROCESS +#if QT_CONFIG(process) QString path; { // We need an application object for QFINDTESTDATA to work @@ -2121,7 +2123,7 @@ void tst_QApplication::qtbug_12673() QVERIFY2(!path.isEmpty(), "Cannot locate modal helper application"); path += "modal"; -#ifndef QT_NO_PROCESS +#if QT_CONFIG(process) QProcess testProcess; QStringList arguments; testProcess.start(path, arguments); @@ -2254,7 +2256,7 @@ void tst_QApplication::settableStyleHints() executed *after* the destruction of QApplication. */ Q_GLOBAL_STATIC(QLocale, tst_qapp_locale); -#ifndef QT_NO_PROCESS +#if QT_CONFIG(process) Q_GLOBAL_STATIC(QProcess, tst_qapp_process); #endif #ifndef QT_NO_FILESYSTEMWATCHER @@ -2279,7 +2281,7 @@ void tst_QApplication::globalStaticObjectDestruction() int argc = 1; QApplication app(argc, &argv0); QVERIFY(tst_qapp_locale()); -#ifndef QT_NO_PROCESS +#if QT_CONFIG(process) QVERIFY(tst_qapp_process()); #endif #ifndef QT_NO_FILESYSTEMWATCHER diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp index f5cf9d7750..2c3eb66384 100644 --- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp +++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp @@ -606,7 +606,7 @@ void tst_QUndoGroup::addStackAndDie() void tst_QUndoGroup::commandTextFormat() { -#ifdef QT_NO_PROCESS +#if !QT_CONFIG(process) QSKIP("No QProcess available"); #else QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath); diff --git a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp index a3e7219892..ba3d80bbe4 100644 --- a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp +++ b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp @@ -3088,7 +3088,7 @@ void tst_QUndoStack::undoLimit() void tst_QUndoStack::commandTextFormat() { -#ifdef QT_NO_PROCESS +#if !QT_CONFIG(process) QSKIP("No QProcess available"); #else QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath); |