summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-21 16:40:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-21 16:40:56 (GMT)
commit2f14520ce72f0798a751f796baf93dd3f77a276d (patch)
tree6d2f527e163602b24dd6752c474dcd7cbf8b94b8 /tests
parent66f02b76e7cd70545037d4eae984ed6819e39f1f (diff)
parentff12089c6a80cb05ae1ff3e64505509de83337e1 (diff)
downloadQt-2f14520ce72f0798a751f796baf93dd3f77a276d.zip
Qt-2f14520ce72f0798a751f796baf93dd3f77a276d.tar.gz
Qt-2f14520ce72f0798a751f796baf93dd3f77a276d.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: tst_QSystemSemaphore::processes fixed for WinCE tst_qsystemsemaphore: fix deployment of lackey.exe for WinCE tst_qsharedmemory: create multiple instances of lackey.exe on WinCE tst_qsharedmemory: fix deployment of lackey.exe for WinCE fix compilation of tst_sharedmemory on Windows CE examples/widgets/stylesheet fix mainwindow.ui QStyleSheetStyle: fix memory leak on base style change
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtipc/qsharedmemory/test/test.pro6
-rw-r--r--tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp16
-rw-r--r--tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro5
-rw-r--r--tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp37
4 files changed, 46 insertions, 18 deletions
diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro
index 40ba8b9..4ff5486 100644
--- a/tests/auto/qtipc/qsharedmemory/test/test.pro
+++ b/tests/auto/qtipc/qsharedmemory/test/test.pro
@@ -20,10 +20,10 @@ TARGET = ../tst_qsharedmemory
wince*:{
requires(contains(QT_CONFIG,script))
QT += gui script
-addFiles.sources = ../../lackey/lackey.exe ../../lackey/scripts
-addFiles.path = lackey
+addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts
+addFiles.path = .
DEPLOYMENT += addFiles
-DEFINES += SRCDIR=\\\"\\\"
+DEFINES += SRCDIR=\\\".\\\"
}else:symbian*{
requires(contains(QT_CONFIG,script))
QT += gui script
diff --git a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp
index 83f65b0..dac631b 100644
--- a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp
+++ b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp
@@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <qsharedmemory.h>
+#include <QtCore/QFile>
//TESTED_CLASS=
//TESTED_FILES=
@@ -52,8 +53,8 @@
#ifdef Q_OS_SYMBIAN
#define SRCDIR "c:/data/qsharedmemorytemp/"
#define LACKEYDIR SRCDIR "lackey"
-#elif Q_OS_WINCE
-#define LACKEYDIR SRCDIR "lackey"
+#elif defined(Q_OS_WINCE)
+#define LACKEYDIR SRCDIR
#else
#define LACKEYDIR SRCDIR "../lackey"
#endif
@@ -746,7 +747,18 @@ void tst_QSharedMemory::simpleProcessProducerConsumer()
QStringList arguments = QStringList() << LACKEYDIR "/scripts/consumer.js";
QProcess *p = new QProcess;
p->setProcessChannelMode(QProcess::ForwardedChannels);
+#ifdef Q_OS_WINCE
+ // We can't start the same executable twice on Windows CE.
+ // Create a copy instead.
+ QString lackeyCopy = QLatin1String(LACKEYDIR "/lackey");
+ lackeyCopy.append(QString::number(i));
+ lackeyCopy.append(QLatin1String(".exe"));
+ if (!QFile::exists(lackeyCopy))
+ QVERIFY(QFile::copy(LACKEYDIR "/lackey.exe", lackeyCopy));
+ p->start(lackeyCopy, arguments);
+#else
p->start(LACKEYDIR "/lackey", arguments);
+#endif
if (p->waitForStarted(2000))
consumers.append(p);
diff --git a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro
index 1f9205e..8a5f8b2 100644
--- a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro
+++ b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro
@@ -17,9 +17,8 @@ requires(contains(QT_CONFIG,script))
# this test calls lackey, which then again depends on QtScript.
# let's add it here so that it gets deployed easily
QT += script
-lackey.sources = ../lackey/lackey.exe
-lackey.path = ../lackey
-
+lackey.sources = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts
+lackey.path = .
DEPLOYMENT += lackey
}
diff --git a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp
index eb82fd4..cb3bb6b 100644
--- a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp
+++ b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp
@@ -46,7 +46,11 @@
//TESTED_FILES=
#define EXISTING_SHARE "existing"
-#define LACKYLOC "../lackey"
+#ifdef Q_OS_WINCE
+#define LACKEYLOC "."
+#else
+#define LACKEYLOC "../lackey"
+#endif
#define LACKYWAITTIME 10000
class tst_QSystemSemaphore : public QObject
@@ -109,7 +113,7 @@ private:
tst_QSystemSemaphore::tst_QSystemSemaphore()
{
- if (!QFile::exists(LACKYLOC "/lackey"))
+ if (!QFile::exists(LACKEYLOC "/lackey"))
qWarning() << "lackey executable doesn't exists!";
}
@@ -197,11 +201,11 @@ void tst_QSystemSemaphore::basicProcesses()
QProcess release;
release.setProcessChannelMode(QProcess::ForwardedChannels);
- acquire.start(LACKYLOC "/lackey", acquireArguments);
+ acquire.start(LACKEYLOC "/lackey", acquireArguments);
acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state() == QProcess::Running);
acquire.kill();
- release.start(LACKYLOC "/lackey", releaseArguments);
+ release.start(LACKEYLOC "/lackey", releaseArguments);
acquire.waitForFinished(LACKYWAITTIME);
release.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state() == QProcess::NotRunning);
@@ -235,7 +239,20 @@ void tst_QSystemSemaphore::processes()
QProcess *p = new QProcess;
p->setProcessChannelMode(QProcess::ForwardedChannels);
consumers.append(p);
- p->start(LACKYLOC "/lackey", arguments);
+#ifdef Q_OS_WINCE
+ // We can't start the same executable twice on Windows CE.
+ // Create a copy instead.
+ QString lackeyCopy = QLatin1String(LACKEYLOC "/lackey");
+ if (i > 0) {
+ lackeyCopy.append(QString::number(i));
+ lackeyCopy.append(QLatin1String(".exe"));
+ if (!QFile::exists(lackeyCopy))
+ QVERIFY(QFile::copy(LACKEYLOC "/lackey.exe", lackeyCopy));
+ }
+ p->start(lackeyCopy, arguments);
+#else
+ p->start(LACKEYLOC "/lackey", arguments);
+#endif
}
while (!consumers.isEmpty()) {
@@ -257,13 +274,13 @@ void tst_QSystemSemaphore::undo()
QStringList acquireArguments = QStringList() << acquire_js();
QProcess acquire;
acquire.setProcessChannelMode(QProcess::ForwardedChannels);
- acquire.start(LACKYLOC "/lackey", acquireArguments);
+ acquire.start(LACKEYLOC "/lackey", acquireArguments);
acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
// At process exit the kernel should auto undo
- acquire.start(LACKYLOC "/lackey", acquireArguments);
+ acquire.start(LACKEYLOC "/lackey", acquireArguments);
acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
}
@@ -283,16 +300,16 @@ void tst_QSystemSemaphore::initialValue()
QProcess release;
release.setProcessChannelMode(QProcess::ForwardedChannels);
- acquire.start(LACKYLOC "/lackey", acquireArguments);
+ acquire.start(LACKEYLOC "/lackey", acquireArguments);
acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
- acquire.start(LACKYLOC "/lackey", acquireArguments << "2");
+ acquire.start(LACKEYLOC "/lackey", acquireArguments << "2");
acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::Running);
acquire.kill();
- release.start(LACKYLOC "/lackey", releaseArguments);
+ release.start(LACKEYLOC "/lackey", releaseArguments);
acquire.waitForFinished(LACKYWAITTIME);
release.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);