aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/commands
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-02-27 13:08:48 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-03-04 15:38:03 +0000
commit418f4ca6b4991ec51fae7a36b7d13fde5f0d96db (patch)
tree7247fd7283fd7e18df6c306b19b0d001bd42a913 /src/main/java/com/google/devtools/build/lib/runtime/commands
parentca3cf535bfe17dade9f6c78d1eded301a54075cd (diff)
Remove --compile_only and --compilation_prerequisites_only; --output_groups can be used in their stead.
-- MOS_MIGRATED_REVID=87334648
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java32
2 files changed, 17 insertions, 21 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
index b128d372ab..472b8d6741 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
@@ -144,12 +144,6 @@ public class RunCommand implements BlazeCommand {
this.getClass().getAnnotation(Command.class).name(), options,
runtime.getStartupOptionsProvider(), targets, outErr,
runtime.getCommandId(), runtime.getCommandStartTime());
- if (request.getBuildOptions().compileOnly) {
- String message = "The '" + getClass().getAnnotation(Command.class).name() +
- "' command is incompatible with the --compile_only option";
- runtime.getReporter().handle(Event.error(message));
- return ExitCode.COMMAND_LINE_ERROR;
- }
currentRunUnder = runUnder;
BuildResult result;
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java
index 561c54a5b2..094add61a3 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java
@@ -16,6 +16,8 @@ package com.google.devtools.build.lib.runtime.commands;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
+import com.google.devtools.build.lib.analysis.TopLevelArtifactProvider;
+import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
import com.google.devtools.build.lib.buildtool.BuildRequest;
import com.google.devtools.build.lib.buildtool.BuildResult;
import com.google.devtools.build.lib.events.Event;
@@ -62,17 +64,23 @@ public class TestCommand implements BlazeCommand {
TestOutputFormat testOutput = optionsParser.getOptions(ExecutionOptions.class).testOutput;
- if (testOutput == TestStrategy.TestOutputFormat.STREAMED) {
- runtime.getReporter().handle(Event.warn(
- "Streamed test output requested so all tests will be run locally, without sharding, " +
- "one at a time"));
- try {
+ try {
+ if (testOutput == TestStrategy.TestOutputFormat.STREAMED) {
+ runtime.getReporter().handle(Event.warn(
+ "Streamed test output requested so all tests will be run locally, without sharding, " +
+ "one at a time"));
+ optionsParser.parse(OptionPriority.SOFTWARE_REQUIREMENT,
+ "streamed output requires locally run tests, without sharding",
+ ImmutableList.of("--test_sharding_strategy=disabled", "--test_strategy=exclusive"));
+ }
+
+ if (optionsParser.getOptions(BuildConfiguration.Options.class).collectCodeCoverage) {
optionsParser.parse(OptionPriority.SOFTWARE_REQUIREMENT,
- "streamed output requires locally run tests, without sharding",
- ImmutableList.of("--test_sharding_strategy=disabled", "--test_strategy=exclusive"));
- } catch (OptionsParsingException e) {
- throw new IllegalStateException("Known options failed to parse", e);
+ "baseline coverage artifacts are built with running tests with coverage collection",
+ ImmutableList.of("--output_groups=" + TopLevelArtifactProvider.BASELINE_COVERAGE));
}
+ } catch (OptionsParsingException e) {
+ throw new IllegalStateException("Known options failed to parse", e);
}
}
@@ -104,12 +112,6 @@ public class TestCommand implements BlazeCommand {
getClass().getAnnotation(Command.class).name(), options,
runtime.getStartupOptionsProvider(), targets,
runtime.getReporter().getOutErr(), runtime.getCommandId(), runtime.getCommandStartTime());
- if (request.getBuildOptions().compileOnly) {
- String message = "The '" + getClass().getAnnotation(Command.class).name() +
- "' command is incompatible with the --compile_only option";
- runtime.getReporter().handle(Event.error(message));
- return ExitCode.COMMAND_LINE_ERROR;
- }
request.setRunTests();
BuildResult buildResult = runtime.getBuildTool().processRequest(request, null);