summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Doukoudakis <thanos.doukoudakis@isode.com>2017-06-16 10:45:03 (GMT)
committerThanos Doukoudakis <thanos.doukoudakis@isode.com>2017-07-07 13:47:58 (GMT)
commit1b678a155adca8957866e016b0e344eee6290466 (patch)
tree08af7836ed7fca39a61f85941ec7545be7455c97 /QA/Checker/checker.cpp
parent2a251161c5baa688ec12068346359bd829ab2ea1 (diff)
downloadswift-1b678a155adca8957866e016b0e344eee6290466.zip
swift-1b678a155adca8957866e016b0e344eee6290466.tar.bz2
Make gtest output more compact
This patch will make the checker test application output to use a custom printer for google test results. The output will be less verbose, and similar to the output of CppUnit. If the --verbose flag is used, the default printer will be used instead. Test-information: Tested on Windows 10 and Ubuntu 16.04. Change-Id: I1488cf576ab07da03b0dfcc93a48a8518d5afc06
Diffstat (limited to 'QA/Checker/checker.cpp')
-rw-r--r--QA/Checker/checker.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/QA/Checker/checker.cpp b/QA/Checker/checker.cpp
index bcf0f5c..3cc7713 100644
--- a/QA/Checker/checker.cpp
+++ b/QA/Checker/checker.cpp
@@ -10,6 +10,7 @@
#include <sstream>
#include <gtest/gtest.h>
+#include <QA/Checker/CppUnitTestResultPrinter.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/TextOutputter.h>
@@ -126,6 +127,12 @@ int main(int argc, char* argv[]) {
auto googleTestWasSuccessful = false;
try {
+ if (!verbose) {
+ testing::UnitTest& unitTest = *testing::UnitTest::GetInstance();
+ testing::TestEventListeners& listeners = unitTest.listeners();
+ delete listeners.Release(listeners.default_result_printer());
+ listeners.Append(new testing::CppUnitTestResultPrinter);
+ }
googleTestWasSuccessful = RUN_ALL_TESTS() == 0 ? true : false;
} catch (const ::testing::internal::GoogleTestFailureException& e) {
googleTestWasSuccessful = false;