virtual void write( const BenchmarkSuite& benchmark_suite, const IBenchmarkCase& benchmark_case, const char* file, const size_t line, const char* message) { print_suite_name(benchmark_suite); // Print the message header. LOG_ERROR( m_logger, "while benchmarking %s::%s: error in %s at line " FMT_SIZE_T ":", benchmark_suite.get_name(), benchmark_case.get_name(), file, line); // Split the message into multiple components, one for each line. vector<string> tokens; split(message, "\n", tokens); // Print the message. for (const_each<vector<string> > i = tokens; i; ++i) LOG_ERROR(m_logger, " %s\n", i->c_str()); }
virtual void write( const BenchmarkSuite& benchmark_suite, const IBenchmarkCase& benchmark_case, const char* file, const size_t line, const TimingResult& timing_result) { string callrate_string; if (timing_result.m_ticks > 0.0) { const double freq_mhz = timing_result.m_frequency * 1.0e-6; callrate_string = "(" + pretty_callrate(timing_result, 3) + " at " + pretty_scalar(freq_mhz, 3) + " MHz)"; } print_suite_name(benchmark_suite); LOG_INFO( m_logger, " %s: %s %s %s", benchmark_case.get_name(), timing_result.m_ticks >= 1000.0 ? pretty_uint(static_cast<uint64>(timing_result.m_ticks)).c_str() : pretty_scalar(timing_result.m_ticks).c_str(), plural(timing_result.m_ticks, "clock tick").c_str(), callrate_string.c_str()); }
void XMLFileBenchmarkListener::begin_case( const BenchmarkSuite& benchmark_suite, const IBenchmarkCase& benchmark_case) { fprintf( impl->m_file, "%s<benchmarkcase name=\"%s\">\n", impl->m_indenter.c_str(), benchmark_case.get_name()); ++impl->m_indenter; }