From 10414444e1fdc3b91328aba19fb10bd92f6dc899 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 15 Sep 2014 15:39:36 +0200 Subject: Add support for blacklisting test functions We need to have a finer grained control over the tests we skip in our CI system. This adds a blacklisting mechanism that allows blacklisting individual test functions (or even test data) using a set of predefined matching keys for the operating system and some other relevant variables. QTestlib will search for a file called BLACKLIST in the test directory and parse it if found. The file contains a simple ini style list of functions to blacklist. For details see qtestblacklist.cpp. Change-Id: Id3fae4b264ca99970cbf9f45bfb85fa75c1fd823 Reviewed-by: Lars Knoll --- src/testlib/qplaintestlogger.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/testlib/qplaintestlogger.cpp') diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 774f2cc4fb..74f0290f38 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -89,6 +89,10 @@ namespace QTest { return "FAIL! "; case QAbstractTestLogger::XPass: return "XPASS "; + case QAbstractTestLogger::BlacklistedPass: + return "BPASS "; + case QAbstractTestLogger::BlacklistedFail: + return "BFAIL "; } return "??????"; } @@ -351,15 +355,16 @@ void QPlainTestLogger::stopLogging() { char buf[1024]; if (QTestLog::verboseLevel() < 0) { - qsnprintf(buf, sizeof(buf), "Totals: %d passed, %d failed, %d skipped\n", + qsnprintf(buf, sizeof(buf), "Totals: %d passed, %d failed, %d skipped, %d blacklisted\n", QTestLog::passCount(), QTestLog::failCount(), - QTestLog::skipCount()); + QTestLog::skipCount(), QTestLog::blacklistCount()); } else { qsnprintf(buf, sizeof(buf), - "Totals: %d passed, %d failed, %d skipped\n" + "Totals: %d passed, %d failed, %d skipped, %d blacklisted\n" "********* Finished testing of %s *********\n", QTestLog::passCount(), QTestLog::failCount(), - QTestLog::skipCount(), QTestResult::currentTestObjectName()); + QTestLog::skipCount(), QTestLog::blacklistCount(), + QTestResult::currentTestObjectName()); } outputMessage(buf); -- cgit v1.2.3