summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qsystemsemaphore
diff options
context:
space:
mode:
authorMarko Kangas <marko.kangas@theqtcompany.com>2015-02-13 13:01:57 +0200
committerMarko Kangas <marko.kangas@theqtcompany.com>2015-03-16 09:34:15 +0000
commitbc69fd1dfe30876909091d93a07640a498a24c0c (patch)
tree6af7b94832fcd5c596e54338266d43772ca152e6 /tests/auto/corelib/kernel/qsystemsemaphore
parentf1b3244ac16cd5b306450c53fcbd4ee673bfe53b (diff)
Skip instead of entirely excluding tests with disabled features
Properly QSKIP tests that use disabled QProcess and symlink features instead of excluding them silently by #ifdef. Other reason is that moc doesn't respect QT_NO_* defines in class definition which causes build issues on some platforms. Change-Id: I041020f7452f7d36c7ec8a5866a4ba5eb23d1f94 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qsystemsemaphore')
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
index b2198e9267..169a13aff2 100644
--- a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
@@ -59,7 +59,6 @@ private slots:
void complexacquire();
void release();
-#ifndef QT_NO_PROCESS
void basicProcesses();
void processes_data();
@@ -69,7 +68,6 @@ private slots:
void undo();
#endif
void initialValue();
-#endif // QT_NO_PROCESS
private:
static QString helperBinary();
@@ -177,9 +175,11 @@ void tst_QSystemSemaphore::release()
QCOMPARE(sem.errorString(), QString());
}
-#ifndef QT_NO_PROCESS
void tst_QSystemSemaphore::basicProcesses()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QSystemSemaphore sem("store", 0, QSystemSemaphore::Create);
QProcess acquire;
@@ -198,6 +198,7 @@ void tst_QSystemSemaphore::basicProcesses()
acquire.waitForFinished(HELPERWAITTIME);
release.waitForFinished(HELPERWAITTIME);
QVERIFY(acquire.state() == QProcess::NotRunning);
+#endif
}
void tst_QSystemSemaphore::processes_data()
@@ -212,6 +213,9 @@ void tst_QSystemSemaphore::processes_data()
void tst_QSystemSemaphore::processes()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
QFETCH(int, processes);
@@ -231,12 +235,16 @@ void tst_QSystemSemaphore::processes()
QCOMPARE(consumers.first()->exitCode(), 0);
delete consumers.takeFirst();
}
+#endif
}
// This test only checks a system v unix behavior.
#if !defined(Q_OS_WIN) && !defined(QT_POSIX_IPC)
void tst_QSystemSemaphore::undo()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
QStringList acquireArguments = QStringList("acquire");
@@ -253,11 +261,15 @@ void tst_QSystemSemaphore::undo()
QVERIFY2(acquire.waitForStarted(), "Could not start helper binary");
acquire.waitForFinished(HELPERWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
+#endif
}
#endif
void tst_QSystemSemaphore::initialValue()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
QStringList acquireArguments = QStringList("acquire");
@@ -284,8 +296,8 @@ void tst_QSystemSemaphore::initialValue()
acquire.waitForFinished(HELPERWAITTIME);
release.waitForFinished(HELPERWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
-}
#endif
+}
QString tst_QSystemSemaphore::helperBinary()
{