diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-02-09 18:05:21 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-02-09 18:05:21 +0000 |
commit | cd3e4016ea451c9ee5cb7925329f2611098cbcf9 (patch) | |
tree | 89a505afc6b6903db71c9005fdfc24848e907732 /src/gtest-port.cc | |
parent | 886cafd4a37fd5e7325da1ae5a5a948b6c2bc895 (diff) | |
download | googletest-cd3e4016ea451c9ee5cb7925329f2611098cbcf9.tar.gz googletest-cd3e4016ea451c9ee5cb7925329f2611098cbcf9.tar.bz2 googletest-cd3e4016ea451c9ee5cb7925329f2611098cbcf9.zip |
Implements the test sharding protocol. By Eric Fellheimer.
Diffstat (limited to 'src/gtest-port.cc')
-rw-r--r-- | src/gtest-port.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gtest-port.cc b/src/gtest-port.cc index 3c9ec4bb..9348f55c 100644 --- a/src/gtest-port.cc +++ b/src/gtest-port.cc @@ -512,17 +512,6 @@ static String FlagToEnvVar(const char* flag) { return env_var.GetString(); } -// 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". -bool BoolFromGTestEnv(const char* flag, bool default_value) { - const String env_var = FlagToEnvVar(flag); - const char* const string_value = GetEnv(env_var.c_str()); - return string_value == NULL ? - default_value : strcmp(string_value, "0") != 0; -} - // Parses 'str' for a 32-bit signed integer. If successful, writes // the result to *value and returns true; otherwise leaves *value // unchanged and returns false. @@ -564,6 +553,17 @@ bool ParseInt32(const Message& src_text, const char* str, Int32* value) { return true; } +// 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". +bool BoolFromGTestEnv(const char* flag, bool default_value) { + const String env_var = FlagToEnvVar(flag); + const char* const string_value = GetEnv(env_var.c_str()); + return string_value == NULL ? + default_value : strcmp(string_value, "0") != 0; +} + // Reads and returns a 32-bit integer stored in the environment // variable corresponding to the given flag; if it isn't set or // doesn't represent a valid 32-bit integer, returns default_value. |