summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro6
-rw-r--r--tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp19
2 files changed, 20 insertions, 5 deletions
diff --git a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro b/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro
index 042ab3f..2628f19 100644
--- a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro
+++ b/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro
@@ -5,6 +5,12 @@ include(../src/src.pri)
win32: CONFIG += console
mac:CONFIG -= app_bundle
+wince*|symbian {
+ DEFINES += SRCDIR=\\\"\\\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
DESTDIR = ./
DEFINES += QSHAREDMEMORY_DEBUG
diff --git a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp
index b6355fe..87fc3ee 100644
--- a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp
+++ b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp
@@ -195,26 +195,35 @@ void tst_QSystemLock::processes()
QStringList scripts;
for (int i = 0; i < readOnly; ++i)
- scripts.append("../lackey/scripts/systemlock_read.js");
+ scripts.append(QFileInfo(SRCDIR "lackey/scripts/ systemlock_read.js").absoluteFilePath() );
for (int i = 0; i < readWrite; ++i)
- scripts.append("../lackey/scripts/systemlock_readwrite.js");
+ scripts.append(QFileInfo(SRCDIR "lackey/scripts/systemlock_readwrite.js").absoluteFilePath());
QList<QProcess*> consumers;
+ unsigned int failedProcesses = 0;
for (int i = 0; i < scripts.count(); ++i) {
+
QStringList arguments = QStringList() << scripts.at(i);
QProcess *p = new QProcess;
p->setProcessChannelMode(QProcess::ForwardedChannels);
- consumers.append(p);
- p->start("../lackey/lackey", arguments);
+
+ p->start(QFileInfo(SRCDIR "lackey/lackey").absoluteFilePath(), arguments);
+ // test, if the process could be started.
+
+ if (p->waitForStarted(2000))
+ consumers.append(p);
+ else
+ ++failedProcesses;
}
while (!consumers.isEmpty()) {
consumers.first()->waitForFinished(3000);
- consumers.first()->kill();
+ consumers.first()->kill();
QCOMPARE(consumers.first()->exitStatus(), QProcess::NormalExit);
QCOMPARE(consumers.first()->exitCode(), 0);
delete consumers.takeFirst();
}
+ QCOMPARE(failedProcesses, unsigned int(0));
}
QTEST_MAIN(tst_QSystemLock)