46 m_regex =
"^(test.*) \\(.*\\) ... (ERROR|FAIL|ok).*";
52 TiXmlElement *
func = metric->FirstChildElement(
"function");
54 "Missing function tag for Python unittest metric!");
59 "Missing function name in Python unittest metric.");
63 std::vector<MetricRegexFieldValue> tmp(2);
69 func =
func->NextSiblingElement(
"function");
82 for (
int i = 0; i <
m_matches.size(); ++i)
85 "Wrong number of matches for regular expression.");
87 "Test " +
m_matches[i][0].m_value +
" has failed");
89 TiXmlElement *
func =
new TiXmlElement(
"function");
#define ASSERTL0(condition, msg)
std::string RegisterCreatorFunction(std::string key, CreatorFunction func)
TiXmlElement * m_metric
Pointer to XML structure containing metric definition.
bool m_generate
Determines whether to generate this metric or not.
MetricPyUnitTest(TiXmlElement *metric, bool generate)
void v_Generate(std::istream &pStdout, std::istream &pStderr) override
Virtual function to generate the metric. Should be redefined in derived classes.
static MetricSharedPtr create(TiXmlElement *metric, bool generate)
void v_Generate(std::istream &pStdout, std::istream &pStderr) override
Test output against a regex expression and set of matches.
std::vector< std::vector< MetricRegexFieldValue > > m_matches
Stores the multiple matches defined in each <MATCH> tag.
bool m_useStderr
If true, use stderr for testing/generation instead of stdout.
std::regex m_regex
Storage for the boost regex.
bool EmptyString(const char *s)
Check to see whether the given string s is empty (or null).
MetricFactory & GetMetricFactory()
Data structure for a Regex value to match.