diff options
Diffstat (limited to 'googletest/test')
-rwxr-xr-x | googletest/test/gtest_help_test.py | 11 | ||||
-rw-r--r-- | googletest/test/gtest_unittest.cc | 9 |
2 files changed, 9 insertions, 11 deletions
diff --git a/googletest/test/gtest_help_test.py b/googletest/test/gtest_help_test.py index 9261b87..85a0c33 100755 --- a/googletest/test/gtest_help_test.py +++ b/googletest/test/gtest_help_test.py @@ -54,7 +54,6 @@ PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_') FLAG_PREFIX = '--gtest_' DEATH_TEST_STYLE_FLAG = FLAG_PREFIX + 'death_test_style' STREAM_RESULT_TO_FLAG = FLAG_PREFIX + 'stream_result_to' -UNKNOWN_GTEST_PREFIXED_FLAG = FLAG_PREFIX + 'unknown_flag_for_testing' LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests' INTERNAL_FLAG_FOR_TESTING = FLAG_PREFIX + 'internal_flag_for_testing' @@ -177,16 +176,6 @@ class GTestHelpTest(gtest_test_utils.TestCase): def testPrintsHelpWithFullFlag(self): self.TestHelpFlag('--help') - def testPrintsHelpWithUnrecognizedGoogleTestFlag(self): - # The behavior is slightly different when Abseil flags is - # used. Abseil flags rejects all unknown flags, while the builtin - # GTest flags implementation interprets an unknown flag with a - # '--gtest_' prefix as a request for help. - if HAS_ABSL_FLAGS: - self.TestUnknownFlagWithAbseil(UNKNOWN_GTEST_PREFIXED_FLAG) - else: - self.TestHelpFlag(UNKNOWN_GTEST_PREFIXED_FLAG) - def testRunsTestsWithoutHelpFlag(self): """Verifies correct behavior when no help flag is specified. diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index 1fde827..9b4b833 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -6220,6 +6220,15 @@ TEST_F(ParseFlagsTest, AbseilPositionalFlags) { } #endif +TEST_F(ParseFlagsTest, UnrecognizedFlags) { + const char* argv[] = {"foo.exe", "--gtest_filter=abcd", "--other_flag", + nullptr}; + + const char* argv2[] = {"foo.exe", "--other_flag", nullptr}; + + GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter("abcd"), false); +} + #ifdef GTEST_OS_WINDOWS // Tests parsing wide strings. TEST_F(ParseFlagsTest, WideStrings) { |