use of com.google.devtools.build.lib.actions.util.DummyExecutor in project bazel by bazelbuild.
the class ExecutableSymlinkActionTest method createExecutor.
@Before
public final void createExecutor() throws Exception {
final Path inputDir = scratch.dir("/in");
inputRoot = Root.asDerivedRoot(inputDir);
outputRoot = Root.asDerivedRoot(scratch.dir("/out"));
outErr = new TestFileOutErr();
executor = new DummyExecutor(inputDir);
}
use of com.google.devtools.build.lib.actions.util.DummyExecutor in project bazel by bazelbuild.
the class ActionDataTest method testArgumentToBuildArtifactsIsPassedDownToAction.
@Test
public void testArgumentToBuildArtifactsIsPassedDownToAction() throws Exception {
class MyAction extends AbstractAction {
Object executor = null;
public MyAction(Collection<Artifact> outputs) {
super(ActionsTestUtil.NULL_ACTION_OWNER, ImmutableList.<Artifact>of(), outputs);
}
@Override
public void execute(ActionExecutionContext actionExecutionContext) throws ActionExecutionException {
this.executor = actionExecutionContext.getExecutor();
try {
FileSystemUtils.createEmptyFile(getPrimaryOutput().getPath());
} catch (IOException e) {
throw new ActionExecutionException("failed: ", e, this, false);
}
}
@Override
protected String computeKey() {
return "MyAction";
}
@Override
public String getMnemonic() {
return "MyAction";
}
}
Artifact output = createDerivedArtifact("foo");
Set<Artifact> outputs = Sets.newHashSet(output);
MyAction action = new MyAction(outputs);
registerAction(action);
Executor executor = new DummyExecutor(scratch.dir("/"));
amnesiacBuilder().buildArtifacts(reporter, outputs, null, null, null, null, executor, null, /*explain=*/
false, null, null);
assertSame(executor, action.executor);
executor = new DummyExecutor(scratch.dir("/"));
amnesiacBuilder().buildArtifacts(reporter, outputs, null, null, null, null, executor, null, /*explain=*/
false, null, null);
assertSame(executor, action.executor);
}
Aggregations