use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class PrecompiledHeaderIntegrationTest method changingPrefixHeaderCausesRecompile.
@Test
public void changingPrefixHeaderCausesRecompile() throws Exception {
assumeTrue(Platform.detect() != Platform.WINDOWS);
workspace.runBuckBuild("//:some_binary#default").assertSuccess();
workspace.resetBuildLogFile();
workspace.writeContentsToPath("#pragma once\n" + "#include <stdio.h>\n" + "#include \"referenced_by_prefix_header.h\"\n" + "#include <referenced_by_prefix_header_from_dependency.h>\n" + "#define FOO 100\n", "prefix_header.h");
workspace.runBuckBuild("//:some_binary#default").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally(findPchTarget().toString());
buildLog.assertTargetBuiltLocally("//:some_library#default,static");
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidReactNativeLibraryIntegrationTest method testEditingUnusedJSFileHitsInCache.
@Test
public void testEditingUnusedJSFileHitsInCache() throws IOException {
workspace.enableDirCache();
workspace.runBuckBuild("-c", "build.depfiles=cache", "//apps/sample:app").assertSuccess();
workspace.runBuckCommand("clean");
workspace.replaceFileContents("js/app/unused.js", "anotherFunction", "someOtherFunction");
workspace.runBuckBuild("-c", "build.depfiles=cache", "//apps/sample:app").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
assertThat(buildLog.getLogEntry("//js:app#bundle,dev").getSuccessType(), Matchers.equalTo(Optional.of(BuildRuleSuccessType.FETCHED_FROM_CACHE_MANIFEST_BASED)));
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidReactNativeLibraryIntegrationTest method testEditingImageRebuildsAndroidResource.
@Test
public void testEditingImageRebuildsAndroidResource() throws IOException {
workspace.runBuckBuild("//apps/sample:app").assertSuccess();
workspace.copyFile("js/app/image@1.5x.png", "js/app/image@2x.png");
workspace.resetBuildLogFile();
workspace.runBuckBuild("//apps/sample:app").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//js:app#dev,android_res");
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class OCamlIntegrationTest method testLexAndYaccBuild.
@Test
public void testLexAndYaccBuild() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "ocaml", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance(workspace.getDestPath(), "//calc:calc");
BuildTarget binary = createOcamlLinkTarget(target);
ImmutableSet<BuildTarget> targets = ImmutableSet.of(target, binary);
workspace.runBuckCommand("build", target.toString()).assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
assertEquals(targets, buildLog.getAllTargets());
buildLog.assertTargetBuiltLocally(target.toString());
buildLog.assertTargetBuiltLocally(binary.toString());
workspace.resetBuildLogFile();
workspace.runBuckCommand("build", target.toString()).assertSuccess();
buildLog = workspace.getBuildLog();
assertEquals(ImmutableSet.of(binary, target), buildLog.getAllTargets());
buildLog.assertTargetHadMatchingRuleKey(binary.toString());
buildLog.assertTargetHadMatchingRuleKey(target.toString());
workspace.resetBuildLogFile();
workspace.replaceFileContents("calc/lexer.mll", "The type token", "the type token");
workspace.runBuckCommand("build", target.toString()).assertSuccess();
buildLog = workspace.getBuildLog();
assertEquals(targets, buildLog.getAllTargets());
buildLog.assertTargetBuiltLocally(target.toString());
buildLog.assertTargetBuiltLocally(binary.toString());
workspace.resetBuildLogFile();
workspace.replaceFileContents("calc/parser.mly", "the entry point", "The entry point");
workspace.runBuckCommand("build", target.toString()).assertSuccess();
buildLog = workspace.getBuildLog();
assertEquals(targets, buildLog.getAllTargets());
buildLog.assertTargetBuiltLocally(target.toString());
buildLog.assertTargetBuiltLocally(binary.toString());
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class OCamlIntegrationTest method testCompilerFlagsDependency.
@Test
public void testCompilerFlagsDependency() throws IOException, InterruptedException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "compiler_flag_macros", tmp);
workspace.setUp();
String ocamlVersion = this.getOcamlVersion(workspace);
assumeTrue("Installed ocaml is too old for this test", "4.02.0".compareTo(ocamlVersion) <= 0);
BuildTarget binary = BuildTargetFactory.newInstance(workspace.getDestPath(), "//:main");
BuildTarget lib = BuildTargetFactory.newInstance(workspace.getDestPath(), "//:lib");
BuildTarget helper = BuildTargetFactory.newInstance(workspace.getDestPath(), "//:test");
ImmutableSet<BuildTarget> targets = ImmutableSet.of(binary, lib, helper);
// Build the binary.
workspace.runBuckCommand("build", binary.toString()).assertSuccess();
// Make sure the helper target is built as well.
BuckBuildLog buildLog = workspace.getBuildLog();
assertTrue(buildLog.getAllTargets().containsAll(targets));
buildLog.assertTargetBuiltLocally(binary.toString());
// Make sure the ppx flag worked
String out = workspace.runBuckCommand("run", binary.toString()).getStdout();
assertEquals("42!\n", out);
}
Aggregations