| 14788 | } |
| 14789 | |
| 14790 | void TestSpecParser::addTagPattern() { |
| 14791 | auto token = preprocessPattern(); |
| 14792 | |
| 14793 | if (!token.empty()) { |
| 14794 | // If the tag pattern is the "hide and tag" shorthand (e.g. [.foo]) |
| 14795 | // we have to create a separate hide tag and shorten the real one |
| 14796 | if (token.size() > 1 && token[0] == '.') { |
| 14797 | token.erase(token.begin()); |
| 14798 | TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(".", m_substring); |
| 14799 | if (m_exclusion) { |
| 14800 | pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern); |
| 14801 | } |
| 14802 | m_currentFilter.m_patterns.push_back(pattern); |
| 14803 | } |
| 14804 | |
| 14805 | TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(token, m_substring); |
| 14806 | |
| 14807 | if (m_exclusion) { |
| 14808 | pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern); |
| 14809 | } |
| 14810 | m_currentFilter.m_patterns.push_back(pattern); |
| 14811 | } |
| 14812 | m_substring.clear(); |
| 14813 | m_exclusion = false; |
| 14814 | m_mode = None; |
| 14815 | } |
| 14816 | |
| 14817 | TestSpec parseTestSpec( std::string const& arg ) { |
| 14818 | return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec(); |