-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
According to the documentation
Write benchmark results to a file with the --benchmark_out= option (or set BENCHMARK_OUT). Specify the output format with --benchmark_out_format={json|console|csv} (or set BENCHMARK_OUT_FORMAT={json|console|csv}). Note that specifying --benchmark_out does not suppress the console output.
However setting those environment variables does not work.
This is because the command argument names already start by benchmark so the function FlagToEnvVar adds the BENCHMARK_ prefix again
benchmark/src/commandlineflags.cc
Line 91 in 8982e1e
| return "BENCHMARK_" + env_var; |
So the actual variables that the code checks are BENCHMARK_BENCHMARK_OUT_FORMAT and BENCHMARK_BENCHMARK_OUT.
System
Which OS, compiler, and compiler version are you using:
- OS: Any
- Compiler and version: Any
To reproduce
Steps to reproduce the behavior:
- sync to tag v1.5.1
- cmake/bazel...
- make ...
- Try any example with
BENCHMARK_OUTset totest_out.jsonandBENCHMARK_OUT_FORMATtojson
Expected behavior
BENCHMARK_OUT and BENCHMARK_OUT_FORMAT should have the same effect as the flags --benchmark_out and --benchmark_out_format respectively, or the documentation should give the correct environment variables.