|
33 | 33 | import com.google.devtools.build.lib.actions.ActionResult;
|
34 | 34 | import com.google.devtools.build.lib.actions.Artifact;
|
35 | 35 | import com.google.devtools.build.lib.actions.ArtifactPathResolver;
|
| 36 | +import com.google.devtools.build.lib.actions.CommandAction; |
36 | 37 | import com.google.devtools.build.lib.actions.CommandLineExpansionException;
|
37 | 38 | import com.google.devtools.build.lib.actions.EnvironmentalExecException;
|
38 | 39 | import com.google.devtools.build.lib.actions.ExecException;
|
|
51 | 52 | import com.google.devtools.build.lib.buildeventstream.TestFileNameConstants;
|
52 | 53 | import com.google.devtools.build.lib.cmdline.Label;
|
53 | 54 | import com.google.devtools.build.lib.collect.ImmutableIterable;
|
| 55 | +import com.google.devtools.build.lib.exec.TestStrategy; |
54 | 56 | import com.google.devtools.build.lib.util.Fingerprint;
|
55 | 57 | import com.google.devtools.build.lib.util.LoggingUtil;
|
56 | 58 | import com.google.devtools.build.lib.util.Pair;
|
|
76 | 78 | */
|
77 | 79 | // Not final so that we can mock it in tests.
|
78 | 80 | public class TestRunnerAction extends AbstractAction
|
79 |
| - implements NotifyOnActionCacheHit, ExecutionInfoSpecifier { |
| 81 | + implements NotifyOnActionCacheHit, ExecutionInfoSpecifier, CommandAction { |
80 | 82 | public static final PathFragment COVERAGE_TMP_ROOT = PathFragment.create("_coverage");
|
81 | 83 |
|
82 | 84 | // Used for selecting subset of testcase / testmethods.
|
@@ -870,6 +872,22 @@ public boolean isEnableRunfiles() {
|
870 | 872 | return configuration.runfilesEnabled();
|
871 | 873 | }
|
872 | 874 |
|
| 875 | + @Override |
| 876 | + public List<String> getArguments() throws CommandLineExpansionException { |
| 877 | + return TestStrategy.expandedArgsFromAction(this); |
| 878 | + } |
| 879 | + |
| 880 | + @Override |
| 881 | + public ImmutableMap<String, String> getIncompleteEnvironmentForTesting() |
| 882 | + throws ActionExecutionException { |
| 883 | + return getEnvironment().getFixedEnv().toMap(); |
| 884 | + } |
| 885 | + |
| 886 | + @Override |
| 887 | + public Iterable<Artifact> getPossibleInputsForTesting() { |
| 888 | + return getInputs(); |
| 889 | + } |
| 890 | + |
873 | 891 | /** The same set of paths as the parent test action, resolved against a given exec root. */
|
874 | 892 | public final class ResolvedPaths {
|
875 | 893 | private final Path execRoot;
|
|
0 commit comments