#include <catch_tag_alias_registry.h>
Definition at line 18 of file catch_tag_alias_registry.h.
◆ ~TagAliasRegistry()
Catch::TagAliasRegistry::~TagAliasRegistry |
( |
| ) |
|
|
override |
◆ add()
void Catch::TagAliasRegistry::add |
( |
std::string const & | alias, |
|
|
std::string const & | tag, |
|
|
SourceLineInfo const & | lineInfo ) |
Definition at line 42 of file catch_tag_alias_registry.cpp.
42 {
44 "error: tag alias, '" << alias << "' is not of the form [@alias name].\n" << lineInfo );
45
46 CATCH_ENFORCE( m_registry.insert(std::make_pair(alias, TagAlias(tag, lineInfo))).second,
47 "error: tag alias, '" << alias << "' already registered.\n"
48 <<
"\tFirst seen at: " <<
find(alias)->lineInfo <<
"\n"
49 << "\tRedefined at: " << lineInfo );
50 }
#define CATCH_ENFORCE(condition, msg)
TagAlias const * find(std::string const &alias) const override
bool startsWith(std::string const &s, std::string const &prefix)
bool endsWith(std::string const &s, std::string const &suffix)
◆ expandAliases()
std::string Catch::TagAliasRegistry::expandAliases |
( |
std::string const & | unexpandedTestSpec | ) |
const |
|
overridevirtual |
Implements Catch::ITagAliasRegistry.
Definition at line 29 of file catch_tag_alias_registry.cpp.
29 {
30 std::string expandedTestSpec = unexpandedTestSpec;
31 for( auto const& registryKvp : m_registry ) {
32 std::size_t pos = expandedTestSpec.find( registryKvp.first );
33 if( pos != std::string::npos ) {
34 expandedTestSpec = expandedTestSpec.substr( 0, pos ) +
35 registryKvp.second.tag +
36 expandedTestSpec.substr( pos + registryKvp.first.size() );
37 }
38 }
39 return expandedTestSpec;
40 }
◆ find()
TagAlias const * Catch::TagAliasRegistry::find |
( |
std::string const & | alias | ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files: