Commit aaa25ac3 by Eric Fiselier

Improve diagnostic output for output tests.

parent 0ed44560
...@@ -70,13 +70,17 @@ void CheckCase(std::stringstream& remaining_output, TestCase const& TC, ...@@ -70,13 +70,17 @@ void CheckCase(std::stringstream& remaining_output, TestCase const& TC,
on_first = false; on_first = false;
} }
for (auto& NC : not_checks) { for (auto& NC : not_checks) {
CHECK(!NC.regex->Match(line)) << "Unexpected match for line \"" CHECK(!NC.regex->Match(line))
<< line << "\" for MR_Not regex \"" << "Unexpected match for line \"" << line
<< NC.regex_str << "\""; << "\" for MR_Not regex \"" << NC.regex_str << "\""
<< "\n actual regex string \"" << TC.substituted_regex << "\""
<< "\n started matching near: " << first_line;
} }
if (TC.regex->Match(line)) return; if (TC.regex->Match(line)) return;
CHECK(TC.match_rule != MR_Next) << "Expected line \"" << line CHECK(TC.match_rule != MR_Next)
<< "\" to match regex \"" << TC.regex_str << "\""; << "Expected line \"" << line << "\" to match regex \"" << TC.regex_str << "\""
<< "\n actual regex string \"" << TC.substituted_regex << "\""
<< "\n started matching near: " << first_line;
} }
CHECK(remaining_output.eof() == false) CHECK(remaining_output.eof() == false)
<< "End of output reached before match for regex \"" << TC.regex_str << "End of output reached before match for regex \"" << TC.regex_str
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment