use of com.google.devtools.build.lib.exec.util.TestExecutorBuilder in project bazel by bazelbuild.
the class SymlinkActionTest method testSymlink.
@Test
public void testSymlink() throws Exception {
Executor executor = new TestExecutorBuilder(directories, null).build();
action.execute(new ActionExecutionContext(executor, null, null, null, ImmutableMap.<String, String>of(), null));
assertTrue(output.isSymbolicLink());
assertEquals(input, output.resolveSymbolicLinks());
assertEquals(inputArtifact, action.getPrimaryInput());
assertEquals(outputArtifact, action.getPrimaryOutput());
}
use of com.google.devtools.build.lib.exec.util.TestExecutorBuilder in project bazel by bazelbuild.
the class ParamFileWriteActionTest method actionExecutionContext.
private ActionExecutionContext actionExecutionContext() throws Exception {
final Iterable<TreeFileArtifact> treeFileArtifacts = ImmutableList.of(createTreeFileArtifact(treeArtifact, "artifacts/treeFileArtifact1"), createTreeFileArtifact(treeArtifact, "artifacts/treeFileArtifact2"));
ArtifactExpander artifactExpander = new ArtifactExpander() {
@Override
public void expand(Artifact artifact, Collection<? super Artifact> output) {
for (TreeFileArtifact treeFileArtifact : treeFileArtifacts) {
if (treeFileArtifact.getParent().equals(artifact)) {
output.add(treeFileArtifact);
}
}
}
};
Executor executor = new TestExecutorBuilder(directories, binTools).build();
return new ActionExecutionContext(executor, null, null, new FileOutErr(), ImmutableMap.<String, String>of(), artifactExpander);
}
use of com.google.devtools.build.lib.exec.util.TestExecutorBuilder in project bazel by bazelbuild.
the class BlazeExecutorTest method testDebugPrintActionContexts.
@Test
public void testDebugPrintActionContexts() throws Exception {
TestExecutorBuilder builder = new TestExecutorBuilder(directories, binTools);
OptionsParser parser = OptionsParser.newOptionsParser(TestExecutorBuilder.DEFAULT_OPTIONS);
parser.parse("--debug_print_action_contexts");
Reporter reporter = new Reporter(new EventBus());
StoredEventHandler storedEventHandler = new StoredEventHandler();
reporter.addHandler(storedEventHandler);
SpawnActionContext mockStrategy = Mockito.mock(SpawnActionContext.class);
builder.setReporter(reporter).setOptionsParser(parser).setExecution("mock", mockStrategy);
builder.build();
Event event = Iterables.find(storedEventHandler.getEvents(), new Predicate<Event>() {
@Override
public boolean apply(@Nullable Event event) {
return event.getMessage().contains("SpawnActionContextMap: \"mock\" = ");
}
});
assertThat(event).isNotNull();
assertThat(event.getMessage()).contains("\"mock\" = " + mockStrategy.getClass().getSimpleName());
}
use of com.google.devtools.build.lib.exec.util.TestExecutorBuilder in project bazel by bazelbuild.
the class LTOBackendActionTest method createExecutorAndContext.
@Before
public final void createExecutorAndContext() throws Exception {
executor = new TestExecutorBuilder(directories, binTools).build();
context = new ActionExecutionContext(executor, null, null, new FileOutErr(), ImmutableMap.<String, String>of(), null);
}
use of com.google.devtools.build.lib.exec.util.TestExecutorBuilder in project bazel by bazelbuild.
the class FileWriteActionTestCase method createExecutorAndContext.
@Before
public final void createExecutorAndContext() throws Exception {
executor = new TestExecutorBuilder(directories, binTools).build();
context = new ActionExecutionContext(executor, null, null, new FileOutErr(), ImmutableMap.<String, String>of(), null);
}
Aggregations