11#define CATCH_CONFIG_EXTERNAL_INTERFACES
20std::string
ws(
int const level) {
21 return std::string( 2 * level,
' ' );
25std::ostream&
operator<<( std::ostream&
os, std::vector<T>
const& v ) {
38 os <<
ws(level ) << title <<
":\n"
39 <<
ws(level+1) <<
"- file: " << info.file <<
"\n"
40 <<
ws(level+1) <<
"- line: " << info.line <<
"\n";
52 os <<
ws(level+1) <<
"- macroName: '" << info.macroName <<
"'\n"
53 <<
ws(level+1) <<
"- message '" << info.message <<
"'\n";
54 print(
os,level+1 ,
"- lineInfo", info.lineInfo );
55 os <<
ws(level+1) <<
"- sequence " << info.sequence <<
"\n";
58void print( std::ostream&
os,
int const level, std::string
const& title, std::vector<Catch::MessageInfo>
const& v ) {
59 os <<
ws(level ) << title <<
":\n";
62 os <<
ws(level+1) <<
"{\n";
64 os <<
ws(level+1) <<
"}\n";
74 os <<
ws(level ) << title <<
":\n"
75 <<
ws(level+1) <<
"- name: " << info.name <<
"\n";
89 os <<
ws(level ) << title <<
":\n"
90 <<
ws(level+1) <<
"- total(): " << info.total() <<
"\n"
91 <<
ws(level+1) <<
"- allPassed(): " << info.allPassed() <<
"\n"
92 <<
ws(level+1) <<
"- allOk(): " << info.allOk() <<
"\n"
93 <<
ws(level+1) <<
"- passed: " << info.passed <<
"\n"
94 <<
ws(level+1) <<
"- failed: " << info.failed <<
"\n"
95 <<
ws(level+1) <<
"- failedButOk: " << info.failedButOk <<
"\n";
104 os <<
ws(level) << title <<
":\n";
105 print(
os, level+1,
"- assertions", info.assertions );
106 print(
os, level+1,
"- testCases" , info.testCases );
116 os <<
ws(level) << title <<
":\n";
117 print(
os, level+1 ,
"- runInfo", info.runInfo );
118 print(
os, level+1 ,
"- totals" , info.totals );
119 os <<
ws(level+1) <<
"- aborting: " << info.aborting <<
"\n";
150 os <<
ws(level ) << title <<
":\n"
151 <<
ws(level+1) <<
"- isHidden(): " << info.isHidden() <<
"\n"
152 <<
ws(level+1) <<
"- throws(): " << info.throws() <<
"\n"
153 <<
ws(level+1) <<
"- okToFail(): " << info.okToFail() <<
"\n"
154 <<
ws(level+1) <<
"- expectedToFail(): " << info.expectedToFail() <<
"\n"
155 <<
ws(level+1) <<
"- tagsAsString(): '" << info.tagsAsString() <<
"'\n"
156 <<
ws(level+1) <<
"- name: '" << info.name <<
"'\n"
157 <<
ws(level+1) <<
"- className: '" << info.className <<
"'\n"
158 <<
ws(level+1) <<
"- description: '" << info.description <<
"'\n"
159 <<
ws(level+1) <<
"- tags: " << info.tags <<
"\n"
160 <<
ws(level+1) <<
"- lcaseTags: " << info.lcaseTags <<
"\n";
161 print(
os, level+1 ,
"- lineInfo", info.lineInfo );
162 os <<
ws(level+1) <<
"- properties (flags): 0x" << std::hex << info.properties << std::dec <<
"\n";
174 os <<
ws(level ) << title <<
":\n";
175 print(
os, level+1 ,
"- testInfo", info.testInfo );
176 print(
os, level+1 ,
"- totals" , info.totals );
177 os <<
ws(level+1) <<
"- stdOut: " << info.stdOut <<
"\n"
178 <<
ws(level+1) <<
"- stdErr: " << info.stdErr <<
"\n"
179 <<
ws(level+1) <<
"- aborting: " << info.aborting <<
"\n";
189 os <<
ws(level ) << title <<
":\n"
190 <<
ws(level+1) <<
"- name: " << info.name <<
"\n";
191 print(
os, level+1 ,
"- lineInfo", info.lineInfo );
202 os <<
ws(level ) << title <<
":\n";
203 print(
os, level+1 ,
"- sectionInfo", info.sectionInfo );
204 print(
os, level+1 ,
"- assertions" , info.assertions );
205 os <<
ws(level+1) <<
"- durationInSeconds: " << info.durationInSeconds <<
"\n"
206 <<
ws(level+1) <<
"- missingAssertions: " << info.missingAssertions <<
"\n";
218 os <<
ws(level ) << title <<
":\n"
219 <<
ws(level+1) <<
"- macroName: '" << info.macroName <<
"'\n";
220 print(
os, level+1 ,
"- lineInfo" , info.lineInfo );
221 os <<
ws(level+1) <<
"- capturedExpression: '" << info.capturedExpression <<
"'\n"
222 <<
ws(level+1) <<
"- resultDisposition (flags): 0x" << std::hex << info.resultDisposition << std::dec <<
"\n";
236 os <<
ws(level ) << title <<
":\n"
237 <<
ws(level+1) <<
"- reconstructExpression(): '" << info.reconstructExpression() <<
"'\n"
238 <<
ws(level+1) <<
"- message: '" << info.message <<
"'\n"
239 <<
ws(level+1) <<
"- lazyExpression: '" <<
"(info.lazyExpression)" <<
"'\n"
240 <<
ws(level+1) <<
"- resultType: '" << info.resultType <<
"'\n";
262 os <<
ws(level ) << title <<
":\n"
263 <<
ws(level+1) <<
"- isOk(): " << info.isOk() <<
"\n"
264 <<
ws(level+1) <<
"- succeeded(): " << info.succeeded() <<
"\n"
265 <<
ws(level+1) <<
"- getResultType(): " << info.getResultType() <<
"\n"
266 <<
ws(level+1) <<
"- hasExpression(): " << info.hasExpression() <<
"\n"
267 <<
ws(level+1) <<
"- hasMessage(): " << info.hasMessage() <<
"\n"
268 <<
ws(level+1) <<
"- getExpression(): '" << info.getExpression() <<
"'\n"
269 <<
ws(level+1) <<
"- getExpressionInMacro(): '" << info.getExpressionInMacro() <<
"'\n"
270 <<
ws(level+1) <<
"- hasExpandedExpression(): " << info.hasExpandedExpression() <<
"\n"
271 <<
ws(level+1) <<
"- getExpandedExpression(): " << info.getExpandedExpression() <<
"'\n"
272 <<
ws(level+1) <<
"- getMessage(): '" << info.getMessage() <<
"'\n";
273 print(
os, level+1 ,
"- getSourceInfo(): ", info.getSourceInfo() );
274 os <<
ws(level+1) <<
"- getTestMacroName(): '" << info.getTestMacroName() <<
"'\n";
287 os <<
ws(level ) << title <<
":\n";
288 print(
os, level+1 ,
"- assertionResult", info.assertionResult );
289 print(
os, level+1 ,
"- infoMessages", info.infoMessages );
290 print(
os, level+1 ,
"- totals", info.totals );
298 "--------------------------------------------------------------------------";
302 using TestEventListenerBase::TestEventListenerBase;
311 <<
"\nEvent: testRunStarting:\n";
312 print( std::cout, 1,
"- testRunInfo", testRunInfo );
319 <<
"\nEvent: testRunEnded:\n";
320 print( std::cout, 1,
"- testRunStats", testRunStats );
327 <<
"\nEvent: skipTest:\n";
328 print( std::cout, 1,
"- testInfo", testInfo );
335 <<
"\nEvent: testCaseStarting:\n";
336 print( std::cout, 1,
"- testInfo", testInfo );
341 std::cout <<
"\nEvent: testCaseEnded:\n";
342 print( std::cout, 1,
"testCaseStats", testCaseStats );
347 std::cout <<
"\nEvent: sectionStarting:\n";
348 print( std::cout, 1,
"- sectionInfo", sectionInfo );
353 std::cout <<
"\nEvent: sectionEnded:\n";
354 print( std::cout, 1,
"- sectionStats", sectionStats );
359 std::cout <<
"\nEvent: assertionStarting:\n";
360 print( std::cout, 1,
"- assertionInfo", assertionInfo );
364 std::cout <<
"\nEvent: assertionEnded:\n";
365 print( std::cout, 1,
"- assertionStats", assertionStats );
383TEST_CASE(
"2: Testcase with sections",
"[tag-A][tag-B]" ) {
402 WARN(
"At end of test case");
void print(std::ostream &os, int const level, std::string const &title, Catch::SourceLineInfo const &info)
std::ostream & operator<<(std::ostream &os, std::vector< T > const &v)
std::string ws(int const level)
#define CATCH_REGISTER_LISTENER(listenerType)
#define TEST_CASE_METHOD(className,...)
void assertionStarting(Catch::AssertionInfo const &assertionInfo) override
void testRunEnded(Catch::TestRunStats const &testRunStats) override
void testRunStarting(Catch::TestRunInfo const &testRunInfo) override
void testCaseStarting(Catch::TestCaseInfo const &testInfo) override
void skipTest(Catch::TestCaseInfo const &testInfo) override
bool assertionEnded(Catch::AssertionStats const &assertionStats) override
void testCaseEnded(Catch::TestCaseStats const &testCaseStats) override
void sectionEnded(Catch::SectionStats const §ionStats) override
void sectionStarting(Catch::SectionInfo const §ionInfo) override