MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / prepareTest

Method prepareTest

test/fixture.cpp:94–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92TestFixture::~TestFixture() = default;
93
94bool 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
123void TestFixture::teardownTest()
124{

Callers

nothing calls this directly

Calls 3

clearMethod · 0.45
emptyMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected