use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.
the class CustomCommandLineTest method testStringArgs.
@Test
public void testStringArgs() {
CustomCommandLine cl = CustomCommandLine.builder().add("--arg1").add("--arg2").build();
assertEquals(ImmutableList.of("--arg1", "--arg2"), cl.arguments());
}
use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.
the class CustomCommandLineTest method testAddNulls.
@Test
public void testAddNulls() {
CustomCommandLine cl = CustomCommandLine.builder().add("--args", null).addExecPaths(null, ImmutableList.of(artifact1)).addExecPath(null, null).build();
assertEquals(ImmutableList.of(), cl.arguments());
}
use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.
the class CustomCommandLineTest method testPathsArgs.
@Test
public void testPathsArgs() {
CustomCommandLine cl = CustomCommandLine.builder().addPaths("%s:%s", artifact1.getExecPath(), artifact1.getRootRelativePath()).build();
assertEquals(ImmutableList.of("dir/file1.txt:dir/file1.txt"), cl.arguments());
}
use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.
the class CustomCommandLineTest method testNestedSetArtifactExecPathsArgs.
@Test
public void testNestedSetArtifactExecPathsArgs() {
CustomCommandLine cl = CustomCommandLine.builder().addExecPaths(NestedSetBuilder.<Artifact>stableOrder().add(artifact1).add(artifact2).build()).build();
assertEquals(ImmutableList.of("dir/file1.txt", "dir/file2.txt"), cl.arguments());
}
use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.
the class CustomCommandLineTest method testArtifactJoinExecPathArgs.
@Test
public void testArtifactJoinExecPathArgs() {
CustomCommandLine cl = CustomCommandLine.builder().addJoinExecPaths("--path", ":", ImmutableList.of(artifact1, artifact2)).build();
assertEquals(ImmutableList.of("--path", "dir/file1.txt:dir/file2.txt"), cl.arguments());
}
Aggregations