use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidResourceFilterIntegrationTest method testStringArtifactsAreCached.
@Test
public void testStringArtifactsAreCached() throws IOException {
Assume.assumeFalse(true);
workspace.enableDirCache();
workspace.runBuckBuild("//apps/sample:app_comp_str").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
Sha1HashCode androidBinaryRuleKey = buildLog.getRuleKey("//apps/sample:app_comp_str");
ArtifactCache cache = TestArtifactCaches.createDirCacheForTest(workspace.getPath("."), filesystem.getBuckPaths().getCacheDir());
Path cachedFile = DirArtifactCacheTestUtil.getPathForRuleKey(cache, new RuleKey(androidBinaryRuleKey.getHash()), Optional.empty());
Files.delete(workspace.resolve(cachedFile));
workspace.runBuckCommand("clean").assertSuccess();
workspace.runBuckBuild("//apps/sample:app_comp_str").assertSuccess();
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidXmlFileIntegrationTest method testRenamingAStringInTransitiveDepResultsInAbiMatch.
@Test
public void testRenamingAStringInTransitiveDepResultsInAbiMatch() throws IOException {
workspace.replaceFileContents(PATH_TO_STRINGS_XML, "base_button", "base_text");
workspace.replaceFileContents(PATH_TO_LAYOUT_XML, "base_button", "base_text");
workspace.resetBuildLogFile();
ProjectWorkspace.ProcessResult result = workspace.runBuckBuild(MAIN_BUILD_TARGET);
result.assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//res/com/sample/base:base");
buildLog.assertTargetBuiltLocally("//res/com/sample/top:top");
buildLog.assertTargetHadMatchingInputRuleKey("//java/com/sample/lib:lib#dummy_r_dot_java");
buildLog.assertTargetHadMatchingInputRuleKey(MAIN_BUILD_TARGET);
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidXmlFileIntegrationTest method testAddingAStringToTransitiveDepResultsInAbiMatch.
@Test
public void testAddingAStringToTransitiveDepResultsInAbiMatch() throws IOException {
workspace.replaceFileContents(PATH_TO_STRINGS_XML, "</resources>", "<string name=\"base_text\">Goodbye!</string></resources>");
workspace.resetBuildLogFile();
ProjectWorkspace.ProcessResult result = workspace.runBuckBuild(MAIN_BUILD_TARGET);
result.assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//res/com/sample/base:base");
buildLog.assertTargetBuiltLocally("//res/com/sample/top:top");
buildLog.assertTargetHadMatchingInputRuleKey("//java/com/sample/lib:lib#dummy_r_dot_java");
buildLog.assertTargetHadMatchingInputRuleKey(MAIN_BUILD_TARGET);
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidXmlFileIntegrationTest method testEditingColorOnlyBuildsResourceRule.
@Test
public void testEditingColorOnlyBuildsResourceRule() throws IOException {
workspace.replaceFileContents(PATH_TO_LAYOUT_XML, "white", "black");
workspace.resetBuildLogFile();
ProjectWorkspace.ProcessResult result = workspace.runBuckBuild(MAIN_BUILD_TARGET);
result.assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetHadMatchingRuleKey("//res/com/sample/base:base");
buildLog.assertTargetBuiltLocally("//res/com/sample/top:top");
buildLog.assertTargetHadMatchingInputRuleKey("//java/com/sample/lib:lib#dummy_r_dot_java");
buildLog.assertTargetHadMatchingInputRuleKey(MAIN_BUILD_TARGET);
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AppleBundleIntegrationTest method appleBundleDoesNotPropagateIncludeFrameworkFlavors.
@Test
public void appleBundleDoesNotPropagateIncludeFrameworkFlavors() throws Exception {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_app_with_extension", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//:DemoAppWithExtension#no-debug");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", "--show-output", target.getFullyQualifiedName());
result.assertSuccess();
BuckBuildLog buckBuildLog = workspace.getBuildLog();
ImmutableSet<String> targetsThatShouldContainIncludeFrameworkFlavors = ImmutableSet.of("//:DemoAppWithExtension", "//:DemoExtension");
ImmutableSet<Flavor> includeFrameworkFlavors = ImmutableSet.of(InternalFlavor.of("no-include-frameworks"), InternalFlavor.of("include-frameworks"));
for (BuildTarget builtTarget : buckBuildLog.getAllTargets()) {
if (Sets.intersection(builtTarget.getFlavors(), includeFrameworkFlavors).isEmpty()) {
assertThat(builtTarget.getUnflavoredBuildTarget().getFullyQualifiedName(), not(in(targetsThatShouldContainIncludeFrameworkFlavors)));
} else {
assertThat(builtTarget.getUnflavoredBuildTarget().getFullyQualifiedName(), in(targetsThatShouldContainIncludeFrameworkFlavors));
}
}
}
Aggregations