MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / GetOutputOptions

Function GetOutputOptions

deps/google-benchmark/src/benchmark.cc:430–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color) {
431 int output_opts = ConsoleReporter::OO_Defaults;
432 auto is_benchmark_color = [force_no_color]() -> bool {
433 if (force_no_color) {
434 return false;
435 }
436 if (FLAGS_benchmark_color == "auto") {
437 return IsColorTerminal();
438 }
439 return IsTruthyFlagValue(FLAGS_benchmark_color);
440 };
441 if (is_benchmark_color()) {
442 output_opts |= ConsoleReporter::OO_Color;
443 } else {
444 output_opts &= ~ConsoleReporter::OO_Color;
445 }
446 if (FLAGS_benchmark_counters_tabular) {
447 output_opts |= ConsoleReporter::OO_Tabular;
448 } else {
449 output_opts &= ~ConsoleReporter::OO_Tabular;
450 }
451 return static_cast<ConsoleReporter::OutputOptions>(output_opts);
452}
453
454} // end namespace internal
455

Callers 2

RunOutputTestsFunction · 0.85

Calls 2

IsColorTerminalFunction · 0.85
IsTruthyFlagValueFunction · 0.85

Tested by 1

RunOutputTestsFunction · 0.68