From 25e46848f9d584261d5960ce9394a565f58aa070 Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Tue, 31 Mar 2015 14:40:46 -0400 Subject: [PATCH] Clarify build type warning --- src/console_reporter.cc | 13 +++++-------- src/csv_reporter.cc | 3 ++- src/json_reporter.cc | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/console_reporter.cc b/src/console_reporter.cc index 7a99dfb4..7faed20b 100644 --- a/src/console_reporter.cc +++ b/src/console_reporter.cc @@ -41,16 +41,13 @@ bool ConsoleReporter::ReportContext(const Context& context) { } #ifndef NDEBUG - std::cerr << "Build Type: DEBUG\n"; + std::cerr << "***WARNING*** Library was built as DEBUG. Timings may be " + "affected.\n"; #endif - int output_width = - fprintf(stdout, - "%-*s %10s %10s %10s\n", - static_cast(name_field_width_), - "Benchmark", - "Time(ns)", "CPU(ns)", - "Iterations"); + int output_width = fprintf(stdout, "%-*s %10s %10s %10s\n", + static_cast(name_field_width_), "Benchmark", + "Time(ns)", "CPU(ns)", "Iterations"); std::cout << std::string(output_width - 1, '-') << "\n"; return true; diff --git a/src/csv_reporter.cc b/src/csv_reporter.cc index 4d4e5694..a5e89370 100644 --- a/src/csv_reporter.cc +++ b/src/csv_reporter.cc @@ -39,7 +39,8 @@ bool CSVReporter::ReportContext(const Context& context) { } #ifndef NDEBUG - std::cerr << "Build Type: DEBUG\n"; + std::cerr << "***WARNING*** Library was built as DEBUG. Timings may be " + "affected.\n"; #endif std::cout << "name,iterations,real_time,cpu_time,bytes_per_second," "items_per_second,label\n"; diff --git a/src/json_reporter.cc b/src/json_reporter.cc index c8165970..961e3d17 100644 --- a/src/json_reporter.cc +++ b/src/json_reporter.cc @@ -84,7 +84,7 @@ bool JSONReporter::ReportContext(const Context& context) { #else const char build_type[] = "debug"; #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. out << inner_indent << "},\n"; out << inner_indent << "\"benchmarks\": [\n"; @@ -162,4 +162,4 @@ void JSONReporter::PrintRunData(Run const& run) { out << '\n'; } -} // end namespace benchmark \ No newline at end of file +} // end namespace benchmark