21 virtual void ReportRuns(
const std::vector<Run>& report) {
26 TestReporter() : count_(0) {}
28 virtual ~TestReporter() {}
30 size_t GetCount()
const {
return count_; }
33 mutable size_t count_;
68 int main(
int argc,
char **argv) {
69 bool list_only =
false;
70 for (
int i = 0;
i < argc; ++
i)
71 list_only |=
std::string(argv[
i]).find(
"--benchmark_list_tests") !=
76 TestReporter test_reporter;
77 const size_t returned_count =
82 std::stringstream ss(argv[1]);
83 size_t expected_return;
84 ss >> expected_return;
86 if (returned_count != expected_return) {
87 std::cerr <<
"ERROR: Expected " << expected_return
88 <<
" tests to match the filter but returned_count = "
89 << returned_count << std::endl;
93 const size_t expected_reports = list_only ? 0 : expected_return;
94 const size_t reports_count = test_reporter.GetCount();
95 if (reports_count != expected_reports) {
96 std::cerr <<
"ERROR: Expected " << expected_reports
97 <<
" tests to be run but reported_count = " << reports_count