aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r--src/test/java/com/google/devtools/build/lib/BUILD1
-rw-r--r--src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java35
2 files changed, 19 insertions, 17 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/BUILD b/src/test/java/com/google/devtools/build/lib/BUILD
index 1502f25437..52c95b19cc 100644
--- a/src/test/java/com/google/devtools/build/lib/BUILD
+++ b/src/test/java/com/google/devtools/build/lib/BUILD
@@ -1196,6 +1196,7 @@ java_test(
":guava_junit_truth",
":test_runner",
":testutil",
+ "//src/main/java/com/google/devtools/build/lib:bazel-modules",
"//src/main/java/com/google/devtools/build/lib:bazel-rules",
"//src/main/java/com/google/devtools/build/lib:build-base",
"//src/main/java/com/google/devtools/build/lib:io",
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java b/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java
index 71ad575314..228669b3c1 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java
@@ -17,6 +17,7 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.common.io.BaseEncoding;
+import com.google.devtools.build.lib.bazel.BazelStartupOptionsModule.Options;
import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.BuildEventId.StructuredCommandLineId;
import com.google.devtools.build.lib.runtime.CommandLineEvent.CanonicalCommandLineEvent;
import com.google.devtools.build.lib.runtime.CommandLineEvent.OriginalCommandLineEvent;
@@ -102,11 +103,11 @@ public class CommandLineEventTest {
}
@Test
- public void testActiveBlazercs_OriginalCommandLine() throws OptionsParsingException {
+ public void testActiveBazelrcs_OriginalCommandLine() throws OptionsParsingException {
OptionsParser fakeStartupOptions =
- OptionsParser.newOptionsParser(BlazeServerStartupOptions.class);
+ OptionsParser.newOptionsParser(BlazeServerStartupOptions.class, Options.class);
fakeStartupOptions.parse(
- "--blazerc=/some/path", "--master_blazerc", "--blazerc", "/some/other/path");
+ "--bazelrc=/some/path", "--master_bazelrc", "--bazelrc", "/some/other/path");
OptionsParser fakeCommandOptions = OptionsParser.newOptionsParser(TestOptions.class);
CommandLine line =
@@ -127,20 +128,20 @@ public class CommandLineEventTest {
assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze");
assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(3);
assertThat(line.getSections(1).getOptionList().getOption(0).getCombinedForm())
- .isEqualTo("--blazerc=/some/path");
+ .isEqualTo("--bazelrc=/some/path");
assertThat(line.getSections(1).getOptionList().getOption(1).getCombinedForm())
- .isEqualTo("--master_blazerc");
+ .isEqualTo("--master_bazelrc");
assertThat(line.getSections(1).getOptionList().getOption(2).getCombinedForm())
- .isEqualTo("--blazerc /some/other/path");
+ .isEqualTo("--bazelrc /some/other/path");
assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName");
assertThat(line.getSections(3).getOptionList().getOptionCount()).isEqualTo(0);
assertThat(line.getSections(4).getChunkList().getChunkCount()).isEqualTo(0);
}
@Test
- public void testPassedInBlazercs_OriginalCommandLine() throws OptionsParsingException {
+ public void testPassedInBazelrcs_OriginalCommandLine() throws OptionsParsingException {
OptionsParser fakeStartupOptions =
- OptionsParser.newOptionsParser(BlazeServerStartupOptions.class);
+ OptionsParser.newOptionsParser(BlazeServerStartupOptions.class, Options.class);
OptionsParser fakeCommandOptions = OptionsParser.newOptionsParser(TestOptions.class);
CommandLine line =
@@ -151,9 +152,9 @@ public class CommandLineEventTest {
fakeCommandOptions,
Optional.of(
ImmutableList.of(
- Pair.of("", "--blazerc=/some/path"),
- Pair.of("", "--master_blazerc"),
- Pair.of("", "--blazerc=/some/other/path"),
+ Pair.of("", "--bazelrc=/some/path"),
+ Pair.of("", "--master_bazelrc"),
+ Pair.of("", "--bazelrc=/some/other/path"),
Pair.of("", "--invocation_policy=notARealPolicy"))))
.asStreamProto(null)
.getStructuredCommandLine();
@@ -166,11 +167,11 @@ public class CommandLineEventTest {
assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze");
assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(4);
assertThat(line.getSections(1).getOptionList().getOption(0).getCombinedForm())
- .isEqualTo("--blazerc=/some/path");
+ .isEqualTo("--bazelrc=/some/path");
assertThat(line.getSections(1).getOptionList().getOption(1).getCombinedForm())
- .isEqualTo("--master_blazerc");
+ .isEqualTo("--master_bazelrc");
assertThat(line.getSections(1).getOptionList().getOption(2).getCombinedForm())
- .isEqualTo("--blazerc=/some/other/path");
+ .isEqualTo("--bazelrc=/some/other/path");
assertThat(line.getSections(1).getOptionList().getOption(3).getCombinedForm())
.isEqualTo("--invocation_policy=notARealPolicy");
assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName");
@@ -179,11 +180,11 @@ public class CommandLineEventTest {
}
@Test
- public void testBlazercs_CanonicalCommandLine() throws OptionsParsingException {
+ public void testBazelrcs_CanonicalCommandLine() throws OptionsParsingException {
OptionsParser fakeStartupOptions =
- OptionsParser.newOptionsParser(BlazeServerStartupOptions.class);
+ OptionsParser.newOptionsParser(BlazeServerStartupOptions.class, Options.class);
fakeStartupOptions.parse(
- "--blazerc=/some/path", "--master_blazerc", "--blazerc", "/some/other/path");
+ "--bazelrc=/some/path", "--master_bazelrc", "--bazelrc", "/some/other/path");
OptionsParser fakeCommandOptions = OptionsParser.newOptionsParser(TestOptions.class);
CommandLine line =