diff options
author | Abseil Team <absl-team@google.com> | 2023-04-26 14:13:23 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-26 14:13:51 (GMT) |
commit | dea0484e4d3b6a2c50055c24c5617cd662a50c5f (patch) | |
tree | 1bdef22b8d4eb567b4685f97b6113818ba1b8947 /googletest/test/gtest_unittest.cc | |
parent | ccdeec888ebb740a7ea4e07d3e84a1b7ee32b315 (diff) | |
download | googletest-dea0484e4d3b6a2c50055c24c5617cd662a50c5f.zip googletest-dea0484e4d3b6a2c50055c24c5617cd662a50c5f.tar.gz googletest-dea0484e4d3b6a2c50055c24c5617cd662a50c5f.tar.bz2 |
Use Abseil Flag public API for flag parsing.
This change brings InitGoogleTest semantic in accordance with the official documentation: only GoogleTest flags are removed from argc/argv. The rest of the flags remains in place. We do nothing special for flags with unrecognized gunit_/gtest_ prefix and we do not report them.
PiperOrigin-RevId: 527257221
Change-Id: Ibb29a1bda1a44251a4ee579c0fb5bbdfd9965c21
Diffstat (limited to 'googletest/test/gtest_unittest.cc')
-rw-r--r-- | googletest/test/gtest_unittest.cc | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |