diff options
author | ccalvarin <ccalvarin@google.com> | 2017-10-13 20:34:58 +0200 |
---|---|---|
committer | Jakob Buchgraber <buchgr@google.com> | 2017-10-16 17:48:38 +0200 |
commit | 2553875c285dcca454ee830182d238296ce70aa2 (patch) | |
tree | 9786870dd889a4f5cd030e0237a83fc09386a3cf /src/test | |
parent | dff2a488255a6db5c6378b524bbab8df235b119c (diff) |
Make option conflicts less spammy.
Remove an unnecessary warning and make all warnings for option conflicts print only if the option values are not equal.
RELNOTES: None.
PiperOrigin-RevId: 172124261
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/common/options/OptionsParserTest.java | 18 | ||||
-rwxr-xr-x | src/test/shell/integration/loading_phase_tests.sh | 8 |
2 files changed, 9 insertions, 17 deletions
diff --git a/src/test/java/com/google/devtools/common/options/OptionsParserTest.java b/src/test/java/com/google/devtools/common/options/OptionsParserTest.java index 1d2b6940f9..dccc44b503 100644 --- a/src/test/java/com/google/devtools/common/options/OptionsParserTest.java +++ b/src/test/java/com/google/devtools/common/options/OptionsParserTest.java @@ -1227,7 +1227,7 @@ public class OptionsParserTest { public static class ImplicitDependencyWarningOptions extends OptionsBase { @Option( name = "first", - implicitRequirements = "--second=second", + implicitRequirements = "--second=requiredByFirst", documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, effectTags = {OptionEffectTag.NO_OP}, defaultValue = "null" @@ -1244,7 +1244,7 @@ public class OptionsParserTest { @Option( name = "third", - implicitRequirements = "--second=third", + implicitRequirements = "--second=requiredByThird", documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, effectTags = {OptionEffectTag.NO_OP}, defaultValue = "null" @@ -1258,8 +1258,8 @@ public class OptionsParserTest { parser.parse("--second=second", "--first=first"); assertThat(parser.getWarnings()) .containsExactly( - "Option 'second' is implicitly defined by " - + "option 'first'; the implicitly set value overrides the previous one"); + "Option 'second' is implicitly defined by option 'first'; the implicitly set value " + + "overrides the previous one"); } @Test @@ -1270,8 +1270,8 @@ public class OptionsParserTest { parser.parse("--second=second"); assertThat(parser.getWarnings()) .containsExactly( - "A new value for option 'second' overrides a" - + " previous implicit setting of that option by option 'first'"); + "A new value for option 'second' overrides a previous implicit setting of that option " + + "by option 'first'"); } @Test @@ -1292,7 +1292,7 @@ public class OptionsParserTest { parser.parse("--third=third"); assertThat(parser.getWarnings()) .containsExactly( - "Option 'second' is implicitly defined by both " + "option 'first' and option 'third'"); + "Option 'second' is implicitly defined by both option 'first' and option 'third'"); } @Test @@ -1482,8 +1482,8 @@ public class OptionsParserTest { parser.parse("--underlying=underlying", "--first"); assertThat(parser.getWarnings()) .containsExactly( - "The option 'first' was expanded and now overrides a " - + "previous explicitly specified option 'underlying'"); + "The option 'first' was expanded and now overrides a previous explicitly specified " + + "option 'underlying'"); } @Test diff --git a/src/test/shell/integration/loading_phase_tests.sh b/src/test/shell/integration/loading_phase_tests.sh index d12e4592f5..94bbd04d75 100755 --- a/src/test/shell/integration/loading_phase_tests.sh +++ b/src/test/shell/integration/loading_phase_tests.sh @@ -162,14 +162,6 @@ EOF expect_log "//cycle:foo.h.*self-edge" } -# Integration test for option parser warnings. -function test_warning_for_weird_parameters() { - bazel build --check_tests_up_to_date --check_up_to_date --nobuild \ - >$TEST_log 2>&1 - expect_log "WARNING: A new value for option 'check_up_to_date' overrides a \ -previous implicit setting of that option by option 'check_tests_up_to_date'" -} - # glob function should not return values that are outside the package function test_glob_with_subpackage() { mkdir -p p/subpkg || fail "mkdir p/subpkg failed" |