summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-06-03 03:44:07 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-06-03 03:44:07 (GMT)
commitc0932de90e141d6f3eef3388c3caae22f3982798 (patch)
treed452c98631a23b19389d09562b6c2dea8543eb7b /tests
parent9140579d9e39f2a521cdab81ac09e2919645f108 (diff)
downloadQt-c0932de90e141d6f3eef3388c3caae22f3982798.zip
Qt-c0932de90e141d6f3eef3388c3caae22f3982798.tar.gz
Qt-c0932de90e141d6f3eef3388c3caae22f3982798.tar.bz2
Fixed tst_maketestselftest on QWS and Windows.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/maketestselftest/checktest/main.cpp13
-rw-r--r--tests/auto/maketestselftest/test/test.pro8
-rw-r--r--tests/auto/maketestselftest/tst_maketestselftest.cpp10
3 files changed, 26 insertions, 5 deletions
diff --git a/tests/auto/maketestselftest/checktest/main.cpp b/tests/auto/maketestselftest/checktest/main.cpp
index e775665..af98953 100644
--- a/tests/auto/maketestselftest/checktest/main.cpp
+++ b/tests/auto/maketestselftest/checktest/main.cpp
@@ -68,8 +68,19 @@ int main(int argc, char** argv)
args.removeFirst(); // ourself
QString args_quoted = QString("'%1'").arg(args.join("','"));
+
+#ifdef Q_WS_QWS
+ {
+ // for QWS we expect tests to be run as the QWS server
+ QString qws = args.takeLast();
+ if (qws != "-qws") {
+ fail(QString("Expected test to be run with `-qws', but it wasn't; args: %1").arg(args_quoted));
+ }
+ }
+#endif
+
if (args.count() != 1) {
- fail(QString("Expected exactly one argument, got: %1").arg(args_quoted));
+ fail(QString("These arguments are not what I expected: %1").arg(args_quoted));
}
QString test = args.at(0);
diff --git a/tests/auto/maketestselftest/test/test.pro b/tests/auto/maketestselftest/test/test.pro
index 2fae25f..d9de51e 100644
--- a/tests/auto/maketestselftest/test/test.pro
+++ b/tests/auto/maketestselftest/test/test.pro
@@ -8,3 +8,11 @@ DEFINES += SRCDIR=\\\"$$PWD/..\\\"
requires(!cross_compile)
+win32 {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/tst_maketestselftest
+} else {
+ TARGET = ../../release/tst_maketestselftest
+ }
+}
+
diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp
index 9f8e2c5..c3cbf76 100644
--- a/tests/auto/maketestselftest/tst_maketestselftest.cpp
+++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp
@@ -494,16 +494,15 @@ void tst_MakeTestSelfTest::make_check()
QVERIFY(make.waitForFinished(1000 * 60 * 10));
QCOMPARE(make.exitStatus(), QProcess::NormalExit);
- int fail = 0;
int pass = 0;
QList<QByteArray> out = make.readAllStandardOutput().split('\n');
+ QStringList fails;
foreach (QByteArray line, out) {
while (line.endsWith("\r")) {
line.chop(1);
}
if (line.startsWith("CHECKTEST FAIL")) {
- QWARN(line.constData());
- ++fail;
+ fails << QString::fromLocal8Bit(line);
}
if (line.startsWith("CHECKTEST PASS")) {
++pass;
@@ -513,7 +512,10 @@ void tst_MakeTestSelfTest::make_check()
// We can't check that the exit code of make is 0, because some tests
// may have failed to compile, but that doesn't mean `make check' is broken.
// We do assume there are at least this many unbroken tests, though.
- QCOMPARE(fail, 0);
+ QVERIFY2(fails.count() == 0,
+ qPrintable(QString("`make check' doesn't work for %1 tests:\n%2")
+ .arg(fails.count()).arg(fails.join("\n")))
+ );
QVERIFY(pass > 50);
}