From d811a26dc7e821537e9cbd8a275093e58cf0d185 Mon Sep 17 00:00:00 2001 From: ninerider Date: Fri, 25 Sep 2009 15:54:58 +0200 Subject: 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 --- tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro | 6 ++++++ .../qsharedmemory/qsystemlock/tst_qsystemlock.cpp | 19 ++++++++++++++----- 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 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) -- cgit v0.12