aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-03-21 21:44:27 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-21 21:46:09 -0700
commit6ff110e21fb47ea3acde12c4651c2217a7e25672 (patch)
tree9d2cc688eec42938c4c4c2ee324b3e540ca1e2f3 /src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
parentf572845d04c579e81b2dc78e8efeea12dc7dbee7 (diff)
Store RuleClassType in RuleClass. Shouldn't use much more memory, and allows serialization to preserve the type when reconstituting the RuleClass.
PiperOrigin-RevId: 190015323
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
index bfb0cbc43a..b854fc1cfa 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
@@ -158,7 +158,26 @@ public class SkylarkIntegrationTest extends BuildViewTestCase {
assertThat(ccTarget.getAttr("generator_location")).isEqualTo("");
}
-
+ @Test
+ public void sanityCheckUserDefinedTestRule() throws Exception {
+ scratch.file(
+ "test/skylark/test_rule.bzl",
+ "def _impl(ctx):",
+ " output = ctx.outputs.out",
+ " ctx.actions.write(output = output, content = 'hello')",
+ "",
+ "fake_test = rule(",
+ " implementation = _impl,",
+ " test=True,",
+ " attrs = {'_xcode_config': attr.label(default = configuration_field(",
+ " fragment = 'apple', name = \"xcode_config_label\"))},",
+ " outputs = {\"out\": \"%{name}.txt\"})");
+ scratch.file(
+ "test/skylark/BUILD",
+ "load('//test/skylark:test_rule.bzl', 'fake_test')",
+ "fake_test(name = 'test_name')");
+ getConfiguredTarget("//test/skylark:fake_test");
+ }
@Test
public void testOutputGroups() throws Exception {