22 auto it = m_registry.find( alias );
23 if( it != m_registry.end() )
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() );
39 return expandedTestSpec;
44 "error: tag alias, '" << alias <<
"' is not of the form [@alias name].\n" << lineInfo );
47 "error: tag alias, '" << alias <<
"' already registered.\n"
48 <<
"\tFirst seen at: " <<
find(alias)->lineInfo <<
"\n"
49 <<
"\tRedefined at: " << lineInfo );
#define CATCH_ENFORCE(condition, msg)
void add(std::string const &alias, std::string const &tag, SourceLineInfo const &lineInfo)
TagAlias const * find(std::string const &alias) const override
std::string expandAliases(std::string const &unexpandedTestSpec) const override
~TagAliasRegistry() override
IRegistryHub const & getRegistryHub()
bool startsWith(std::string const &s, std::string const &prefix)
bool endsWith(std::string const &s, std::string const &suffix)
virtual ITagAliasRegistry const & getTagAliasRegistry() const =0
virtual ~ITagAliasRegistry()
static ITagAliasRegistry const & get()