| 92 | TestFixture::~TestFixture() = default; |
| 93 | |
| 94 | bool TestFixture::prepareTest(const char testname[]) |
| 95 | { |
| 96 | mTemplateFormat.clear(); |
| 97 | mTemplateLocation.clear(); |
| 98 | |
| 99 | prepareTestInternal(); |
| 100 | |
| 101 | // Check if tests should be executed |
| 102 | if (!testsToRun.empty()) { |
| 103 | const bool match = testsToRun.count(testname); |
| 104 | if ((match && exclude_tests) || (!match && !exclude_tests)) |
| 105 | return false; |
| 106 | } |
| 107 | |
| 108 | // Tests will be executed - prepare them |
| 109 | mTestname = testname; |
| 110 | ++countTests; |
| 111 | std::string fullTestName = classname + "::" + mTestname; |
| 112 | if (quiet_tests) { |
| 113 | std::putchar('.'); // Use putchar to write through redirection of std::cout/cerr |
| 114 | std::fflush(stdout); |
| 115 | } else { |
| 116 | std::cout << fullTestName << std::endl; |
| 117 | } |
| 118 | if (timer_results) |
| 119 | mTimer.reset(new Timer(fullTestName, timer_results)); |
| 120 | return !dry_run; |
| 121 | } |
| 122 | |
| 123 | void TestFixture::teardownTest() |
| 124 | { |