summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925>2015-07-19 21:50:45 +0000
committerkosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925>2015-07-19 21:50:45 +0000
commitde011a432c19b67c65230fc3d453093e7b403069 (patch)
tree1e1f5ae5530c54691c7c485869fda2ca5c42473b /src
parent6c9ae8ed3fb146961974a0a81e57e0baeafde9f7 (diff)
downloadgoogletest-de011a432c19b67c65230fc3d453093e7b403069.tar.gz
GTEST_USE_OWN_FLAGFILE support
git-svn-id: http://googletest.googlecode.com/svn/trunk@729 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'src')
-rw-r--r--src/gtest.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gtest.cc b/src/gtest.cc
index 1c5117d..0839389 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -296,10 +296,12 @@ GTEST_DEFINE_bool_(
"if exceptions are enabled or exit the program with a non-zero code "
"otherwise.");
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
GTEST_DEFINE_string_(
flagfile,
internal::StringFromGTestEnv("flagfile", ""),
"This flag specifies the flagfile to read command-line flags from.");
+#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
namespace internal {
@@ -5233,6 +5235,7 @@ bool ParseGoogleTestFlag(const char* const arg) {
&GTEST_FLAG(throw_on_failure));
}
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
void LoadFlagsFromFile(const std::string& path) {
FILE* flagfile = posix::FOpen(path.c_str(), "r");
if (!flagfile) {
@@ -5253,6 +5256,7 @@ void LoadFlagsFromFile(const std::string& path) {
g_help_flag = true;
}
}
+#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
// Parses the command line for Google Test flags, without initializing
// other parts of Google Test. The type parameter CharType can be
@@ -5270,9 +5274,11 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
bool remove_flag = false;
if (ParseGoogleTestFlag(arg)) {
remove_flag = true;
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
} else if (ParseStringFlag(arg, kFlagfileFlag, &GTEST_FLAG(flagfile))) {
LoadFlagsFromFile(GTEST_FLAG(flagfile));
remove_flag = true;
+#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
} else if (arg_string == "--help" || arg_string == "-h" ||
arg_string == "-?" || arg_string == "/?" ||
HasGoogleTestFlagPrefix(arg)) {