From 7c64ab4966e24834768eb1a09b3d2fd08471787a Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 11 Oct 2011 14:15:52 +1000 Subject: [PATCH] Exclude qtconcurrent tests via .pro files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If Qt is built without QtConcurrent, the relevant autotests should be excluded from the build, rather than building empty tests that appear to pass and thus produce confusing test results. Change-Id: I43bafcb0ffa42e8981bec4e27bf6a23a28d86df9 Reviewed-on: http://codereview.qt-project.org/6395 Reviewed-by: Morten Johan Sørvig Reviewed-by: Rohan McGovern --- configure | 2 + .../concurrent/qfuture/tst_qfuture.cpp | 10 +--- .../corelib/concurrent/qfuture/versioncheck.h | 49 ------------------- .../qfuturewatcher/tst_qfuturewatcher.cpp | 10 +--- .../tst_qtconcurrentfilter.cpp | 14 ++---- .../qtconcurrentiteratekernel.pro | 1 - .../tst_qtconcurrentiteratekernel.cpp | 8 --- .../qtconcurrentmap/qtconcurrentmap.pro | 1 - .../qtconcurrentmap/tst_qtconcurrentmap.cpp | 22 +-------- .../qtconcurrentrun/qtconcurrentrun.pro | 1 - .../qtconcurrentrun/tst_qtconcurrentrun.cpp | 11 +---- .../qtconcurrentthreadengine.pro | 1 - .../tst_qtconcurrentthreadengine.cpp | 7 --- tests/auto/corelib/corelib.pro | 2 + 14 files changed, 12 insertions(+), 127 deletions(-) delete mode 100644 tests/auto/corelib/concurrent/qfuture/versioncheck.h diff --git a/configure b/configure index 5e6b289aaf..c11ab76f2c 100755 --- a/configure +++ b/configure @@ -7543,6 +7543,8 @@ CFG_CONCURRENT="yes" if [ "$canBuildQtConcurrent" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT" CFG_CONCURRENT="no" +else + QT_CONFIG="$QT_CONFIG concurrent" fi if [ "$CFG_XMLPATTERNS" = "yes" -a "$CFG_EXCEPTIONS" = "no" ]; then diff --git a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp b/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp index d81df0d863..495884c806 100644 --- a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp +++ b/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp @@ -45,12 +45,9 @@ #include #include -#include "versioncheck.h" #include #include #include - -#ifndef QT_NO_CONCURRENT_TEST #include using namespace QtConcurrent; @@ -90,8 +87,6 @@ private slots: #endif }; -QTEST_MAIN(tst_QFuture) - void tst_QFuture::resultStore() { int int0 = 0; @@ -1467,8 +1462,5 @@ void tst_QFuture::exceptions_QTBUG18149() #endif // QT_NO_EXCEPTIONS +QTEST_MAIN(tst_QFuture) #include "tst_qfuture.moc" - -#else -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/corelib/concurrent/qfuture/versioncheck.h b/tests/auto/corelib/concurrent/qfuture/versioncheck.h deleted file mode 100644 index 9e4d0c6eeb..0000000000 --- a/tests/auto/corelib/concurrent/qfuture/versioncheck.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include - -#ifdef QT_NO_CONCURRENT -#define QT_NO_CONCURRENT_TEST -#endif - -#if defined(Q_CC_MSVC) && _MSC_VER < 1400 -#define QT_NO_CONCURRENT_TEST -#endif diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp index d8fa2230f3..615a4c507f 100644 --- a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp +++ b/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp @@ -43,13 +43,10 @@ #include #include -#include "../qfuture/versioncheck.h" #include #include #include #include "../../../../shared/util.h" - -#ifndef QT_NO_CONCURRENT_TEST #include using namespace QtConcurrent; @@ -85,8 +82,6 @@ private slots: void warnRace(); }; -QTEST_MAIN(tst_QFutureWatcher) - void sleeper() { QTest::qSleep(100); @@ -923,8 +918,5 @@ void tst_QFutureWatcher::warnRace() future.waitForFinished(); } +QTEST_MAIN(tst_QFutureWatcher) #include "tst_qfuturewatcher.moc" - -#else -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp index b292b3857d..0aa3be938f 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp +++ b/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp @@ -45,7 +45,8 @@ #include #include "../qtconcurrentmap/functions.h" -#include "../qfuture/versioncheck.h" + +#if !defined(QT_NO_CONCURRENT_FILTER) class tst_QtConcurrentFilter : public QObject { @@ -63,8 +64,6 @@ private slots: #endif }; -#if !defined (QT_NO_CONCURRENT_TEST) && !defined(QT_NO_CONCURRENT_FILTER) - void tst_QtConcurrentFilter::filter() { // functor @@ -1536,15 +1535,8 @@ QTEST_MAIN(tst_QtConcurrentFilter) #else -void tst_QtConcurrentFilter::filter() {} -void tst_QtConcurrentFilter::filtered() {} -void tst_QtConcurrentFilter::filteredReduced() {} -void tst_QtConcurrentFilter::resultAt() {} -void tst_QtConcurrentFilter::incrementalResults() {} -void tst_QtConcurrentFilter::stlContainers() {} -void tst_QtConcurrentFilter::noDetatch() {} - QTEST_NOOP_MAIN + #endif #include "tst_qtconcurrentfilter.moc" diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro index a61d275241..c8cfe4c115 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro +++ b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro @@ -2,4 +2,3 @@ load(qttest_p4) SOURCES += tst_qtconcurrentiteratekernel.cpp QT = core CONFIG += parallel_test -CONFIG += parallel_test diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp index 2cf6fe9a2d..65c3f53a52 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp +++ b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ #include -#include "../qfuture/versioncheck.h" struct TestIterator { @@ -82,12 +81,9 @@ int distance(TestIterator &a, TestIterator &b) } #endif - #include #include -#ifndef QT_NO_CONCURRENT_TEST - using namespace QtConcurrent; class tst_QtConcurrentIterateKernel: public QObject @@ -355,7 +351,3 @@ void tst_QtConcurrentIterateKernel::stresstestWhile() QTEST_MAIN(tst_QtConcurrentIterateKernel) #include "tst_qtconcurrentiteratekernel.moc" - -#else -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro b/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro index 6fc358514e..4edfc64cb3 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro +++ b/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro @@ -3,4 +3,3 @@ DEFINES += QT_STRICT_ITERATORS SOURCES += tst_qtconcurrentmap.cpp QT = core CONFIG += parallel_test -CONFIG += parallel_test diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp index 4a8a18ba6d..330e6b908e 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp +++ b/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp @@ -47,7 +47,8 @@ #include #include "functions.h" -#include "../qfuture/versioncheck.h" + +#if !defined(QT_NO_CONCURRENT_MAP) Q_DECLARE_METATYPE(QVector); Q_DECLARE_METATYPE(QVector); @@ -82,8 +83,6 @@ public slots: void throttling(); }; -#if !defined (QT_NO_CONCURRENT_TEST) && !defined(QT_NO_CONCURRENT_MAP) - using namespace QtConcurrent; void multiplyBy2Immutable(int x) @@ -2420,23 +2419,6 @@ QTEST_MAIN(tst_QtConcurrentMap) #else -void tst_QtConcurrentMap::map() {} -void tst_QtConcurrentMap::blocking_map() {} -void tst_QtConcurrentMap::mapped() {} -void tst_QtConcurrentMap::blocking_mapped() {} -void tst_QtConcurrentMap::mappedReduced() {} -void tst_QtConcurrentMap::blocking_mappedReduced() {} -void tst_QtConcurrentMap::assignResult() {} -void tst_QtConcurrentMap::functionOverloads() {} -#ifndef QT_NO_EXCEPTIONS -void tst_QtConcurrentMap::exceptions() {} -#endif -void tst_QtConcurrentMap::incrementalResults() {} -void tst_QtConcurrentMap::stressTest() {} -void tst_QtConcurrentMap::throttling() {} -void tst_QtConcurrentMap::stlContainers() {} -void tst_QtConcurrentMap::noDetatch() {} - QTEST_NOOP_MAIN #endif diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro b/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro index 24576048e9..dfccf06de9 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro +++ b/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro @@ -2,4 +2,3 @@ load(qttest_p4) SOURCES += tst_qtconcurrentrun.cpp QT = core CONFIG += parallel_test -CONFIG += parallel_test diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp index b29e0fabd5..14a7edb735 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp +++ b/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp @@ -43,9 +43,6 @@ #include #include #include -#include "../qfuture/versioncheck.h" - -#ifndef QT_NO_CONCURRENT_TEST using namespace QtConcurrent; @@ -81,9 +78,6 @@ private slots: # define F(X) X #endif - -QTEST_MAIN(tst_QtConcurrentRun) - void light() { qDebug("in function"); @@ -507,8 +501,5 @@ void tst_QtConcurrentRun::lambda() } #endif +QTEST_MAIN(tst_QtConcurrentRun) #include "tst_qtconcurrentrun.moc" - -#else -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro b/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro index bbfcf5ebe3..d7e2464089 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro +++ b/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro @@ -2,4 +2,3 @@ load(qttest_p4) SOURCES += tst_qtconcurrentthreadengine.cpp QT = core CONFIG += parallel_test -CONFIG += parallel_test diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp index f22a2ed64b..4beefef98d 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp +++ b/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp @@ -42,9 +42,6 @@ #include #include #include -#include "../qfuture/versioncheck.h" - -#ifndef QT_NO_CONCURRENT_TEST using namespace QtConcurrent; @@ -530,7 +527,3 @@ void tst_QtConcurrentThreadEngine::exceptions() QTEST_MAIN(tst_QtConcurrentThreadEngine) #include "tst_qtconcurrentthreadengine.moc" - -#else -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/corelib/corelib.pro b/tests/auto/corelib/corelib.pro index b9063e5306..50228990c9 100644 --- a/tests/auto/corelib/corelib.pro +++ b/tests/auto/corelib/corelib.pro @@ -11,3 +11,5 @@ SUBDIRS=\ thread \ tools \ xml + +!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent