From c0932de90e141d6f3eef3388c3caae22f3982798 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 3 Jun 2010 13:44:07 +1000 Subject: Fixed tst_maketestselftest on QWS and Windows. --- tests/auto/maketestselftest/checktest/main.cpp | 13 ++++++++++++- tests/auto/maketestselftest/test/test.pro | 8 ++++++++ tests/auto/maketestselftest/tst_maketestselftest.cpp | 10 ++++++---- 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 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); } -- cgit v0.12