diff options
Diffstat (limited to 'tests/auto/testlib/selftests/tst_selftests.cpp')
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index e332f01861..15aec85bdf 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -99,13 +99,13 @@ inline bool qCompare // Now check the value. Some variance is allowed, and how much depends on // the measured unit. qreal variance = 0.; - if (r1.unit == "msec") { + if (r1.unit == "msecs" || r1.unit == "WalltimeMilliseconds") { variance = 0.1; } else if (r1.unit == "instruction reads") { variance = 0.001; } - else if (r1.unit == "ticks") { + else if (r1.unit == "CPU ticks" || r1.unit == "CPUTicks") { variance = 0.001; } if (variance == 0.) { @@ -381,6 +381,10 @@ void tst_Selftests::runSubTest_data() << "subtest" << "verbose1" << "verbose2" +#ifndef QT_NO_EXCEPTIONS + // this test will test nothing if the exceptions are disabled + << "verifyexceptionthrown" +#endif //!QT_NO_EXCEPTIONS << "warnings" << "xunit" ; @@ -633,9 +637,19 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge .arg(loggers.at(n)))); } } else { - QVERIFY2(res.count() == exp.count(), + if (res.count() != exp.count()) { + qDebug() << "<<<<<<"; + foreach (const QByteArray &line, res) + qDebug() << line; + qDebug() << "======"; + foreach (const QByteArray &line, exp) + qDebug() << line; + qDebug() << ">>>>>>"; + + QVERIFY2(res.count() == exp.count(), qPrintable(QString::fromLatin1("Mismatch in line count: %1 != %2 (%3).") .arg(res.count()).arg(exp.count()).arg(loggers.at(n)))); + } } // By this point, we should have loaded a non-empty expected data file. |