aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2017-03-10 19:58:18 +0000
committerGravatar Vladimir Moskva <vladmos@google.com>2017-03-12 01:43:57 +0000
commitddaa4b7188f6d522096bccfc1e9c4360dd1b59d7 (patch)
tree772a7efd8a20fbda48a5515fb5c74516814dee99 /src/test
parent413415c6abe48153593deaa05487f40b9ce3df07 (diff)
Add the remote_execution_properties attribute to the platform() rule.
Part of #2219. -- Change-Id: Id82bdd5b3dfab1d2ea781d27dd98020966ce8fac Reviewed-on: https://cr.bazel.build/9271 PiperOrigin-RevId: 149782572 MOS_MIGRATED_REVID=149782572
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/platform/PlatformTest.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/platform/PlatformTest.java b/src/test/java/com/google/devtools/build/lib/rules/platform/PlatformTest.java
index 537f9189dd..555b71d76c 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/platform/PlatformTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/platform/PlatformTest.java
@@ -53,6 +53,7 @@ public class PlatformTest extends BuildViewTestCase {
assertThat(provider.constraints())
.containsExactlyEntriesIn(
ImmutableMap.of(constraintSettingProvider, constraintValueProvider));
+ assertThat(provider.remoteExecutionProperties()).isEmpty();
}
@Test
@@ -75,4 +76,31 @@ public class PlatformTest extends BuildViewTestCase {
" ':bar',",
" ])");
}
+
+ @Test
+ public void testPlatform_remoteExecution() throws Exception {
+ scratch.file(
+ "constraint/BUILD",
+ "constraint_setting(name = 'basic')",
+ "constraint_value(name = 'foo',",
+ " constraint_setting = ':basic',",
+ " )",
+ "platform(name = 'plat1',",
+ " constraint_values = [",
+ " ':foo',",
+ " ],",
+ " remote_execution_properties = {",
+ " 'foo': 'val1',",
+ " 'bar': 'val2',",
+ " },",
+ ")");
+
+ ConfiguredTarget platform = getConfiguredTarget("//constraint:plat1");
+ assertThat(platform).isNotNull();
+
+ PlatformProvider provider = platform.getProvider(PlatformProvider.class);
+ assertThat(provider).isNotNull();
+ assertThat(provider.remoteExecutionProperties())
+ .containsExactlyEntriesIn(ImmutableMap.of("foo", "val1", "bar", "val2"));
+ }
}