diff options
author | hlopko <hlopko@google.com> | 2017-09-15 16:47:31 +0200 |
---|---|---|
committer | László Csomor <laszlocsomor@google.com> | 2017-09-18 11:26:59 +0200 |
commit | a22fb12669743bdfb78dfbf71a63db898f026dce (patch) | |
tree | 607ca980605626243dab3ecd6a7d07f1bca7f6b4 /src/test/java/com/google/devtools/build/lib/rules/cpp | |
parent | 394211bf88b88c25036429e99894fa7c60eaaace (diff) |
Automated rollback of commit f26e8694ae78599b3e2004e3360eaf3443fa53a6.
*** Reason for rollback ***
Breaks clang_tidy.
*** Original change description ***
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.
RELNOTES: None.
PiperOrigin-RevId: 168834576
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/cpp')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java | 14 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java | 5 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java index 51a46ccb62..3bde118ad4 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java @@ -369,19 +369,19 @@ public class CcCommonTest extends BuildViewTestCase { " srcs = [ 'library.cc' ],", " nocopts = '-fPIC')"); - assertThat(getCppCompileAction("//a:pic").getArguments()).contains("-fPIC"); - assertThat(getCppCompileAction("//a:libpic.so").getArguments()).contains("-fPIC"); - assertThat(getCppCompileAction("//a:piclib").getArguments()).contains("-fPIC"); - assertThat(getCppCompileAction("//a:nopic").getArguments()).doesNotContain("-fPIC"); - assertThat(getCppCompileAction("//a:libnopic.so").getArguments()).doesNotContain("-fPIC"); - assertThat(getCppCompileAction("//a:nopiclib").getArguments()).doesNotContain("-fPIC"); + assertThat(getCppCompileAction("//a:pic").getArgv()).contains("-fPIC"); + assertThat(getCppCompileAction("//a:libpic.so").getArgv()).contains("-fPIC"); + assertThat(getCppCompileAction("//a:piclib").getArgv()).contains("-fPIC"); + assertThat(getCppCompileAction("//a:nopic").getArgv()).doesNotContain("-fPIC"); + assertThat(getCppCompileAction("//a:libnopic.so").getArgv()).doesNotContain("-fPIC"); + assertThat(getCppCompileAction("//a:nopiclib").getArgv()).doesNotContain("-fPIC"); } @Test public void testPicModeAssembly() throws Exception { useConfiguration("--cpu=k8"); scratch.file("a/BUILD", "cc_library(name='preprocess', srcs=['preprocess.S'])"); - List<String> argv = getCppCompileAction("//a:preprocess").getArguments(); + List<String> argv = getCppCompileAction("//a:preprocess").getArgv(); assertThat(argv).contains("-fPIC"); } 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 93d1c69452..e0fd56322a 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 @@ -92,7 +92,7 @@ public class CompileCommandLineTest extends BuildViewTestCase { " }", "}")) .build(); - assertThat(compileCommandLine.getArguments(/* overwrittenVariables= */ null)) + assertThat(compileCommandLine.getArgv(scratchArtifact("a/FakeOutput").getExecPath(), null)) .contains("-some_foo_flag"); } @@ -134,12 +134,13 @@ public class CompileCommandLineTest extends BuildViewTestCase { "}")) .setCoptsFilter(flag -> !flag.contains("i_am_a_flag")) .build(); - return compileCommandLine.getArguments(/* overwrittenVariables= */ null); + return compileCommandLine.getArgv(scratchArtifact("a/FakeOutput").getExecPath(), null); } private Builder makeCompileCommandLineBuilder() throws Exception { return CompileCommandLine.builder( scratchArtifact("a/FakeInput"), + scratchArtifact("a/FakeOutput"), new Predicate<String>() { @Override public boolean apply(String s) { |