diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-29 10:20:52 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-30 19:19:10 +0000 |
commit | 84042523f272c1d30247e9329eea21036ff793f4 (patch) | |
tree | 1bea66c0d646647dac46bb8308702ffa390737d0 /tests/auto/testlib | |
parent | c23a086e4fc9d7d7b2420de26cbc5adcbd23596e (diff) |
Testlib: Output total test time in plain text logger.
This makes it easier to spot slow tests.
Produces:
Totals: 314 passed, 0 failed, 0 skipped, 0 blacklisted, 137ms
********* Finished testing of tst_QStringRef *********
Task-number: QTBUG-38890
Change-Id: Iaee4dd677fd8f18b82f7c9c4934eb5b1119ade43
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 63c48fc809..389cb65c0b 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -775,6 +775,10 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QRegularExpressionMatch match = durationRegExp.match(line); QVERIFY2(match.hasMatch(), qPrintable(QString::fromLatin1("Invalid Duration tag at line %1 (%2): '%3'") .arg(i).arg(loggers.at(n), output))); + } else if (line.startsWith("Totals:")) { + const int lastCommaPos = line.lastIndexOf(','); + if (lastCommaPos > 0) + line.truncate(lastCommaPos); // Plain text logger: strip time (", 2323dms"). } else { QVERIFY2(output == expected, qPrintable(QString::fromLatin1("Mismatch at line %1 (%2, %3):\n'%4'\n !=\n'%5'") |