Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::TestCaseInfo Struct Reference

#include <catch_test_case_info.h>

Inheritance diagram for Catch::TestCaseInfo:
Collaboration diagram for Catch::TestCaseInfo:

Public Types

enum  SpecialProperties {
  None = 0 , IsHidden = 1 << 1 , ShouldFail = 1 << 2 , MayFail = 1 << 3 ,
  Throws = 1 << 4 , NonPortable = 1 << 5 , Benchmark = 1 << 6 , None = 0 ,
  IsHidden = 1 << 1 , ShouldFail = 1 << 2 , MayFail = 1 << 3 , Throws = 1 << 4 ,
  NonPortable = 1 << 5 , Benchmark = 1 << 6
}
 
enum  SpecialProperties {
  None = 0 , IsHidden = 1 << 1 , ShouldFail = 1 << 2 , MayFail = 1 << 3 ,
  Throws = 1 << 4 , NonPortable = 1 << 5 , Benchmark = 1 << 6 , None = 0 ,
  IsHidden = 1 << 1 , ShouldFail = 1 << 2 , MayFail = 1 << 3 , Throws = 1 << 4 ,
  NonPortable = 1 << 5 , Benchmark = 1 << 6
}
 

Public Member Functions

 TestCaseInfo (std::string const &_name, std::string const &_className, std::string const &_description, std::vector< std::string > const &_tags, SourceLineInfo const &_lineInfo)
 
bool isHidden () const
 
bool throws () const
 
bool okToFail () const
 
bool expectedToFail () const
 
std::string tagsAsString () const
 
 TestCaseInfo (std::string const &_name, std::string const &_className, std::string const &_description, std::vector< std::string > const &_tags, SourceLineInfo const &_lineInfo)
 
bool isHidden () const
 
bool throws () const
 
bool okToFail () const
 
bool expectedToFail () const
 
std::string tagsAsString () const
 

Public Attributes

std::string name
 
std::string className
 
std::string description
 
std::vector< std::string > tags
 
std::vector< std::string > lcaseTags
 
SourceLineInfo lineInfo
 
SpecialProperties properties
 

Friends

void setTags (TestCaseInfo &testCaseInfo, std::vector< std::string > tags)
 
void setTags (TestCaseInfo &testCaseInfo, std::vector< std::string > tags)
 

Detailed Description

Definition at line 4189 of file catch.hpp.

Member Enumeration Documentation

◆ SpecialProperties [1/2]

Enumerator
None 
IsHidden 
ShouldFail 
MayFail 
Throws 
NonPortable 
Benchmark 
None 
IsHidden 
ShouldFail 
MayFail 
Throws 
NonPortable 
Benchmark 

Definition at line 28 of file catch_test_case_info.h.

◆ SpecialProperties [2/2]

Enumerator
None 
IsHidden 
ShouldFail 
MayFail 
Throws 
NonPortable 
Benchmark 
None 
IsHidden 
ShouldFail 
MayFail 
Throws 
NonPortable 
Benchmark 

Definition at line 4190 of file catch.hpp.

4190 {
4191 None = 0,
4192 IsHidden = 1 << 1,
4193 ShouldFail = 1 << 2,
4194 MayFail = 1 << 3,
4195 Throws = 1 << 4,
4196 NonPortable = 1 << 5,
4197 Benchmark = 1 << 6
4198 };

Constructor & Destructor Documentation

◆ TestCaseInfo() [1/2]

Catch::TestCaseInfo::TestCaseInfo ( std::string const & _name,
std::string const & _className,
std::string const & _description,
std::vector< std::string > const & _tags,
SourceLineInfo const & _lineInfo )

Definition at line 113 of file catch_test_case_info.cpp.

118 : name( _name ),
119 className( _className ),
120 description( _description ),
121 lineInfo( _lineInfo ),
123 {
124 setTags( *this, _tags );
125 }
friend void setTags(TestCaseInfo &testCaseInfo, std::vector< std::string > tags)
SpecialProperties properties

◆ TestCaseInfo() [2/2]

Catch::TestCaseInfo::TestCaseInfo ( std::string const & _name,
std::string const & _className,
std::string const & _description,
std::vector< std::string > const & _tags,
SourceLineInfo const & _lineInfo )
Here is the call graph for this function:

Member Function Documentation

◆ expectedToFail() [1/2]

bool Catch::TestCaseInfo::expectedToFail ( ) const

Definition at line 136 of file catch_test_case_info.cpp.

136 {
137 return ( properties & (ShouldFail ) ) != 0;
138 }

◆ expectedToFail() [2/2]

bool Catch::TestCaseInfo::expectedToFail ( ) const

◆ isHidden() [1/2]

bool Catch::TestCaseInfo::isHidden ( ) const

Definition at line 127 of file catch_test_case_info.cpp.

127 {
128 return ( properties & IsHidden ) != 0;
129 }

◆ isHidden() [2/2]

bool Catch::TestCaseInfo::isHidden ( ) const

◆ okToFail() [1/2]

bool Catch::TestCaseInfo::okToFail ( ) const

Definition at line 133 of file catch_test_case_info.cpp.

133 {
134 return ( properties & (ShouldFail | MayFail ) ) != 0;
135 }
Here is the caller graph for this function:

◆ okToFail() [2/2]

bool Catch::TestCaseInfo::okToFail ( ) const

◆ tagsAsString() [1/2]

std::string Catch::TestCaseInfo::tagsAsString ( ) const

Definition at line 140 of file catch_test_case_info.cpp.

140 {
141 std::string ret;
142 // '[' and ']' per tag
143 std::size_t full_size = 2 * tags.size();
144 for (const auto& tag : tags) {
145 full_size += tag.size();
146 }
147 ret.reserve(full_size);
148 for (const auto& tag : tags) {
149 ret.push_back('[');
150 ret.append(tag);
151 ret.push_back(']');
152 }
153
154 return ret;
155 }
std::vector< std::string > tags
CK_RV ret
Here is the caller graph for this function:

◆ tagsAsString() [2/2]

std::string Catch::TestCaseInfo::tagsAsString ( ) const

◆ throws() [1/2]

bool Catch::TestCaseInfo::throws ( ) const

Definition at line 130 of file catch_test_case_info.cpp.

130 {
131 return ( properties & Throws ) != 0;
132 }
Here is the caller graph for this function:

◆ throws() [2/2]

bool Catch::TestCaseInfo::throws ( ) const

Friends And Related Symbol Documentation

◆ setTags [1/2]

void setTags ( TestCaseInfo & testCaseInfo,
std::vector< std::string > tags )
friend

Definition at line 100 of file catch_test_case_info.cpp.

100 {
101 std::sort(begin(tags), end(tags));
102 tags.erase(std::unique(begin(tags), end(tags)), end(tags));
103 testCaseInfo.lcaseTags.clear();
104
105 for( auto const& tag : tags ) {
106 std::string lcaseTag = toLower( tag );
107 testCaseInfo.properties = static_cast<TestCaseInfo::SpecialProperties>( testCaseInfo.properties | parseSpecialTag( lcaseTag ) );
108 testCaseInfo.lcaseTags.push_back( lcaseTag );
109 }
110 testCaseInfo.tags = std::move(tags);
111 }
std::string toLower(std::string const &s)
not_this_one end(...)
not_this_one begin(...)

◆ setTags [2/2]

void setTags ( TestCaseInfo & testCaseInfo,
std::vector< std::string > tags )
friend

Definition at line 100 of file catch_test_case_info.cpp.

100 {
101 std::sort(begin(tags), end(tags));
102 tags.erase(std::unique(begin(tags), end(tags)), end(tags));
103 testCaseInfo.lcaseTags.clear();
104
105 for( auto const& tag : tags ) {
106 std::string lcaseTag = toLower( tag );
107 testCaseInfo.properties = static_cast<TestCaseInfo::SpecialProperties>( testCaseInfo.properties | parseSpecialTag( lcaseTag ) );
108 testCaseInfo.lcaseTags.push_back( lcaseTag );
109 }
110 testCaseInfo.tags = std::move(tags);
111 }

Member Data Documentation

◆ className

std::string Catch::TestCaseInfo::className

Definition at line 54 of file catch_test_case_info.h.

◆ description

std::string Catch::TestCaseInfo::description

Definition at line 55 of file catch_test_case_info.h.

◆ lcaseTags

std::vector< std::string > Catch::TestCaseInfo::lcaseTags

Definition at line 57 of file catch_test_case_info.h.

◆ lineInfo

SourceLineInfo Catch::TestCaseInfo::lineInfo

Definition at line 58 of file catch_test_case_info.h.

◆ name

std::string Catch::TestCaseInfo::name

Definition at line 53 of file catch_test_case_info.h.

◆ properties

SpecialProperties Catch::TestCaseInfo::properties

Definition at line 59 of file catch_test_case_info.h.

◆ tags

std::vector< std::string > Catch::TestCaseInfo::tags

Definition at line 56 of file catch_test_case_info.h.


The documentation for this struct was generated from the following files: