diff options
author | Abseil Team <absl-team@google.com> | 2020-06-09 08:17:12 -0700 |
---|---|---|
committer | vslashg <gfalcon@google.com> | 2020-06-09 11:23:39 -0400 |
commit | 2eba343b51e0923cd3fb919a6abd6120590fc059 (patch) | |
tree | 0fe2eb4440e2dfb5da6e125455b2880ee58802d5 /absl/flags | |
parent | a8b03d90e0afe03fefa16d4a871ece344a5d52ad (diff) |
Export of internal Abseil changes
--
baf626d27ff1547776745f3b601cc42f703d4bdf by Greg Falcon <gfalcon@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 315486679
--
39d4e7f9214c5a74e4ee4b8a7f4af26479925029 by Gennadiy Rozental <rogeeff@google.com>:
Avoid order dependant test cases.
PiperOrigin-RevId: 315327948
--
8feb187703a28bb0c5cfc5dd6091e3faa90a8e61 by Gennadiy Rozental <rogeeff@google.com>:
Avoid order dependant test cases.
PiperOrigin-RevId: 315317018
--
cffd8fddad15908ec9de7f21f65b20528972e3fa by Gennadiy Rozental <rogeeff@google.com>:
Avoid order dependant test cases.
PiperOrigin-RevId: 315311587
--
48997a0ceb231b75c14eb4b1eb3b66af69e49f42 by Tom Manshreck <shreck@google.com>:
Nit: remove extra "the"
PiperOrigin-RevId: 314959763
--
9516f44a4b5d3055427c95e80c8c04a6321e4221 by Gennadiy Rozental <rogeeff@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 314925147
--
4f8691d74a4eb42ed03ef29c9588a01b78829941 by Abseil Team <absl-team@google.com>:
Uninclude util/bits/bits.h
PiperOrigin-RevId: 314858384
--
02b42a8ec5e5561b29b4e5f93cc1482c3c72ef2d by Abseil Team <absl-team@google.com>:
Google-internal changes only.
PiperOrigin-RevId: 314855667
--
146013d69dabafbe2030e23ced7b741d9e8d417c by Gennadiy Rozental <rogeeff@google.com>:
Uninclude util/bits/bits.h
PiperOrigin-RevId: 314838927
GitOrigin-RevId: baf626d27ff1547776745f3b601cc42f703d4bdf
Change-Id: I2602286fb13cf35a88bdd80fe0b44974d4388d46
Diffstat (limited to 'absl/flags')
-rw-r--r-- | absl/flags/commandlineflag_test.cc | 12 | ||||
-rw-r--r-- | absl/flags/internal/program_name_test.cc | 4 | ||||
-rw-r--r-- | absl/flags/parse_test.cc | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/absl/flags/commandlineflag_test.cc b/absl/flags/commandlineflag_test.cc index c5afff61..585db4ba 100644 --- a/absl/flags/commandlineflag_test.cc +++ b/absl/flags/commandlineflag_test.cc @@ -34,6 +34,10 @@ ABSL_FLAG(std::string, string_flag, "dflt", absl::StrCat("string_flag", " help")); ABSL_RETIRED_FLAG(bool, bool_retired_flag, false, "bool_retired_flag help"); +// These are only used to test default values. +ABSL_FLAG(int, int_flag2, 201, ""); +ABSL_FLAG(std::string, string_flag2, "dflt", ""); + namespace { namespace flags = absl::flags_internal; @@ -94,15 +98,15 @@ TEST_F(CommandLineFlagTest, TestAttributesAccessMethods) { // -------------------------------------------------------------------- TEST_F(CommandLineFlagTest, TestValueAccessMethods) { - absl::SetFlag(&FLAGS_int_flag, 301); - auto* flag_01 = absl::FindCommandLineFlag("int_flag"); + absl::SetFlag(&FLAGS_int_flag2, 301); + auto* flag_01 = absl::FindCommandLineFlag("int_flag2"); ASSERT_TRUE(flag_01); EXPECT_EQ(flag_01->CurrentValue(), "301"); EXPECT_EQ(flag_01->DefaultValue(), "201"); - absl::SetFlag(&FLAGS_string_flag, "new_str_value"); - auto* flag_02 = absl::FindCommandLineFlag("string_flag"); + absl::SetFlag(&FLAGS_string_flag2, "new_str_value"); + auto* flag_02 = absl::FindCommandLineFlag("string_flag2"); ASSERT_TRUE(flag_02); EXPECT_EQ(flag_02->CurrentValue(), "new_str_value"); diff --git a/absl/flags/internal/program_name_test.cc b/absl/flags/internal/program_name_test.cc index 269142f2..aff9f631 100644 --- a/absl/flags/internal/program_name_test.cc +++ b/absl/flags/internal/program_name_test.cc @@ -25,7 +25,7 @@ namespace { namespace flags = absl::flags_internal; -TEST(FlagsPathUtilTest, TestInitialProgamName) { +TEST(FlagsPathUtilTest, TestProgamNameInterfaces) { flags::SetProgramInvocationName("absl/flags/program_name_test"); std::string program_name = flags::ProgramInvocationName(); for (char& c : program_name) @@ -43,9 +43,7 @@ TEST(FlagsPathUtilTest, TestInitialProgamName) { EXPECT_TRUE(absl::EndsWith(program_name, expect_name)) << program_name; EXPECT_EQ(flags::ShortProgramInvocationName(), expect_basename); -} -TEST(FlagsPathUtilTest, TestProgamNameInterfaces) { flags::SetProgramInvocationName("a/my_test"); EXPECT_EQ(flags::ProgramInvocationName(), "a/my_test"); diff --git a/absl/flags/parse_test.cc b/absl/flags/parse_test.cc index 67ae8aad..d35a6e47 100644 --- a/absl/flags/parse_test.cc +++ b/absl/flags/parse_test.cc @@ -637,6 +637,10 @@ TEST_F(ParseTest, TestFlagfileInFlagfile) { "--flagfile=$0/parse_test.ff2", }; + GetFlagfileFlag({{"parse_test.ff2", absl::MakeConstSpan(ff2_data)}, + {"parse_test.ff1", absl::MakeConstSpan(ff1_data)}}, + flagfile_flag); + const char* in_args1[] = { "testbin", GetFlagfileFlag({{"parse_test.ff3", absl::MakeConstSpan(ff3_data)}}, |