diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-07-22 16:18:34 -0600 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-07-22 16:18:34 -0600 |
commit | 440df36e7a3b69ff46bead20b1b30ac7e0c811e2 (patch) | |
tree | b165614e9f4ca117b7022c985c364121c2099b0b /test | |
parent | 1bd62bd0becbb692c7088f331c876ca3aeff4c65 (diff) | |
download | google-benchmark-440df36e7a3b69ff46bead20b1b30ac7e0c811e2.tar.gz |
Improve failure mode in complexity_test.cc
Diffstat (limited to 'test')
-rw-r--r-- | test/complexity_test.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/complexity_test.cc b/test/complexity_test.cc index 8ab88f9..6051f84 100644 --- a/test/complexity_test.cc +++ b/test/complexity_test.cc @@ -36,18 +36,27 @@ struct TestCase { CHECK(err_str.empty()) << "Could not construct regex \"" << regex << "\"" << " got Error: " << err_str; + std::string near = "<EOF>"; std::string line; + bool first = true; while (remaining_output.eof() == false) { CHECK(remaining_output.good()); std::getline(remaining_output, line); + // Keep the first line as context. + if (first) { + near = line; + first = false; + } if (r.Match(line)) return; CHECK(match_rule != MR_Next) << "Expected line \"" << line - << "\" to match regex \"" << regex << "\""; + << "\" to match regex \"" << regex << "\"" + << "\nstarted matching at line: \"" << near << "\""; } CHECK(remaining_output.eof() == false) << "End of output reached before match for regex \"" << regex - << "\" was found"; + << "\" was found" + << "\nstarted matching at line: \"" << near << "\""; } }; |