use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.
the class CustomCommandLineTest method testCustomMultiArgs.
@Test
public void testCustomMultiArgs() {
CustomCommandLine cl = CustomCommandLine.builder().add(new CustomMultiArgv() {
@Override
public ImmutableList<String> argv() {
return ImmutableList.of("--arg1", "--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 testPathArgs.
@Test
public void testPathArgs() {
CustomCommandLine cl = CustomCommandLine.builder().addPath(artifact1.getExecPath()).build();
assertEquals(ImmutableList.of("dir/file1.txt"), cl.arguments());
}
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());
}
Aggregations