use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class RustBinaryIntegrationTest method simpleBinary.
@Test
public void simpleBinary() throws IOException, InterruptedException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_binary", tmp);
workspace.setUp();
workspace.runBuckBuild("//:xyzzy").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//:xyzzy");
workspace.resetBuildLogFile();
ProcessExecutor.Result result = workspace.runCommand(workspace.resolve("buck-out/gen/xyzzy#binary,default/xyzzy").toString());
assertThat(result.getExitCode(), Matchers.equalTo(0));
assertThat(result.getStdout().get(), Matchers.containsString("Hello, world!"));
assertThat(result.getStderr().get(), Matchers.blankString());
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class BuckBuildLogTest method testBuildLogParsing.
@Test
public void testBuildLogParsing() {
ImmutableList<String> buildLogLines = ImmutableList.of("735 INFO BuildRuleFinished(//example/base:one): " + "SUCCESS MISS BUILT_LOCALLY 489e1b85f804dc0f66545f2ce06f57ee85204747", "735 INFO BuildRuleFinished(//example/base:two): " + "FAIL MISS MISSING 489e1b85f804dc0f66545f2ce06f57ee85204747", "735 INFO BuildRuleFinished(//example/base:three): " + "SUCCESS MISS MATCHING_RULE_KEY 489e1b85f804dc0f66545f2ce06f57ee85204747");
BuckBuildLog buildLog = BuckBuildLog.fromLogContents(Paths.get("/spoof"), buildLogLines);
buildLog.assertTargetBuiltLocally("//example/base:one");
buildLog.assertTargetFailed("//example/base:two");
buildLog.assertTargetHadMatchingRuleKey("//example/base:three");
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class DBinaryIntegrationTest method xyzzy.
@Test
public void xyzzy() throws Exception {
Assumptions.assumeDCompilerUsable();
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_binary", tmp);
workspace.setUp();
workspace.runBuckBuild("-v", "10", "//:xyzzy").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//:xyzzy");
workspace.resetBuildLogFile();
ProcessExecutor.Result result = workspace.runCommand(workspace.resolve(BuildTargets.getGenPath(filesystem, BuildTargetFactory.newInstance("//:xyzzy").withFlavors(DBinaryDescription.BINARY_FLAVOR), "%s/xyzzy")).toString());
assertEquals(0, result.getExitCode());
assertEquals("Nothing happens.\n", result.getStdout().get());
assertEquals("", result.getStderr().get());
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class DLibraryIntegrationTest method compileAndRun.
@Test
public void compileAndRun() throws Exception {
Assumptions.assumeDCompilerUsable();
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "library", tmp);
workspace.setUp();
workspace.runBuckBuild("-v", "10", "//:greet").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//:greet");
buildLog.assertTargetBuiltLocally("//:greeting");
workspace.resetBuildLogFile();
ProcessExecutor.Result result = workspace.runCommand(workspace.resolve(BuildTargets.getGenPath(new FakeProjectFilesystem(), BuildTargetFactory.newInstance("//:greet").withFlavors(DBinaryDescription.BINARY_FLAVOR), "%s/greet")).toString());
assertEquals(0, result.getExitCode());
assertEquals("Hello, world!\n", result.getStdout().get());
assertEquals("", result.getStderr().get());
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class PrecompiledHeaderIntegrationTest method changingPchReferencedHeaderFromDependencyCausesLibraryToRecompile.
@Test
public void changingPchReferencedHeaderFromDependencyCausesLibraryToRecompile() throws Exception {
assumeTrue(Platform.detect() != Platform.WINDOWS);
workspace.runBuckBuild("//:some_binary#default").assertSuccess();
workspace.resetBuildLogFile();
workspace.writeContentsToPath("#pragma once\n#define REFERENCED_BY_PREFIX_HEADER_FROM_DEPENDENCY 3\n", "referenced_by_prefix_header_from_dependency.h");
workspace.runBuckBuild("//:some_binary#default").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally(findPchTarget().toString());
buildLog.assertTargetBuiltLocally("//:some_library#default,static");
}
Aggregations