From 7a3e39fc20f1fba810d8023ff1608e39f501492a Mon Sep 17 00:00:00 2001 From: plf Date: Mon, 6 Aug 2018 03:05:29 -0700 Subject: C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.Builder This is in preparation for deleting CcLinkParamsStore. Not all calls to setCcLinkparamsStore have been removed in this CL. RELNOTES:none PiperOrigin-RevId: 207516944 --- .../build/lib/rules/cpp/SkylarkCcCommonTest.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/test/java/com/google/devtools/build/lib/rules/cpp') diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java index 6bd4f038b3..889e788d18 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java @@ -1056,7 +1056,7 @@ public class SkylarkCcCommonTest extends BuildViewTestCase { " fragments = ['cpp'],", ");"); reporter.removeHandler(failFastHandler); - getConfiguredTarget("//a:r"); + assertThat(getConfiguredTarget("//a:r")).isNull(); assertContainsEvent( "Possible values for artifact_category: static_library, " + "alwayslink_static_library, dynamic_library, interface_library"); @@ -1336,6 +1336,22 @@ public class SkylarkCcCommonTest extends BuildViewTestCase { assertThat(setUpNeverlinkTest("False").getArguments()).contains("-NEVERLINK_OPTION"); } + @Test + public void testEmptyCcLinkingInfoError() throws Exception { + scratch.file("a/BUILD", "load('//tools/build_defs/cc:rule.bzl', 'crule')", "crule(name='r')"); + scratch.file("tools/build_defs/cc/BUILD", ""); + scratch.file( + "tools/build_defs/cc/rule.bzl", + "def _impl(ctx):", + " return [CcLinkingInfo()]", + "crule = rule(", + " _impl,", + ");"); + reporter.removeHandler(failFastHandler); + getConfiguredTarget("//a:r"); + assertContainsEvent("Every CcLinkParams parameter must be passed to CcLinkingInfo."); + } + private CppLinkAction setUpNeverlinkTest(String value) throws Exception { SkylarkCcCommonTestHelper.createFilesForTestingLinking( scratch, -- cgit v1.2.3