aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2017-12-06 09:19:21 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-06 09:21:13 -0800
commitc861c0afd9a4df283936218b9e5b33c452b07c95 (patch)
tree88476d9d8930934da9d36d513c6342e030dccd87 /src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
parentfdca7d5eac5c71cfe81dd12b19a3149bf163f629 (diff)
Register separate linkstamp compile action
This cl replaces entire hardcoded linkstamping command line generation with a separate action. Instead of generating bash command to compile linkstamp and prepending it to the standard link command line, this cl creates a special action that link action depends on. I kept linkstamp action registration in the CppLinkActionBuilder (and GoCompilationHelper internally) to keep the cl shorter and change more localized. I also didn't remove linkstamps and buildInfoHeaderArtifacts from CppLinkAction to stay compatible with extra actions api. Both issues and corresponding cleanups will be addressed in separate cls. RELNOTES: Linkstamping is now a separate and full-blown CppCompileAction, it's no longer a part of linking command. PiperOrigin-RevId: 178106899
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
index a0154f0bda..eae60c6c13 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
@@ -283,7 +283,6 @@ public class CppLinkActionTest extends BuildViewTestCase {
private enum NonStaticAttributes {
OUTPUT_FILE,
- COMPILATION_INPUTS,
NATIVE_DEPS,
USE_TEST_ONLY_FLAGS,
FAKE,
@@ -301,8 +300,6 @@ public class CppLinkActionTest extends BuildViewTestCase {
final PathFragment dynamicOutputPath = PathFragment.create("dummyRuleContext/output/path.so");
final Artifact staticOutputFile = getBinArtifactWithNoOwner(exeOutputPath.getPathString());
final Artifact dynamicOutputFile = getBinArtifactWithNoOwner(dynamicOutputPath.getPathString());
- final Artifact oFile = getSourceArtifact("cc/a.o");
- final Artifact oFile2 = getSourceArtifact("cc/a2.o");
final FeatureConfiguration featureConfiguration = getMockFeatureConfiguration();
ActionTester.runTest(
@@ -322,10 +319,6 @@ public class CppLinkActionTest extends BuildViewTestCase {
CppHelper.getFdoSupportUsingDefaultCcToolchainAttribute(ruleContext),
featureConfiguration,
MockCppSemantics.INSTANCE) {};
- builder.addCompilationInputs(
- attributesToFlip.contains(NonStaticAttributes.COMPILATION_INPUTS)
- ? ImmutableList.of(oFile)
- : ImmutableList.of(oFile2));
if (attributesToFlip.contains(NonStaticAttributes.OUTPUT_FILE)) {
builder.setLinkType(LinkTargetType.DYNAMIC_LIBRARY);
builder.setLibraryIdentifier("foo");
@@ -350,7 +343,6 @@ public class CppLinkActionTest extends BuildViewTestCase {
private enum StaticKeyAttributes {
OUTPUT_FILE,
- COMPILATION_INPUTS
}
/**
@@ -364,8 +356,6 @@ public class CppLinkActionTest extends BuildViewTestCase {
final PathFragment dynamicOutputPath = PathFragment.create("dummyRuleContext/output/path.so");
final Artifact staticOutputFile = getBinArtifactWithNoOwner(staticOutputPath.getPathString());
final Artifact dynamicOutputFile = getBinArtifactWithNoOwner(dynamicOutputPath.getPathString());
- final Artifact oFile = getSourceArtifact("cc/a.o");
- final Artifact oFile2 = getSourceArtifact("cc/a2.o");
final FeatureConfiguration featureConfiguration = getMockFeatureConfiguration();
ActionTester.runTest(
@@ -385,10 +375,6 @@ public class CppLinkActionTest extends BuildViewTestCase {
CppHelper.getFdoSupportUsingDefaultCcToolchainAttribute(ruleContext),
featureConfiguration,
MockCppSemantics.INSTANCE) {};
- builder.addCompilationInputs(
- attributes.contains(StaticKeyAttributes.COMPILATION_INPUTS)
- ? ImmutableList.of(oFile)
- : ImmutableList.of(oFile2));
builder.setLinkType(
attributes.contains(StaticKeyAttributes.OUTPUT_FILE)
? LinkTargetType.STATIC_LIBRARY