tst_qsystemsemaphore: Use qt_test_helper functionality
Change-Id: I18a5d2d496e1442470423e0f05062cc2ae76a4e4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
8860c26260
commit
3ed22c5efe
@ -0,0 +1,5 @@
|
|||||||
|
QT = core testlib
|
||||||
|
|
||||||
|
SOURCES += main.cpp
|
||||||
|
|
||||||
|
load(qt_test_helper)
|
@ -1,3 +1,3 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS = systemsemaphorehelper test
|
SUBDIRS = acquirerelease test.pro
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
QT = core testlib
|
|
||||||
|
|
||||||
win32: CONFIG += console
|
|
||||||
mac:CONFIG -= app_bundle
|
|
||||||
|
|
||||||
SOURCES += main.cpp
|
|
||||||
TARGET = helperbinary
|
|
||||||
|
|
||||||
CONFIG(debug_and_release) {
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
DESTDIR = ../debug
|
|
||||||
} else {
|
|
||||||
DESTDIR = ../release
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DESTDIR = ..
|
|
||||||
}
|
|
7
tests/auto/corelib/kernel/qsystemsemaphore/test.pro
Normal file
7
tests/auto/corelib/kernel/qsystemsemaphore/test.pro
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
CONFIG += testcase
|
||||||
|
QT = core testlib
|
||||||
|
|
||||||
|
SOURCES += tst_qsystemsemaphore.cpp
|
||||||
|
TARGET = tst_qsystemsemaphore
|
||||||
|
|
||||||
|
win32: CONFIG += console
|
@ -1,17 +0,0 @@
|
|||||||
CONFIG += testcase
|
|
||||||
QT = core testlib
|
|
||||||
|
|
||||||
win32: CONFIG += console
|
|
||||||
|
|
||||||
SOURCES += tst_qsystemsemaphore.cpp
|
|
||||||
TARGET = tst_qsystemsemaphore
|
|
||||||
|
|
||||||
CONFIG(debug_and_release) {
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
DESTDIR = ../debug
|
|
||||||
} else {
|
|
||||||
DESTDIR = ../release
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DESTDIR = ..
|
|
||||||
}
|
|
@ -42,7 +42,6 @@ public:
|
|||||||
tst_QSystemSemaphore();
|
tst_QSystemSemaphore();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void initTestCase();
|
|
||||||
void init();
|
void init();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
@ -65,22 +64,16 @@ private slots:
|
|||||||
void initialValue();
|
void initialValue();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static QString helperBinary();
|
|
||||||
QSystemSemaphore *existingLock;
|
QSystemSemaphore *existingLock;
|
||||||
|
|
||||||
const QString m_helperBinary;
|
const QString m_helperBinary;
|
||||||
};
|
};
|
||||||
|
|
||||||
tst_QSystemSemaphore::tst_QSystemSemaphore()
|
tst_QSystemSemaphore::tst_QSystemSemaphore()
|
||||||
: m_helperBinary(helperBinary())
|
: m_helperBinary("acquirerelease_helper")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QSystemSemaphore::initTestCase()
|
|
||||||
{
|
|
||||||
QVERIFY2(!m_helperBinary.isEmpty(), "Could not find helper binary");
|
|
||||||
}
|
|
||||||
|
|
||||||
void tst_QSystemSemaphore::init()
|
void tst_QSystemSemaphore::init()
|
||||||
{
|
{
|
||||||
existingLock = new QSystemSemaphore(EXISTING_SHARE, 1, QSystemSemaphore::Create);
|
existingLock = new QSystemSemaphore(EXISTING_SHARE, 1, QSystemSemaphore::Create);
|
||||||
@ -294,14 +287,6 @@ void tst_QSystemSemaphore::initialValue()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString tst_QSystemSemaphore::helperBinary()
|
|
||||||
{
|
|
||||||
QString binary = QStringLiteral("helperbinary");
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
binary += QStringLiteral(".exe");
|
|
||||||
#endif
|
|
||||||
return QFINDTESTDATA(binary);
|
|
||||||
}
|
|
||||||
QTEST_MAIN(tst_QSystemSemaphore)
|
QTEST_MAIN(tst_QSystemSemaphore)
|
||||||
#include "tst_qsystemsemaphore.moc"
|
#include "tst_qsystemsemaphore.moc"
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user