As a special case for the 'output' flag, if GTEST_OUTPUT is not set, we look for XML_OUTPUT_FILE, which is set by the Bazel build system. The value of XML_OUTPUT_FILE is a filename without the "xml:" prefix of GTEST_OUTPUT. Note that this is meant to be called at the call site so it does not check that the flag is 'output' In essence this checks an env variable called XML_OUTPUT_FILE and if it is
| 11082 | // In essence this checks an env variable called XML_OUTPUT_FILE |
| 11083 | // and if it is set we prepend "xml:" to its value, if it not set we return "" |
| 11084 | std::string OutputFlagAlsoCheckEnvVar(){ |
| 11085 | std::string default_value_for_output_flag = ""; |
| 11086 | const char* xml_output_file_env = posix::GetEnv("XML_OUTPUT_FILE"); |
| 11087 | if (nullptr != xml_output_file_env) { |
| 11088 | default_value_for_output_flag = std::string("xml:") + xml_output_file_env; |
| 11089 | } |
| 11090 | return default_value_for_output_flag; |
| 11091 | } |
| 11092 | |
| 11093 | // Reads and returns the string environment variable corresponding to |
| 11094 | // the given flag; if it's not set, returns default_value. |