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 | 905074c42ba4d0c5b472730b00e43a01d6a50134 (patch) | |
tree | 89a505afc6b6903db71c9005fdfc24848e907732 /src/gtest-port.cc | |
parent | ac60cef37792a6cb7f3534d3f4e2c6d69ab4b5e6 (diff) | |
download | googletest-905074c42ba4d0c5b472730b00e43a01d6a50134.tar.gz |
Implements the test sharding protocol. By Eric Fellheimer.
git-svn-id: http://googletest.googlecode.com/svn/trunk@187 861a406c-534a-0410-8894-cb66d6ee9925
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 3c9ec4b..9348f55 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. |