diff --git a/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java b/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java index 2678b055f1c6dc..0f45c0e0facfdb 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java +++ b/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java @@ -315,6 +315,10 @@ public String getExecPathString() { public PathFragment getExecPath() { return paramFileExecPath; } + + public ImmutableList getArguments() { + return ImmutableList.copyOf(arguments); + } } // Helper function to unpack the optimized storage format into a list diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java b/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java index 3423bcce80fce6..8d067ebc28f180 100644 --- a/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java +++ b/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java @@ -28,15 +28,33 @@ public class DummyExecutor implements Executor { private final FileSystem fileSystem; + private final BugReporter bugReporter; private final Path inputDir; private final ManualClock clock = new ManualClock(); @Nullable private final OptionsProvider optionsProvider; + @Nullable private final ShowSubcommands showSubcommands; public DummyExecutor( - FileSystem fileSystem, Path inputDir, @Nullable OptionsProvider optionsProvider) { + FileSystem fileSystem, + BugReporter bugReporter, + Path inputDir, + @Nullable OptionsProvider optionsProvider, + @Nullable ShowSubcommands showSubcommands) { this.fileSystem = fileSystem; + this.bugReporter = bugReporter; this.inputDir = inputDir; this.optionsProvider = optionsProvider; + this.showSubcommands = showSubcommands; + } + + public DummyExecutor( + FileSystem fileSystem, Path inputDir, @Nullable OptionsProvider optionsProvider) { + this( + fileSystem, + BugReporter.defaultInstance(), + inputDir, + optionsProvider, + /*showSubcommands=*/ null); } public DummyExecutor(FileSystem fileSystem, Path inputDir) { @@ -64,7 +82,7 @@ public Clock getClock() { @Override public BugReporter getBugReporter() { - return BugReporter.defaultInstance(); + return bugReporter; } @Override @@ -82,6 +100,9 @@ public OptionsProvider getOptions() { @Override public ShowSubcommands reportsSubcommands() { + if (showSubcommands != null) { + return showSubcommands; + } throw new UnsupportedOperationException(); } }