Search in sources :

Example 6 with TestExecutorBuilder

use of com.google.devtools.build.lib.exec.util.TestExecutorBuilder in project bazel by bazelbuild.

the class TemplateExpansionActionTest method testExpansion.

@Test
public void testExpansion() throws Exception {
    Executor executor = new TestExecutorBuilder(directories, binTools).build();
    create().execute(createContext(executor));
    String content = new String(FileSystemUtils.readContentAsLatin1(output));
    String expected = Joiner.on('\n').join("key=foo", "value=bar");
    assertEquals(expected, content);
}
Also used : TestExecutorBuilder(com.google.devtools.build.lib.exec.util.TestExecutorBuilder) Executor(com.google.devtools.build.lib.actions.Executor) Test(org.junit.Test)

Example 7 with TestExecutorBuilder

use of com.google.devtools.build.lib.exec.util.TestExecutorBuilder in project bazel by bazelbuild.

the class TemplateExpansionActionTest method executeTemplateExpansion.

private void executeTemplateExpansion(String expected, List<Substitution> substitutions) throws Exception {
    Executor executor = new TestExecutorBuilder(directories, binTools).build();
    createWithArtifact(substitutions).execute(createContext(executor));
    String actual = FileSystemUtils.readContent(output, StandardCharsets.UTF_8);
    assertThat(actual).isEqualTo(expected);
}
Also used : TestExecutorBuilder(com.google.devtools.build.lib.exec.util.TestExecutorBuilder) Executor(com.google.devtools.build.lib.actions.Executor)

Aggregations

TestExecutorBuilder (com.google.devtools.build.lib.exec.util.TestExecutorBuilder)7 ActionExecutionContext (com.google.devtools.build.lib.actions.ActionExecutionContext)4 Executor (com.google.devtools.build.lib.actions.Executor)4 FileOutErr (com.google.devtools.build.lib.util.io.FileOutErr)3 Test (org.junit.Test)3 Before (org.junit.Before)2 EventBus (com.google.common.eventbus.EventBus)1 Artifact (com.google.devtools.build.lib.actions.Artifact)1 ArtifactExpander (com.google.devtools.build.lib.actions.Artifact.ArtifactExpander)1 SpecialArtifact (com.google.devtools.build.lib.actions.Artifact.SpecialArtifact)1 TreeFileArtifact (com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact)1 SpawnActionContext (com.google.devtools.build.lib.actions.SpawnActionContext)1 Event (com.google.devtools.build.lib.events.Event)1 Reporter (com.google.devtools.build.lib.events.Reporter)1 StoredEventHandler (com.google.devtools.build.lib.events.StoredEventHandler)1 OptionsParser (com.google.devtools.common.options.OptionsParser)1 Collection (java.util.Collection)1