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 /src | |
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 'src')
-rw-r--r-- | src/testlib/qplaintestlogger.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index d820e87ccb..80b93886bb 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -348,16 +348,17 @@ void QPlainTestLogger::startLogging() void QPlainTestLogger::stopLogging() { char buf[1024]; + const int timeMs = qRound(QTestLog::msecsTotalTime()); if (QTestLog::verboseLevel() < 0) { - qsnprintf(buf, sizeof(buf), "Totals: %d passed, %d failed, %d skipped, %d blacklisted\n", + qsnprintf(buf, sizeof(buf), "Totals: %d passed, %d failed, %d skipped, %d blacklisted, %dms\n", QTestLog::passCount(), QTestLog::failCount(), - QTestLog::skipCount(), QTestLog::blacklistCount()); + QTestLog::skipCount(), QTestLog::blacklistCount(), timeMs); } else { qsnprintf(buf, sizeof(buf), - "Totals: %d passed, %d failed, %d skipped, %d blacklisted\n" + "Totals: %d passed, %d failed, %d skipped, %d blacklisted, %dms\n" "********* Finished testing of %s *********\n", QTestLog::passCount(), QTestLog::failCount(), - QTestLog::skipCount(), QTestLog::blacklistCount(), + QTestLog::skipCount(), QTestLog::blacklistCount(), timeMs, QTestResult::currentTestObjectName()); } outputMessage(buf); |