Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
207-Rpt-TeamCityReporter.cpp File Reference
#include <catch2/catch.hpp>
Include dependency graph for 207-Rpt-TeamCityReporter.cpp:

Go to the source code of this file.

Classes

struct  MyException
 
struct  MyExceptionMatcher
 

Functions

 TEST_CASE ("TeamCity passes unconditionally succeeding assertion", "[teamcity]")
 
 TEST_CASE ("TeamCity reports unconditionally failing assertion", "[teamcity]")
 
 TEST_CASE ("TeamCity reports failing check", "[teamcity]")
 
 TEST_CASE ("TeamCity reports failing check-false", "[teamcity]")
 
 TEST_CASE ("TeamCity reports failing check-that", "[teamcity]")
 
 TEST_CASE ("TeamCity reports unexpected exception", "[teamcity]")
 
 TEST_CASE ("TeamCity reports undesired exception", "[teamcity]")
 
 TEST_CASE ("TeamCity reports missing expected exception", "[teamcity]")
 
 TEST_CASE ("TeamCity reports missing specific expected exception", "[teamcity]")
 
 TEST_CASE ("TeamCity reports unexpected message in expected exception", "[teamcity]")
 
 TEST_CASE ("TeamCity failing check-throws-matches", "[teamcity]")
 
 TEST_CASE ("TeamCity throwing exception with tag [!throws]", "[teamcity][!throws]")
 
 TEST_CASE ("TeamCity failing assertion with tag [!mayfail]", "[teamcity][!mayfail] ")
 
 TEST_CASE ("TeamCity succeeding assertion with tag [!shouldfail]", "[teamcity][!shouldfail]")
 

Function Documentation

◆ TEST_CASE() [1/14]

TEST_CASE ( "TeamCity failing assertion with tag " [!mayfail],
" " [teamcity][!mayfail] )

Definition at line 129 of file 207-Rpt-TeamCityReporter.cpp.

129 {
130
131 REQUIRE( 3 == 7 ); // doesn't fail test case this time, reports: testIgnored
132 REQUIRE( 3 == 3 );
133}
#define REQUIRE(...)
Definition catch.hpp:185

◆ TEST_CASE() [2/14]

TEST_CASE ( "TeamCity failing check-throws-matches" ,
"" [teamcity] )

Definition at line 112 of file 207-Rpt-TeamCityReporter.cpp.

112 {
113
115}
#define CHECK_THROWS_MATCHES(expr, exceptionType, matcher)
Definition catch.hpp:206

◆ TEST_CASE() [3/14]

TEST_CASE ( "TeamCity passes unconditionally succeeding assertion" ,
"" [teamcity] )

Definition at line 22 of file 207-Rpt-TeamCityReporter.cpp.

22 {
23
24 SUCCEED();
25}
#define SUCCEED()
Definition gtest.h:1867

◆ TEST_CASE() [4/14]

TEST_CASE ( "TeamCity reports failing check" ,
"" [teamcity] )

Definition at line 32 of file 207-Rpt-TeamCityReporter.cpp.

32 {
33
34 REQUIRE( 3 == 7 );
35}

◆ TEST_CASE() [5/14]

TEST_CASE ( "TeamCity reports failing check-false" ,
"" [teamcity] )

Definition at line 37 of file 207-Rpt-TeamCityReporter.cpp.

37 {
38
39 REQUIRE_FALSE( 3 == 3 );
40}
#define REQUIRE_FALSE(...)
Definition catch.hpp:186

◆ TEST_CASE() [6/14]

TEST_CASE ( "TeamCity reports failing check-that" ,
"" [teamcity] )

Definition at line 42 of file 207-Rpt-TeamCityReporter.cpp.

42 {
43
44 using namespace Catch;
45
46 REQUIRE_THAT( "hello", Contains( "world" ) );
47}
#define REQUIRE_THAT(arg, matcher)
Definition catch.hpp:214

◆ TEST_CASE() [7/14]

TEST_CASE ( "TeamCity reports missing expected exception" ,
"" [teamcity] )

Definition at line 59 of file 207-Rpt-TeamCityReporter.cpp.

59 {
60
61 REQUIRE_THROWS( true );
62}
#define REQUIRE_THROWS(...)
Definition catch.hpp:188

◆ TEST_CASE() [8/14]

TEST_CASE ( "TeamCity reports missing specific expected exception" ,
"" [teamcity] )

Definition at line 64 of file 207-Rpt-TeamCityReporter.cpp.

64 {
65
66 REQUIRE_THROWS_AS( throw std::bad_alloc(), std::runtime_error );
67}
#define REQUIRE_THROWS_AS(expr, exceptionType)
Definition catch.hpp:189

◆ TEST_CASE() [9/14]

TEST_CASE ( "TeamCity reports unconditionally failing assertion" ,
"" [teamcity] )

Definition at line 27 of file 207-Rpt-TeamCityReporter.cpp.

27 {
28
29 FAIL();
30}
#define FAIL()
Definition gtest.h:1858

◆ TEST_CASE() [10/14]

TEST_CASE ( "TeamCity reports undesired exception" ,
"" [teamcity] )

Definition at line 54 of file 207-Rpt-TeamCityReporter.cpp.

54 {
55
56 REQUIRE_NOTHROW( (throw std::runtime_error("surprise!"), true) );
57}
#define REQUIRE_NOTHROW(...)
Definition catch.hpp:194

◆ TEST_CASE() [11/14]

TEST_CASE ( "TeamCity reports unexpected exception" ,
"" [teamcity] )

Definition at line 49 of file 207-Rpt-TeamCityReporter.cpp.

49 {
50
51 REQUIRE( (throw std::runtime_error("surprise!"), true) );
52}

◆ TEST_CASE() [12/14]

TEST_CASE ( "TeamCity reports unexpected message in expected exception" ,
"" [teamcity] )

Definition at line 69 of file 207-Rpt-TeamCityReporter.cpp.

69 {
70
71 using namespace Catch;
72
73 CHECK_THROWS_WITH( throw std::runtime_error("hello"), "world" );
74 CHECK_THROWS_WITH( throw std::runtime_error("hello"), Contains("world") );
75}
#define CHECK_THROWS_WITH(expr, matcher)
Definition catch.hpp:204

◆ TEST_CASE() [13/14]

TEST_CASE ( "TeamCity succeeding assertion with tag " [!shouldfail],
"" [teamcity][!shouldfail] )

Definition at line 138 of file 207-Rpt-TeamCityReporter.cpp.

138 {
139
140 SUCCEED( "Marked [!shouldfail]" );
141}

◆ TEST_CASE() [14/14]

TEST_CASE ( "TeamCity throwing exception with tag " [!throws],
"" [teamcity][!throws] )

Definition at line 122 of file 207-Rpt-TeamCityReporter.cpp.

122 {
123
124 REQUIRE_THROWS( throw std::runtime_error("unsurprisingly") );
125}