aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2018-02-08 05:26:53 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-08 05:28:55 -0800
commit943afc78c1170e93e154edd1ef17389bae248e6b (patch)
tree0933bf969f30849e7b09407095e73a5ac7b53440 /src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
parentb116240ea496b95f8846abd76f29416b0bdc9cc9 (diff)
Introduce -c source_file -o output_file build variables
Prior to this cl CompileCommandLine would (almost) unconditionally emit -c and -o flags. This cl removes this logic and relies on crosstool to emit these flags. This is another small step towards platform independent C++ rules. Memory use is not affected, since the build variables used by this cl are already exposed, this cl just forces crosstools to use it. Encore of https://github.com/bazelbuild/bazel/commit/f26e8694ae78599b3e2004e3360eaf3443fa53a6. RELNOTES: None. PiperOrigin-RevId: 184981106
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
index 513b64269a..7622fb3f03 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
@@ -91,7 +91,7 @@ public class CompileCommandLineTest extends BuildViewTestCase {
" }",
"}"))
.build();
- assertThat(compileCommandLine.getArgv(scratchArtifact("a/FakeOutput").getExecPath(), null))
+ assertThat(compileCommandLine.getArguments(/* overwrittenVariables= */ null))
.contains("-some_foo_flag");
}
@@ -133,13 +133,12 @@ public class CompileCommandLineTest extends BuildViewTestCase {
"}"))
.setCoptsFilter(CoptsFilter.fromRegex(Pattern.compile(".*i_am_a_flag.*")))
.build();
- return compileCommandLine.getArgv(scratchArtifact("a/FakeOutput").getExecPath(), null);
+ return compileCommandLine.getArguments(/* overwrittenVariables= */ null);
}
private Builder makeCompileCommandLineBuilder() throws Exception {
return CompileCommandLine.builder(
scratchArtifact("a/FakeInput"),
- scratchArtifact("a/FakeOutput"),
CoptsFilter.alwaysPasses(),
"c++-compile",
getTargetConfiguration().getFragment(CppConfiguration.class).getCrosstoolTopPathFragment(),