Change GetDefaultFilter to allow for the injection of a custom filter.
This commit is contained in:
parent
f025eba07b
commit
38dd7485c0
|
@ -39,6 +39,11 @@
|
|||
// GTEST_DEFINE_int32_(name, default_val, doc)
|
||||
// GTEST_DEFINE_string_(name, default_val, doc)
|
||||
//
|
||||
// Test filtering:
|
||||
// GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that
|
||||
// will be used if --GTEST_FLAG(test_filter)
|
||||
// is not provided.
|
||||
//
|
||||
// Logging:
|
||||
// GTEST_LOG_(severity)
|
||||
// GTEST_CHECK_(condition)
|
||||
|
|
|
@ -189,6 +189,12 @@ bool g_help_flag = false;
|
|||
} // namespace internal
|
||||
|
||||
static const char* GetDefaultFilter() {
|
||||
#ifdef GTEST_TEST_FILTER_ENV_VAR_
|
||||
const char* const testbridge_test_only = getenv(GTEST_TEST_FILTER_ENV_VAR_);
|
||||
if (testbridge_test_only != NULL) {
|
||||
return testbridge_test_only;
|
||||
}
|
||||
#endif // GTEST_TEST_FILTER_ENV_VAR_
|
||||
return kUniversalFilter;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user