MCPcopy Create free account
hub / github.com/cpputest/cpputest / printTestsEnded

Method printTestsEnded

src/CppUTest/TestOutput.cpp:144–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void TestOutput::printTestsEnded(const TestResult& result)
145{
146 print("\n");
147 const bool isFailure = result.isFailure();
148 const size_t failureCount = result.getFailureCount();
149 if (isFailure) {
150 if (color_) {
151 print("\033[31;1m");
152 }
153 print("Errors (");
154 if (failureCount > 0) {
155 print(failureCount);
156 print(" failures, ");
157 }
158 else {
159 print("ran nothing, ");
160 }
161 }
162 else {
163 if (color_) {
164 print("\033[32;1m");
165 }
166 print("OK (");
167 }
168 print(result.getTestCount());
169 print(" tests, ");
170 print(result.getRunCount());
171 print(" ran, ");
172 print(result.getCheckCount());
173 print(" checks, ");
174 print(result.getIgnoredCount());
175 print(" ignored, ");
176 print(result.getFilteredOutCount());
177 print(" filtered out, ");
178 print(result.getTotalExecutionTime());
179 print(" ms)");
180 if (color_) {
181 print("\033[m");
182 }
183 if (isFailure && failureCount == 0) {
184 print("\nNote: test run failed because no tests were run or ignored. Assuming something went wrong. "
185 "This often happens because of linking errors or typos in test filter.");
186 }
187 print("\n\n");
188
189 dotCount_ = 0;
190}
191
192void TestOutput::printTestRun(size_t number, size_t total)
193{

Callers 1

testsEndedMethod · 0.45

Calls 8

isFailureMethod · 0.80
getIgnoredCountMethod · 0.80
getFilteredOutCountMethod · 0.80
getTotalExecutionTimeMethod · 0.80
getFailureCountMethod · 0.45
getTestCountMethod · 0.45
getRunCountMethod · 0.45
getCheckCountMethod · 0.45

Tested by

no test coverage detected