Returns the name of the environment variable corresponding to the given flag. For example, FlagToEnvVar("foo") will return "GTEST_FOO" in the open-source version.
| 8449 | // given flag. For example, FlagToEnvVar("foo") will return |
| 8450 | // "GTEST_FOO" in the open-source version. |
| 8451 | static String FlagToEnvVar(const char* flag) { |
| 8452 | const String full_flag = |
| 8453 | (Message() << GTEST_FLAG_PREFIX_ << flag).GetString(); |
| 8454 | |
| 8455 | Message env_var; |
| 8456 | for (size_t i = 0; i != full_flag.length(); i++) { |
| 8457 | env_var << ToUpper(full_flag.c_str()[i]); |
| 8458 | } |
| 8459 | |
| 8460 | return env_var.GetString(); |
| 8461 | } |
| 8462 | |
| 8463 | // Parses 'str' for a 32-bit signed integer. If successful, writes |
| 8464 | // the result to *value and returns true; otherwise leaves *value |
no test coverage detected