summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorRohan Joyce <rfj@google.com>2018-06-07 16:17:33 (GMT)
committerRohan Joyce <rfj@google.com>2018-06-14 19:45:55 (GMT)
commit0563b52d3acc5661792cf1f8c78661a050afc883 (patch)
treef038bb048175150c0cd0833de4d551b1bc688c5b /googletest/src
parentdea79290af988a71b9f566550237266a8f1e21a7 (diff)
downloadgoogletest-0563b52d3acc5661792cf1f8c78661a050afc883.zip
googletest-0563b52d3acc5661792cf1f8c78661a050afc883.tar.gz
googletest-0563b52d3acc5661792cf1f8c78661a050afc883.tar.bz2
Eliminate GTEST_TEST_FILTER_ENV_VAR_.refs/pull/1622/head
GTEST_TEST_FILTER_ENV_VAR_ was used to specify an environment variable to obtain the default test filter from. By default it was unset which broke "--test_filter" for bazel. This CL eliminates GTEST_TEST_FILTER_ENV_VAR_ and explicitly obtains the default test filter from the environment variable TESTBRIDGE_TEST_ONLY if it exists.
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index bd6ab7b..ce6c07f 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -184,13 +184,14 @@ bool g_help_flag = false;
} // namespace internal
+// Bazel passes in the argument to '--test_filter' via the TESTBRIDGE_TEST_ONLY
+// environment variable.
static const char* GetDefaultFilter() {
-#ifdef GTEST_TEST_FILTER_ENV_VAR_
- const char* const testbridge_test_only = getenv(GTEST_TEST_FILTER_ENV_VAR_);
+ const char* const testbridge_test_only =
+ internal::posix::GetEnv("TESTBRIDGE_TEST_ONLY");
if (testbridge_test_only != NULL) {
return testbridge_test_only;
}
-#endif // GTEST_TEST_FILTER_ENV_VAR_
return kUniversalFilter;
}