diff options
author | 2018-04-27 04:46:25 -0700 | |
---|---|---|
committer | 2018-04-27 04:47:59 -0700 | |
commit | 24f4ab06be65db13036d0353771e20c470f25f1a (patch) | |
tree | 3ed5de53f9b500377b19b248e37ed062a88a0c8c /src/test/java/com/google/devtools/build | |
parent | 2da963d63e20a577bd1d9f1d3495c86e9b71debc (diff) |
Add --experimental_use_late_bound_option_defauts flag to toggle usage of late bound option defaults
BuildConfiguration.Fragment#lateBoundOptionDefaults() is going away soon, this flag is added to decouple its removal with the release process.
PiperOrigin-RevId: 194527657
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/config/ConfigSettingTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/config/ConfigSettingTest.java b/src/test/java/com/google/devtools/build/lib/rules/config/ConfigSettingTest.java index 985cc4a2cb..0103aa9e89 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/config/ConfigSettingTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/config/ConfigSettingTest.java @@ -266,6 +266,19 @@ public class ConfigSettingTest extends BuildViewTestCase { assertThat(getConfigMatchingProvider("//test:match").matches()).isTrue(); } + /** Tests disallowing {@link BuildConfiguration.Fragment#lateBoundOptionDefaults} */ + @Test + public void disallowLateBoundOptionDefaults() throws Exception { + useConfiguration("--experimental_use_late_bound_option_defaults=false"); + scratch.file( + "test/BUILD", + "config_setting(", + " name = 'match',", + " values = { 'opt_with_default': 'overridden' }", + ")"); + assertThat(getConfigMatchingProvider("//test:match").matches()).isFalse(); + } + /** * Tests matching on multi-value attributes with key=value entries (e.g. --define). */ |