diff options
author | 2017-08-31 23:56:40 +0200 | |
---|---|---|
committer | 2017-09-01 12:28:32 +0200 | |
commit | a117235b926eb477299436328a34ad4b1ea0eec0 (patch) | |
tree | 570d6fac2b13d4262251752fce7cbd448f974ee5 /src/test/java/com/google/devtools/build/lib/rules/config | |
parent | 494151d0cde6c43284cde26d3447da281f4a0b8f (diff) |
Release config_setting.flag_values from the whitelist.
This feature is opening up beyond just ConfigFeatureFlags, and so should not
be restricted.
RELNOTES: None.
PiperOrigin-RevId: 167195959
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/config')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/config/ConfigSettingTest.java | 77 |
1 files changed, 0 insertions, 77 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 c79332b4f3..9def906044 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 @@ -1122,81 +1122,4 @@ public class ConfigSettingTest extends BuildViewTestCase { " default_value = 'valid',", ")"); } - - @Test - public void policyMustContainRuleToUseFlagValues() throws Exception { - reporter.removeHandler(failFastHandler); // expecting an error - scratch.overwriteFile( - "tools/whitelists/config_feature_flag/BUILD", - "package_group(", - " name = 'config_feature_flag',", - " packages = ['//flag'])"); - scratch.file( - "flag/BUILD", - "config_feature_flag(", - " name = 'flag',", - " allowed_values = ['right', 'wrong'],", - " default_value = 'right',", - " visibility = ['//test:__pkg__'],", - ")"); - scratch.file( - "test/BUILD", - "config_setting(", - " name = 'flag_values_user',", - " flag_values = {", - " '//flag:flag': 'right',", - " },", - ")"); - assertThat(getConfiguredTarget("//test:flag_values_user")).isNull(); - assertContainsEvent( - "in flag_values attribute of config_setting rule //test:flag_values_user: the flag_values " - + "attribute is not available in package 'test'"); - } - - @Test - public void policyDoesNotBlockRuleIfInPolicy() throws Exception { - scratch.overwriteFile( - "tools/whitelists/config_feature_flag/BUILD", - "package_group(", - " name = 'config_feature_flag',", - " packages = ['//flag', '//test'])"); - scratch.file( - "flag/BUILD", - "config_feature_flag(", - " name = 'flag',", - " allowed_values = ['right', 'wrong'],", - " default_value = 'right',", - " visibility = ['//test:__pkg__'],", - ")"); - scratch.file( - "test/BUILD", - "config_setting(", - " name = 'flag_values_user',", - " flag_values = {", - " '//flag:flag': 'right',", - " },", - ")"); - assertThat(getConfiguredTarget("//test:flag_values_user")).isNotNull(); - assertNoEvents(); - } - - @Test - public void policyDoesNotBlockRuleIfFlagValuesNotUsed() throws Exception { - scratch.overwriteFile( - "tools/whitelists/config_feature_flag/BUILD", - "package_group(", - " name = 'config_feature_flag',", - " packages = ['//flag'])"); - scratch.file("flag/BUILD"); - scratch.file( - "test/BUILD", - "config_setting(", - " name = 'flag_values_user',", - " values = {", - " 'cpu': 'k8',", - " },", - ")"); - assertThat(getConfiguredTarget("//test:flag_values_user")).isNotNull(); - assertNoEvents(); - } } |