use of com.google.devtools.build.lib.actions.Spawn in project bazel by bazelbuild.
the class StandaloneSpawnStrategyTest method testBinTrueExecutesFine.
@Test
public void testBinTrueExecutesFine() throws Exception {
Spawn spawn = createSpawn(getTrueCommand());
executor.getSpawnActionContext(spawn.getMnemonic()).exec(spawn, createContext());
assertThat(out()).isEmpty();
assertThat(err()).isEmpty();
}
use of com.google.devtools.build.lib.actions.Spawn in project bazel by bazelbuild.
the class StandaloneSpawnStrategyTest method testBinEchoPrintsArguments.
@Test
public void testBinEchoPrintsArguments() throws Exception {
Spawn spawn = createSpawn("/bin/echo", "Hello,", "world.");
run(spawn);
assertEquals("Hello, world.\n", out());
assertThat(err()).isEmpty();
}
use of com.google.devtools.build.lib.actions.Spawn in project bazel by bazelbuild.
the class SpawnGccStrategy method execWithReply.
@Override
public CppCompileActionContext.Reply execWithReply(CppCompileAction action, ActionExecutionContext actionExecutionContext) throws ExecException, InterruptedException {
if (action.getDotdFile() != null && action.getDotdFile().artifact() == null) {
throw new UserExecException("cannot execute remotely or locally: " + action.getPrimaryInput().getExecPathString());
}
Iterable<Artifact> inputs = Iterables.concat(action.getInputs(), action.getAdditionalInputs());
Spawn spawn = new SimpleSpawn(action, ImmutableList.copyOf(action.getArgv()), ImmutableMap.copyOf(action.getEnvironment()), ImmutableMap.copyOf(action.getExecutionInfo()), EmptyRunfilesSupplier.INSTANCE, ImmutableList.<Artifact>copyOf(inputs), /*tools=*/
ImmutableList.<Artifact>of(), /*filesetManifests=*/
ImmutableList.<Artifact>of(), action.getOutputs().asList(), action.estimateResourceConsumptionLocal());
actionExecutionContext.getExecutor().getSpawnActionContext(action.getMnemonic()).exec(spawn, actionExecutionContext);
return null;
}
Aggregations