aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2018-03-06 13:18:26 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-06 13:20:02 -0800
commite00a2b191a45e1efd24f2d491b8abd49235c9db1 (patch)
tree465df1021e49c9831b9123c04889dc826fbc8801 /src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java
parentcf79305f79f627ae20c4da5e832a633fc3994d5a (diff)
Do not expose platform-related providers to Skylark.
This prevents both creation and access to platform providers from Skylark. This is needed so we can load platforms directly from platform-rule targets without needing a full configured target, and to effiently distinguish platform providers from non-platform providers. Change-Id: I6b61f9ee7518d5e9311232908a922596e18fe32f PiperOrigin-RevId: 188070457
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java b/src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java
index ca34b45f40..ed48aa7ba7 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/platform/ConstraintSettingInfoTest.java
@@ -14,12 +14,9 @@
package com.google.devtools.build.lib.analysis.platform;
-import static com.google.common.truth.Truth.assertThat;
import com.google.common.testing.EqualsTester;
-import com.google.devtools.build.lib.analysis.ConfiguredTarget;
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
-import com.google.devtools.build.lib.cmdline.Label;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -37,28 +34,4 @@ public class ConstraintSettingInfoTest extends BuildViewTestCase {
.addEqualityGroup(ConstraintSettingInfo.create(makeLabel("//constraint:other")))
.testEquals();
}
-
- @Test
- public void constraintSettingInfoConstructor() throws Exception {
- scratch.file(
- "test/platform/my_constraint_setting.bzl",
- "def _impl(ctx):",
- " constraint_setting = platform_common.ConstraintSettingInfo(label = ctx.label)",
- " return [constraint_setting]",
- "my_constraint_setting = rule(",
- " implementation = _impl,",
- " attrs = {",
- " }",
- ")");
- scratch.file(
- "test/platform/BUILD",
- "load('//test/platform:my_constraint_setting.bzl', 'my_constraint_setting')",
- "my_constraint_setting(name = 'custom')");
-
- ConfiguredTarget setting = getConfiguredTarget("//test/platform:custom");
- assertThat(setting).isNotNull();
- assertThat(PlatformProviderUtils.constraintSetting(setting)).isNotNull();
- assertThat(PlatformProviderUtils.constraintSetting(setting).label())
- .isEqualTo(Label.parseAbsolute("//test/platform:custom"));
- }
}