| 14901 | } |
| 14902 | |
| 14903 | void TestSpecParser::addTagPattern() { |
| 14904 | auto token = preprocessPattern(); |
| 14905 | |
| 14906 | if (!token.empty()) { |
| 14907 | // If the tag pattern is the "hide and tag" shorthand (e.g. [.foo]) |
| 14908 | // we have to create a separate hide tag and shorten the real one |
| 14909 | if (token.size() > 1 && token[0] == '.') { |
| 14910 | token.erase(token.begin()); |
| 14911 | TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(".", m_substring); |
| 14912 | if (m_exclusion) { |
| 14913 | pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern); |
| 14914 | } |
| 14915 | m_currentFilter.m_patterns.push_back(pattern); |
| 14916 | } |
| 14917 | |
| 14918 | TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(token, m_substring); |
| 14919 | |
| 14920 | if (m_exclusion) { |
| 14921 | pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern); |
| 14922 | } |
| 14923 | m_currentFilter.m_patterns.push_back(pattern); |
| 14924 | } |
| 14925 | m_substring.clear(); |
| 14926 | m_exclusion = false; |
| 14927 | m_mode = None; |
| 14928 | } |
| 14929 | |
| 14930 | TestSpec parseTestSpec( std::string const& arg ) { |
| 14931 | return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec(); |