# This file tests the tclWinFile.c file. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: winFile.test,v 1.6 2000/04/10 17:19:06 ericm Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest namespace import -force ::tcltest::* } test winFile-1.1 {TclpGetUserHome} {pcOnly} { list [catch {glob ~nosuchuser} msg] $msg } {1 {user "nosuchuser" doesn't exist}} test winFile-1.2 {TclpGetUserHome} {nt nonPortable} { # The administrator account should always exist. catch {glob ~administrator} } {0} test winFile-1.2 {TclpGetUserHome} {95} { # Find some user in system.ini and then see if they have a home. set f [open $::env(windir)/system.ini] set x 0 while {![eof $f]} { set line [gets $f] if {$line == "\[Password Lists]"} { gets $f set name [lindex [split [gets $f] =] 0] if {$name != ""} { set x [catch {glob ~$name}] break } } } close $f set x } {0} test winFile-1.3 {TclpGetUserHome} {nt nonPortable} { catch {glob ~stanton@workgroup} } {0} test winFile-2.1 {TclpMatchFiles: case sensitivity} {pcOnly} { makeFile {} GlobCapS set result [list [glob -nocomplain GlobC*] [glob -nocomplain globc*]] removeFile GlobCapS set result } {GlobCapS GlobCapS} test winFile-2.2 {TclpMatchFiles: case sensitivity} {pcOnly} { makeFile {} globlower set result [list [glob -nocomplain globl*] [glob -nocomplain gLOBl*]] removeFile globlower set result } {globlower globlower} # cleanup ::tcltest::cleanupTests return -git/Qt.git/tree/tests?h=v4.7.5&id=89cc9cfa72c1e571699caca7488d0c37dadb015d'>treecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-13 04:51:21 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-13 04:52:03 (GMT)
commit89cc9cfa72c1e571699caca7488d0c37dadb015d (patch)
treef902694330205db5db605f30ee3dfeb15cd623e1 /tests
parent79d0a9696af910a446cd535148880a9fb6cdf90f (diff)
downloadQt-89cc9cfa72c1e571699caca7488d0c37dadb015d.zip
Qt-89cc9cfa72c1e571699caca7488d0c37dadb015d.tar.gz
Qt-89cc9cfa72c1e571699caca7488d0c37dadb015d.tar.bz2
Tweak tests to run in parallel
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/examples/examples.pro3
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp95
-rw-r--r--tests/auto/declarative/graphicswidgets/graphicswidgets.pro2
-rw-r--r--tests/auto/declarative/parserstress/parserstress.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro3
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro3
-rw-r--r--tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro3
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro3
-rw-r--r--tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro3
-rw-r--r--tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro3
-rw-r--r--tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro3
-rw-r--r--tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro3
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro1
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro3
-rw-r--r--tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro2
-rw-r--r--tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro3
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro3
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro3
-rw-r--r--tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro2
-rw-r--r--tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro2
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro1
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro3
-rw-r--r--tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro3
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro3
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro3
-rw-r--r--tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro3
-rw-r--r--tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro3
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro2
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro3
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedfollow/qdeclarativesmoothedfollow.pro3
-rw-r--r--tests/auto/declarative/qdeclarativespringfollow/qdeclarativespringfollow.pro3
-rw-r--r--tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro2
-rw-r--r--tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro2
-rw-r--r--tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro3
-rw-r--r--tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro3
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro1
-rw-r--r--tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro3
-rw-r--r--tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro3
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro3
-rw-r--r--tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro1
-rw-r--r--tests/auto/declarative/qmlvisual/qmlvisual.pro3
-rw-r--r--tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro2
-rw-r--r--tests/auto/declarative/sql/sql.pro3
64 files changed, 266 insertions, 0 deletions
diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro
index 85d2a73..b316cb9 100644
--- a/tests/auto/declarative/examples/examples.pro
+++ b/tests/auto/declarative/examples/examples.pro
@@ -5,3 +5,6 @@ macx:CONFIG -= app_bundle
SOURCES += tst_examples.cpp
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index 3d717bc..64734af 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -44,6 +44,13 @@
#include <QProcess>
#include <QDebug>
+#define CONCURRENT
+
+#ifdef CONCURRENT
+#include <QFutureSynchronizer>
+#include <QtConcurrentRun>
+#endif
+
class tst_examples : public QObject
{
Q_OBJECT
@@ -51,7 +58,9 @@ public:
tst_examples();
private slots:
+#ifndef CONCURRENT
void examples_data();
+#endif
void examples();
void namingConvention();
@@ -163,6 +172,8 @@ QStringList tst_examples::findQmlFiles(const QDir &d)
return rv;
}
+
+
/*
This test runs all the examples in the declarative UI source tree and ensures
that they start and exit cleanly.
@@ -170,6 +181,7 @@ that they start and exit cleanly.
Examples are any .qml files under the examples/ or demos/ directory that start
with a lower case letter.
*/
+#ifndef CONCURRENT
void tst_examples::examples_data()
{
QTest::addColumn<QString>("file");
@@ -186,9 +198,91 @@ void tst_examples::examples_data()
foreach (const QString &file, files)
QTest::newRow(file.toLatin1().constData()) << file;
}
+#endif
+
+#ifdef CONCURRENT
+#define THREADS 5
+
+struct Example {
+public:
+ Example() : result(Unknown) {}
+
+ enum Result { Pass, Unknown, Fail };
+ Result result;
+ QString file;
+ QString qmlruntime;
+
+ void run();
+};
+
+void Example::run()
+{
+ QFileInfo fi(file);
+ QFileInfo dir(fi.path());
+ QString script = SRCDIR "/data/"+dir.baseName()+"/"+fi.baseName();
+ QFileInfo testdata(script+".qml");
+ QStringList arguments;
+ arguments << "-script" << (testdata.exists() ? script : QLatin1String(SRCDIR "/data/dummytest"))
+ << "-scriptopts" << "play,testerror,exitoncomplete,exitonfailure"
+ << file;
+ QProcess p;
+ p.start(qmlruntime, arguments);
+ if (!p.waitForFinished()) {
+ result = Fail;
+ return;
+ }
+
+ if (p.exitStatus() != QProcess::NormalExit || p.exitCode() != 0)
+ qWarning() << p.readAllStandardOutput() << p.readAllStandardError();
+
+ if (p.exitStatus() != QProcess::NormalExit ||
+ p.exitCode() != 0) {
+ result = Fail;
+ return;
+ } else {
+ result = Pass;
+ return;
+ }
+}
+#endif
void tst_examples::examples()
{
+#ifdef CONCURRENT
+ QThreadPool::globalInstance()->setMaxThreadCount(5);
+
+ QString examples = QLibraryInfo::location(QLibraryInfo::ExamplesPath);
+ QString demos = QLibraryInfo::location(QLibraryInfo::DemosPath);
+ QString snippets = QLatin1String(SRCDIR) + "/../../../../doc/src/snippets/";
+
+ QStringList files;
+ files << findQmlFiles(QDir(examples));
+ files << findQmlFiles(QDir(demos));
+ files << findQmlFiles(QDir(snippets));
+
+ QList<Example> tests;
+
+ for (int ii = 0; ii < files.count(); ++ii) {
+ Example e;
+ e.file = files.at(ii);
+ e.qmlruntime = qmlruntime;
+ tests << e;
+ }
+
+ QFutureSynchronizer<void> sync;
+
+ for (int ii = 0; ii < tests.count(); ++ii) {
+ QFuture<void> r = QtConcurrent::run(tests.at(ii), &Example::run);
+ sync.addFuture(r);
+ }
+
+ sync.waitForFinished();
+
+ for (int ii = 0; ii < tests.count(); ++ii)
+ QVERIFY(tests.at(ii).result == Example::Pass);
+
+#else
+
QFETCH(QString, file);
QFileInfo fi(file);
@@ -210,6 +304,7 @@ void tst_examples::examples()
qWarning() << p.readAllStandardOutput() << p.readAllStandardError();
QCOMPARE(p.exitStatus(), QProcess::NormalExit);
QCOMPARE(p.exitCode(), 0);
+#endif
}
QTEST_MAIN(tst_examples)
diff --git a/tests/auto/declarative/graphicswidgets/graphicswidgets.pro b/tests/auto/declarative/graphicswidgets/graphicswidgets.pro
index 712c34c..b77b430 100644
--- a/tests/auto/declarative/graphicswidgets/graphicswidgets.pro
+++ b/tests/auto/declarative/graphicswidgets/graphicswidgets.pro
@@ -6,3 +6,5 @@ SOURCES += tst_graphicswidgets.cpp
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro
index 48f147a..8830511 100644
--- a/tests/auto/declarative/parserstress/parserstress.pro
+++ b/tests/auto/declarative/parserstress/parserstress.pro
@@ -5,3 +5,6 @@ macx:CONFIG -= app_bundle
SOURCES += tst_parserstress.cpp
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
index ca2f68f..a2403f2 100644
--- a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
+++ b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
@@ -4,3 +4,6 @@ SOURCES += tst_qdeclarativeanchors.cpp
macx:CONFIG -= app_bundle
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
index 2904986..74f9be0 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
@@ -5,3 +5,6 @@ SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp
macx:CONFIG -= app_bundle
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
index 8eac75f..ce38eeb 100644
--- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
+++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
@@ -4,3 +4,6 @@ SOURCES += tst_qdeclarativeanimations.cpp
macx:CONFIG -= app_bundle
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
index a1dac32..c2781b8 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
+++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
@@ -4,3 +4,6 @@ SOURCES += tst_qdeclarativebehaviors.cpp
macx:CONFIG -= app_bundle
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
index 7879976..04dd6f5 100644
--- a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
+++ b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
@@ -6,3 +6,6 @@ SOURCES += tst_qdeclarativebinding.cpp
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
index 0574ddb..e754923 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
+++ b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
@@ -7,3 +7,6 @@ SOURCES += tst_qdeclarativeborderimage.cpp ../shared/testhttpserver.cpp
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
index c7affb7..e58c798 100644
--- a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
+++ b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -6,3 +6,6 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativecomponent.cpp
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
index a6adfa4..959354d 100644
--- a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
+++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
@@ -6,3 +6,6 @@ SOURCES += tst_qdeclarativeconnection.cpp
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
index adace70..5db9a9e 100644
--- a/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
+++ b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
@@ -4,3 +4,6 @@ SOURCES += tst_qdeclarativecontext.cpp
macx:CONFIG -= app_bundle
DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro b/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro