aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java
diff options
context:
space:
mode:
authorGravatar cpeyser <cpeyser@google.com>2017-11-06 23:10:36 +0100
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-11-07 19:07:02 +0100
commita7f8a91e7692be2e1941cb82da486709c228aad7 (patch)
tree6256357e5f2bd26496ecff12122e9b4e11fa36bc /src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java
parent49212e985d41b03d5e8cd4417f773748596587fe (diff)
Introduce cc_toolchain_type, which exports c++ make variables. Use
//tools/cpp:toolchain_type as the canonical c++ toolchain. PiperOrigin-RevId: 174759558
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java b/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java
index 7f043258e1..9b6cc4995c 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java
@@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
import com.google.devtools.build.lib.analysis.TemplateVariableInfo;
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+import com.google.devtools.build.lib.testutil.TestConstants;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -25,11 +26,19 @@ import org.junit.runners.JUnit4;
/** Unit tests for the {@code toolchain_type} rule. */
@RunWith(JUnit4.class)
public class ToolchainTypeTest extends BuildViewTestCase {
+
@Test
public void testSmoke() throws Exception {
- ConfiguredTarget cc = getConfiguredTarget(getRuleClassProvider().getToolsRepository()
- + "//tools/cpp:toolchain_type");
+ ConfiguredTarget cc =
+ getConfiguredTarget(TestConstants.TOOLS_REPOSITORY + "//tools/cpp:toolchain_type");
assertThat(cc.get(TemplateVariableInfo.PROVIDER).getVariables())
.containsKey("TARGET_CPU");
}
+
+ @Test
+ public void testCcToolchainDoesNotProvideJavaMakeVariables() throws Exception {
+ ConfiguredTarget cc =
+ getConfiguredTarget(TestConstants.TOOLS_REPOSITORY + "//tools/cpp:toolchain_type");
+ assertThat(cc.get(TemplateVariableInfo.PROVIDER).getVariables()).doesNotContainKey("JAVABASE");
+ }
}