summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorninerider <qt-info@nokia.com>2009-09-25 13:54:58 (GMT)
committerninerider <qt-info@nokia.com>2009-09-25 13:59:10 (GMT)
commitd811a26dc7e821537e9cbd8a275093e58cf0d185 (patch)
treeb4096e74ba531f3056203872195364e4cf88a1b1 /tests
parent0f7f8ccc526c8bc02d1554415cfc52f0f5708743 (diff)
downloadQt-d811a26dc7e821537e9cbd8a275093e58cf0d185.zip
Qt-d811a26dc7e821537e9cbd8a275093e58cf0d185.tar.gz
Qt-d811a26dc7e821537e9cbd8a275093e58cf0d185.tar.bz2
Process could not be located on WindowsCE
The SRCDIR entry was added to the project file to correct the deployment for WindowsCE. Also the process start is now monitored in the test. Reviewed-by: Joerg
Diffstat (limited to 'tests')
-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)