Reads and returns the Boolean environment variable corresponding to the given flag; if it's not set, returns default_value. The value is considered true iff it's not "0".
| 11036 | // |
| 11037 | // The value is considered true iff it's not "0". |
| 11038 | bool BoolFromGTestEnv(const char* flag, bool default_value) { |
| 11039 | #if defined(GTEST_GET_BOOL_FROM_ENV_) |
| 11040 | return GTEST_GET_BOOL_FROM_ENV_(flag, default_value); |
| 11041 | #else |
| 11042 | const std::string env_var = FlagToEnvVar(flag); |
| 11043 | const char* const string_value = posix::GetEnv(env_var.c_str()); |
| 11044 | return string_value == nullptr ? default_value |
| 11045 | : strcmp(string_value, "0") != 0; |
| 11046 | #endif // defined(GTEST_GET_BOOL_FROM_ENV_) |
| 11047 | } |
| 11048 | |
| 11049 | // Reads and returns a 32-bit integer stored in the environment |
| 11050 | // variable corresponding to the given flag; if it isn't set or |
no test coverage detected