Created
January 10, 2018 22:25
-
-
Save stanislaw/d6b454dccb8ff4104450944c77909c28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "gtest/gtest.h" | |
class MinimalistPrinter : public ::testing::EmptyTestEventListener { | |
void OnTestProgramEnd(const ::testing::UnitTest& unit_test) { | |
std::cout << "elapsed time: " << unit_test.elapsed_time() << "\n"; | |
} | |
}; | |
GTEST_API_ int main(int argc, char **argv) { | |
printf("Running main() from gtest_main.cc\n"); | |
::testing::TestEventListeners& listeners = | |
::testing::UnitTest::GetInstance()->listeners(); | |
auto defaultListener = listeners.Release(listeners.default_result_printer()); | |
delete defaultListener; | |
listeners.Append(new MinimalistPrinter); | |
testing::InitGoogleTest(&argc, argv); | |
return RUN_ALL_TESTS(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment