Reads and returns the string environment variable corresponding to the given flag; if it's not set, returns default_value.
| 11093 | // Reads and returns the string environment variable corresponding to |
| 11094 | // the given flag; if it's not set, returns default_value. |
| 11095 | const char* StringFromGTestEnv(const char* flag, const char* default_value) { |
| 11096 | #if defined(GTEST_GET_STRING_FROM_ENV_) |
| 11097 | return GTEST_GET_STRING_FROM_ENV_(flag, default_value); |
| 11098 | #else |
| 11099 | const std::string env_var = FlagToEnvVar(flag); |
| 11100 | const char* const value = posix::GetEnv(env_var.c_str()); |
| 11101 | return value == nullptr ? default_value : value; |
| 11102 | #endif // defined(GTEST_GET_STRING_FROM_ENV_) |
| 11103 | } |
| 11104 | |
| 11105 | } // namespace internal |
| 11106 | } // namespace testing |
no test coverage detected