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".
| 9800 | // |
| 9801 | // The value is considered true iff it's not "0". |
| 9802 | bool BoolFromGTestEnv(const char* flag, bool default_value) { |
| 9803 | const std::string env_var = FlagToEnvVar(flag); |
| 9804 | const char* const string_value = posix::GetEnv(env_var.c_str()); |
| 9805 | return string_value == NULL ? |
| 9806 | default_value : strcmp(string_value, "0") != 0; |
| 9807 | } |
| 9808 | |
| 9809 | // Reads and returns a 32-bit integer stored in the environment |
| 9810 | // variable corresponding to the given flag; if it isn't set or |
no test coverage detected