Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
210-Evt-EventListeners.cpp File Reference
#include <catch2/catch.hpp>
#include <iostream>
Include dependency graph for 210-Evt-EventListeners.cpp:

Go to the source code of this file.

Classes

struct  MyListener
 
struct  Fixture
 

Macros

#define CATCH_CONFIG_EXTERNAL_INTERFACES
 

Functions

std::string ws (int const level)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, std::vector< T > const &v)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::SourceLineInfo const &info)
 
void print (std::ostream &os, int const level, Catch::MessageInfo const &info)
 
void print (std::ostream &os, int const level, std::string const &title, std::vector< Catch::MessageInfo > const &v)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::TestRunInfo const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::Counts const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::Totals const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::TestRunStats const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::TestCaseInfo const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::TestCaseStats const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::SectionInfo const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::SectionStats const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::AssertionInfo const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::AssertionResultData const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::AssertionResult const &info)
 
void print (std::ostream &os, int const level, std::string const &title, Catch::AssertionStats const &info)
 
 TEST_CASE ("1: Hidden testcase", "[.hidden]")
 
 TEST_CASE ("2: Testcase with sections", "[tag-A][tag-B]")
 
 TEST_CASE_METHOD (Fixture, "3: Testcase with class-based fixture", "[tag-C][tag-D]")
 

Variables

char const * dashed_line
 

Macro Definition Documentation

◆ CATCH_CONFIG_EXTERNAL_INTERFACES

#define CATCH_CONFIG_EXTERNAL_INTERFACES

Definition at line 11 of file 210-Evt-EventListeners.cpp.

Function Documentation

◆ operator<<()

template<typename T >
std::ostream & operator<< ( std::ostream & os,
std::vector< T > const & v )

Definition at line 25 of file 210-Evt-EventListeners.cpp.

25 {
26 os << "{ ";
27 for ( auto x : v )
28 os << x << ", ";
29 return os << "}";
30}
os_t os

◆ print() [1/15]

void print ( std::ostream & os,
int const level,
Catch::MessageInfo const & info )

Definition at line 51 of file 210-Evt-EventListeners.cpp.

51 {
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";
56}
void print(std::ostream &os, int const level, std::string const &title, Catch::SourceLineInfo const &info)
std::string ws(int const level)
Here is the call graph for this function:

◆ print() [2/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::AssertionInfo const & info )

Definition at line 217 of file 210-Evt-EventListeners.cpp.

217 {
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";
223}
Here is the call graph for this function:

◆ print() [3/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::AssertionResult const & info )

Definition at line 261 of file 210-Evt-EventListeners.cpp.

261 {
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";
275
276// print( os, level+1 , "- *** m_info (AssertionInfo)", info.m_info );
277// print( os, level+1 , "- *** m_resultData (AssertionResultData)", info.m_resultData );
278}
Here is the call graph for this function:

◆ print() [4/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::AssertionResultData const & info )

Definition at line 235 of file 210-Evt-EventListeners.cpp.

235 {
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";
241}
Here is the call graph for this function:

◆ print() [5/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::AssertionStats const & info )

Definition at line 286 of file 210-Evt-EventListeners.cpp.

286 {
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 );
291}
Here is the call graph for this function:

◆ print() [6/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::Counts const & info )

Definition at line 88 of file 210-Evt-EventListeners.cpp.

88 {
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";
96}
Here is the call graph for this function:

◆ print() [7/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::SectionInfo const & info )

Definition at line 188 of file 210-Evt-EventListeners.cpp.

188 {
189 os << ws(level ) << title << ":\n"
190 << ws(level+1) << "- name: " << info.name << "\n";
191 print( os, level+1 , "- lineInfo", info.lineInfo );
192}
Here is the call graph for this function:

◆ print() [8/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::SectionStats const & info )

Definition at line 201 of file 210-Evt-EventListeners.cpp.

201 {
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";
207}
Here is the call graph for this function:

◆ print() [9/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::SourceLineInfo const & info )

Definition at line 37 of file 210-Evt-EventListeners.cpp.

37 {
38 os << ws(level ) << title << ":\n"
39 << ws(level+1) << "- file: " << info.file << "\n"
40 << ws(level+1) << "- line: " << info.line << "\n";
41}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [10/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::TestCaseInfo const & info )

Definition at line 149 of file 210-Evt-EventListeners.cpp.

149 {
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";
163}
Here is the call graph for this function:

◆ print() [11/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::TestCaseStats const & info )

Definition at line 173 of file 210-Evt-EventListeners.cpp.

173 {
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";
180}
Here is the call graph for this function:

◆ print() [12/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::TestRunInfo const & info )

Definition at line 73 of file 210-Evt-EventListeners.cpp.

73 {
74 os << ws(level ) << title << ":\n"
75 << ws(level+1) << "- name: " << info.name << "\n";
76}
Here is the call graph for this function:

◆ print() [13/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::TestRunStats const & info )

Definition at line 115 of file 210-Evt-EventListeners.cpp.

115 {
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";
120}
Here is the call graph for this function:

◆ print() [14/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
Catch::Totals const & info )

Definition at line 103 of file 210-Evt-EventListeners.cpp.

103 {
104 os << ws(level) << title << ":\n";
105 print( os, level+1, "- assertions", info.assertions );
106 print( os, level+1, "- testCases" , info.testCases );
107}
Here is the call graph for this function:

◆ print() [15/15]

void print ( std::ostream & os,
int const level,
std::string const & title,
std::vector< Catch::MessageInfo > const & v )

Definition at line 58 of file 210-Evt-EventListeners.cpp.

58 {
59 os << ws(level ) << title << ":\n";
60 for ( auto x : v )
61 {
62 os << ws(level+1) << "{\n";
63 print( os, level+2, x );
64 os << ws(level+1) << "}\n";
65 }
66// os << ws(level+1) << "\n";
67}
Here is the call graph for this function:

◆ TEST_CASE() [1/2]

TEST_CASE ( "1: Hidden testcase" ,
"" [.hidden] )

Definition at line 380 of file 210-Evt-EventListeners.cpp.

380 : Hidden testcase", "[.hidden]" ) {
381}

◆ TEST_CASE() [2/2]

TEST_CASE ( "2: Testcase with sections" ,
"" [tag-A][tag-B] )

Definition at line 383 of file 210-Evt-EventListeners.cpp.

383 : Testcase with sections", "[tag-A][tag-B]" ) {
384
385 int i = 42;
386
387 REQUIRE( i == 42 );
388
389 SECTION("Section 1") {
390 INFO("Section 1");
391 i = 7;
392 SECTION("Section 1.1") {
393 INFO("Section 1.1");
394 REQUIRE( i == 42 );
395 }
396 }
397
398 SECTION("Section 2") {
399 INFO("Section 2");
400 REQUIRE( i == 42 );
401 }
402 WARN("At end of test case");
403}
@ test
Unit testing utility error code.
Definition error.hpp:96
#define A

◆ TEST_CASE_METHOD()

TEST_CASE_METHOD ( Fixture ,
"3: Testcase with class-based fixture" ,
"" [tag-C][tag-D] )

Definition at line 411 of file 210-Evt-EventListeners.cpp.

411 : Testcase with class-based fixture", "[tag-C][tag-D]" ) {
412 REQUIRE( fortytwo() == 42 );
413}
#define D(var, file, col, who, lev,...)
Definition debug.h:44

◆ ws()

std::string ws ( int const level)

Definition at line 20 of file 210-Evt-EventListeners.cpp.

20 {
21 return std::string( 2 * level, ' ' );
22}
Here is the caller graph for this function:

Variable Documentation

◆ dashed_line

char const* dashed_line
Initial value:
=
"--------------------------------------------------------------------------"

Definition at line 297 of file 210-Evt-EventListeners.cpp.