diff options
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.java | 13 |
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"); + } } |