Compile guard tests in corelib/kernel that need threading support

Some tests in corelib/kernel need threading support, but they are not
guarded against compilation if Qt is built without threading.
Such tests have been disabled in this case.

Change-Id: I2f5dc9582f2a59b6af2a9e56638b045dca06193d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
bb10
Mikolaj Boc 2022-08-26 21:13:59 +02:00
parent f3512ada09
commit 1d401e34ac
6 changed files with 20 additions and 0 deletions

View File

@ -376,6 +376,7 @@ public:
int Bar::failureCount = 0;
#if QT_CONFIG(thread)
class MetaTypeTorturer: public QThread
{
Q_OBJECT
@ -485,6 +486,7 @@ void tst_QMetaType::threadSafety()
QCOMPARE(t3.failureCount, 0);
QCOMPARE(Bar::failureCount, 0);
}
#endif
namespace TestSpace
{

View File

@ -45,7 +45,9 @@ private:
private slots:
void defined();
#if QT_CONFIG(thread)
void threadSafety();
#endif
void namespaces();
void id();
void qMetaTypeId();

View File

@ -7,6 +7,10 @@
## tst_qpointer Test:
#####################################################################
if (NOT QT_FEATURE_thread)
return()
endif()
qt_internal_add_test(tst_qpointer
SOURCES
tst_qpointer.cpp

View File

@ -78,8 +78,10 @@ private slots:
void compatPropertySignals();
void noFakeDependencies();
#if QT_CONFIG(thread)
void threadSafety();
void threadSafety2();
#endif // QT_CONFIG(thread)
void bindablePropertyWithInitialization();
void noDoubleNotification();
@ -1661,6 +1663,7 @@ void tst_QProperty::noFakeDependencies()
QCOMPARE(old, bindingFunctionCalled);
}
#if QT_CONFIG(thread)
struct ThreadSafetyTester : public QObject
{
Q_OBJECT
@ -1780,6 +1783,7 @@ void tst_QProperty::threadSafety2()
QCOMPARE(movedObj->objectName(), "test");
QCOMPARE(movedObj->children().first()->objectName(), "child");
}
#endif // QT_CONFIG(thread)
struct CustomType
{

View File

@ -7,6 +7,10 @@
## tst_qtimer Test:
#####################################################################
if (NOT QT_FEATURE_thread)
return()
endif()
qt_internal_add_test(tst_qtimer
SOURCES
tst_qtimer.cpp

View File

@ -7,6 +7,10 @@
## tst_qtranslator Test:
#####################################################################
if (NOT QT_CONFIG_thread)
return()
endif()
qt_internal_add_test(tst_qtranslator
SOURCES
tst_qtranslator.cpp