Commit 66747446 by Dominic Hamon

Merge pull request #111 from google/buildtype_log

Clarify build type warning
parents 006d23cc 25e46848
...@@ -41,16 +41,13 @@ bool ConsoleReporter::ReportContext(const Context& context) { ...@@ -41,16 +41,13 @@ bool ConsoleReporter::ReportContext(const Context& context) {
} }
#ifndef NDEBUG #ifndef NDEBUG
std::cerr << "Build Type: DEBUG\n"; std::cerr << "***WARNING*** Library was built as DEBUG. Timings may be "
"affected.\n";
#endif #endif
int output_width = int output_width = fprintf(stdout, "%-*s %10s %10s %10s\n",
fprintf(stdout, static_cast<int>(name_field_width_), "Benchmark",
"%-*s %10s %10s %10s\n", "Time(ns)", "CPU(ns)", "Iterations");
static_cast<int>(name_field_width_),
"Benchmark",
"Time(ns)", "CPU(ns)",
"Iterations");
std::cout << std::string(output_width - 1, '-') << "\n"; std::cout << std::string(output_width - 1, '-') << "\n";
return true; return true;
......
...@@ -39,7 +39,8 @@ bool CSVReporter::ReportContext(const Context& context) { ...@@ -39,7 +39,8 @@ bool CSVReporter::ReportContext(const Context& context) {
} }
#ifndef NDEBUG #ifndef NDEBUG
std::cerr << "Build Type: DEBUG\n"; std::cerr << "***WARNING*** Library was built as DEBUG. Timings may be "
"affected.\n";
#endif #endif
std::cout << "name,iterations,real_time,cpu_time,bytes_per_second," std::cout << "name,iterations,real_time,cpu_time,bytes_per_second,"
"items_per_second,label\n"; "items_per_second,label\n";
......
...@@ -84,7 +84,7 @@ bool JSONReporter::ReportContext(const Context& context) { ...@@ -84,7 +84,7 @@ bool JSONReporter::ReportContext(const Context& context) {
#else #else
const char build_type[] = "debug"; const char build_type[] = "debug";
#endif #endif
out << indent << FormatKV("build_type", build_type) << "\n"; out << indent << FormatKV("library_build_type", build_type) << "\n";
// Close context block and open the list of benchmarks. // Close context block and open the list of benchmarks.
out << inner_indent << "},\n"; out << inner_indent << "},\n";
out << inner_indent << "\"benchmarks\": [\n"; out << inner_indent << "\"benchmarks\": [\n";
...@@ -162,4 +162,4 @@ void JSONReporter::PrintRunData(Run const& run) { ...@@ -162,4 +162,4 @@ void JSONReporter::PrintRunData(Run const& run) {
out << '\n'; out << '\n';
} }
} // end namespace benchmark } // end namespace benchmark
\ No newline at end of file
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