Exclude qtconcurrent tests via .pro files.

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 <morten.sorvig@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Jason McDonald 2011-10-11 14:15:52 +10:00 committed by Qt by Nokia
parent 450962be95
commit 7c64ab4966
14 changed files with 12 additions and 127 deletions

2
configure vendored
View File

@ -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

View File

@ -45,12 +45,9 @@
#include <QtTest/QtTest>
#include <qfuture.h>
#include "versioncheck.h"
#include <qfuturewatcher.h>
#include <qtconcurrentresultstore.h>
#include <qtconcurrentexception.h>
#ifndef QT_NO_CONCURRENT_TEST
#include <private/qfutureinterface_p.h>
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

View File

@ -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 <qglobal.h>
#ifdef QT_NO_CONCURRENT
#define QT_NO_CONCURRENT_TEST
#endif
#if defined(Q_CC_MSVC) && _MSC_VER < 1400
#define QT_NO_CONCURRENT_TEST
#endif

View File

@ -43,13 +43,10 @@
#include <QtTest/QtTest>
#include <qfuture.h>
#include "../qfuture/versioncheck.h"
#include <qfuturewatcher.h>
#include <qtconcurrentrun.h>
#include <qtconcurrentmap.h>
#include "../../../../shared/util.h"
#ifndef QT_NO_CONCURRENT_TEST
#include <private/qfutureinterface_p.h>
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

View File

@ -45,7 +45,8 @@
#include <QtTest/QtTest>
#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"

View File

@ -2,4 +2,3 @@ load(qttest_p4)
SOURCES += tst_qtconcurrentiteratekernel.cpp
QT = core
CONFIG += parallel_test
CONFIG += parallel_test

View File

@ -39,7 +39,6 @@
**
****************************************************************************/
#include <QThread>
#include "../qfuture/versioncheck.h"
struct TestIterator
{
@ -82,12 +81,9 @@ int distance(TestIterator &a, TestIterator &b)
}
#endif
#include <qtconcurrentiteratekernel.h>
#include <QtTest/QtTest>
#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

View File

@ -3,4 +3,3 @@ DEFINES += QT_STRICT_ITERATORS
SOURCES += tst_qtconcurrentmap.cpp
QT = core
CONFIG += parallel_test
CONFIG += parallel_test

View File

@ -47,7 +47,8 @@
#include <QtTest/QtTest>
#include "functions.h"
#include "../qfuture/versioncheck.h"
#if !defined(QT_NO_CONCURRENT_MAP)
Q_DECLARE_METATYPE(QVector<int>);
Q_DECLARE_METATYPE(QVector<double>);
@ -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

View File

@ -2,4 +2,3 @@ load(qttest_p4)
SOURCES += tst_qtconcurrentrun.cpp
QT = core
CONFIG += parallel_test
CONFIG += parallel_test

View File

@ -43,9 +43,6 @@
#include <qfuture.h>
#include <QString>
#include <QtTest/QtTest>
#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

View File

@ -2,4 +2,3 @@ load(qttest_p4)
SOURCES += tst_qtconcurrentthreadengine.cpp
QT = core
CONFIG += parallel_test
CONFIG += parallel_test

View File

@ -42,9 +42,6 @@
#include <qtconcurrentexception.h>
#include <QThread>
#include <QtTest/QtTest>
#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

View File

@ -11,3 +11,5 @@ SUBDIRS=\
thread \
tools \
xml
!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent