use of com.facebook.buck.step.fs.SymlinkTreeStep in project buck by facebook.
the class GoTest method runTests.
@Override
public ImmutableList<Step> runTests(ExecutionContext executionContext, TestRunningOptions options, SourcePathResolver pathResolver, TestReportingCallback testReportingCallback) {
Optional<Long> processTimeoutMs = testRuleTimeoutMs.isPresent() ? Optional.of(testRuleTimeoutMs.get() + PROCESS_TIMEOUT_EXTRA_MS) : Optional.empty();
ImmutableList.Builder<String> args = ImmutableList.builder();
args.addAll(testMain.getExecutableCommand().getCommandPrefix(pathResolver));
args.add("-test.v");
if (testRuleTimeoutMs.isPresent()) {
args.add("-test.timeout", testRuleTimeoutMs.get() + "ms");
}
return ImmutableList.of(new MakeCleanDirectoryStep(getProjectFilesystem(), getPathToTestOutputDirectory()), new MakeCleanDirectoryStep(getProjectFilesystem(), getPathToTestWorkingDirectory()), new SymlinkTreeStep(getProjectFilesystem(), getPathToTestWorkingDirectory(), ImmutableMap.copyOf(FluentIterable.from(resources).transform(input -> Maps.immutableEntry(getProjectFilesystem().getPath(pathResolver.getSourcePathName(getBuildTarget(), input)), pathResolver.getAbsolutePath(input))))), new GoTestStep(getProjectFilesystem(), getPathToTestWorkingDirectory(), args.build(), testMain.getExecutableCommand().getEnvironment(pathResolver), getPathToTestExitCode(), processTimeoutMs, getPathToTestResults()));
}
use of com.facebook.buck.step.fs.SymlinkTreeStep in project buck by facebook.
the class HeaderSymlinkTreeWithHeaderMapTest method testSymlinkTreeBuildSteps.
@Test
public void testSymlinkTreeBuildSteps() throws IOException {
BuildContext buildContext = FakeBuildContext.withSourcePathResolver(resolver);
ProjectFilesystem filesystem = new FakeProjectFilesystem();
FakeBuildableContext buildableContext = new FakeBuildableContext();
ImmutableList<Step> expectedBuildSteps = ImmutableList.of(new MakeCleanDirectoryStep(filesystem, symlinkTreeRoot), new SymlinkTreeStep(filesystem, symlinkTreeRoot, resolver.getMappedPaths(links)), new HeaderMapStep(filesystem, HeaderSymlinkTreeWithHeaderMap.getPath(filesystem, buildTarget), ImmutableMap.of(Paths.get("file"), filesystem.getBuckPaths().getBuckOut().relativize(symlinkTreeRoot).resolve("file"), Paths.get("directory/then/file"), filesystem.getBuckPaths().getBuckOut().relativize(symlinkTreeRoot).resolve("directory/then/file"))));
ImmutableList<Step> actualBuildSteps = symlinkTreeBuildRule.getBuildSteps(buildContext, buildableContext);
assertEquals(expectedBuildSteps, actualBuildSteps.subList(1, actualBuildSteps.size()));
}
use of com.facebook.buck.step.fs.SymlinkTreeStep in project buck by facebook.
the class SymlinkTreeTest method testSymlinkTreeBuildSteps.
@Test
public void testSymlinkTreeBuildSteps() throws IOException {
// Create the fake build contexts.
BuildContext buildContext = FakeBuildContext.withSourcePathResolver(pathResolver);
FakeBuildableContext buildableContext = new FakeBuildableContext();
ProjectFilesystem filesystem = FakeProjectFilesystem.createJavaOnlyFilesystem();
// Verify the build steps are as expected.
ImmutableList<Step> expectedBuildSteps = ImmutableList.of(new MakeCleanDirectoryStep(filesystem, outputPath), new SymlinkTreeStep(filesystem, outputPath, pathResolver.getMappedPaths(links)));
ImmutableList<Step> actualBuildSteps = symlinkTreeBuildRule.getBuildSteps(buildContext, buildableContext);
assertEquals(expectedBuildSteps, actualBuildSteps.subList(1, actualBuildSteps.size()));
}
Aggregations