aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2017-08-09 18:14:53 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-08-10 13:47:52 +0200
commit3f4bd84e9230b89d2cea120dec9c23e9a79f5be7 (patch)
tree6a21c05e21abf7b3261d4f25a5a6d20729c572eb /src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java
parentdcf368372198c1a317f755f5ec6a25a158de6fda (diff)
Defer expansion of certain proto command line string arguments.
Memory is saved by sharing the format string and label object instances, instead of constructing new strings for each action. RELNOTES: None PiperOrigin-RevId: 164731899
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java b/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java
index cf5d86a9e0..2cf4e1b36b 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java
@@ -17,7 +17,6 @@ package com.google.devtools.build.lib.rules.proto;
import static com.google.common.truth.Truth.assertThat;
import static com.google.devtools.build.lib.collect.nestedset.Order.STABLE_ORDER;
import static com.google.devtools.build.lib.rules.proto.ProtoCompileActionBuilder.createCommandLineFromToolchains;
-import static com.google.devtools.build.lib.rules.proto.ProtoCompileActionBuilder.createStrictProtoDepsViolationErrorMessage;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
@@ -91,7 +90,7 @@ public class ProtoCompileActionBuilderTest {
supportData.getDirectProtoSources(),
supportData.getTransitiveImports(),
null /* protosInDirectDeps */,
- "//foo:bar",
+ Label.parseAbsoluteUnchecked("//foo:bar"),
true /* allowServices */,
ImmutableList.<String>of() /* protocOpts */);
@@ -123,7 +122,7 @@ public class ProtoCompileActionBuilderTest {
supportData.getDirectProtoSources(),
supportData.getTransitiveImports(),
null /* protosInDirectDeps */,
- "//foo:bar",
+ Label.parseAbsoluteUnchecked("//foo:bar"),
true /* allowServices */,
ImmutableList.<String>of() /* protocOpts */);
@@ -156,7 +155,7 @@ public class ProtoCompileActionBuilderTest {
supportData.getDirectProtoSources(),
supportData.getTransitiveImports(),
supportData.getProtosInDirectDeps(),
- "//foo:bar",
+ Label.parseAbsoluteUnchecked("//foo:bar"),
true /* allowServices */,
ImmutableList.<String>of() /* protocOpts */);
@@ -166,7 +165,7 @@ public class ProtoCompileActionBuilderTest {
"-Iimport1.proto=import1.proto",
"-Iimport2.proto=import2.proto",
"--direct_dependencies=import1.proto",
- createStrictProtoDepsViolationErrorMessage("//foo:bar"),
+ String.format(ProtoCompileActionBuilder.STRICT_DEPS_FLAG_TEMPLATE, "//foo:bar"),
"source_file.proto")
.inOrder();
}
@@ -187,7 +186,7 @@ public class ProtoCompileActionBuilderTest {
supportData.getDirectProtoSources(),
supportData.getTransitiveImports(),
supportData.getProtosInDirectDeps(),
- "//foo:bar",
+ Label.parseAbsoluteUnchecked("//foo:bar"),
false /* allowServices */,
ImmutableList.of("--foo", "--bar") /* protocOpts */);
@@ -229,7 +228,7 @@ public class ProtoCompileActionBuilderTest {
supportData.getDirectProtoSources(),
supportData.getTransitiveImports(),
supportData.getProtosInDirectDeps(),
- "//foo:bar",
+ Label.parseAbsoluteUnchecked("//foo:bar"),
true /* allowServices */,
ImmutableList.<String>of() /* protocOpts */);
@@ -274,7 +273,7 @@ public class ProtoCompileActionBuilderTest {
supportData.getDirectProtoSources(),
supportData.getTransitiveImports(),
supportData.getProtosInDirectDeps(),
- "//foo:bar",
+ Label.parseAbsoluteUnchecked("//foo:bar"),
true /* allowServices */,
ImmutableList.<String>of() /* protocOpts */);
fail("Expected an exception");