use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBundleIntegrationTest method infoPlistWithUnrecognizedVariableFails.
@Test
public void infoPlistWithUnrecognizedVariableFails() throws IOException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "application_bundle_with_invalid_substitutions", tmp);
workspace.setUp();
workspace.runBuckCommand("build", "//:DemoApp#iphonesimulator-x86_64,no-debug").assertFailure();
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBinaryIntegrationTest method testAppleBinaryUsesDefaultsFromConfig.
@Test
public void testAppleBinaryUsesDefaultsFromConfig() throws Exception {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "apple_binary_with_config_default_platform", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//Apps/TestApp:TestApp").withAppendedFlavors(InternalFlavor.of("iphoneos-arm64"));
workspace.runBuckCommand("build", target.getFullyQualifiedName()).assertSuccess();
Path outputPath = workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s"));
assertThat(Files.exists(outputPath), is(true));
assertThat(Files.exists(Paths.get(outputPath.toString() + "-LinkMap.txt")), is(true));
assertThat(workspace.runCommand("file", outputPath.toString()).getStdout().get(), containsString("executable"));
assertThat(workspace.runCommand("otool", "-hv", outputPath.toString()).getStdout().get(), containsString("ARM64"));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBinaryIntegrationTest method multiarchBinaryShouldCopyLinkMapOfComponents.
@Test
public void multiarchBinaryShouldCopyLinkMapOfComponents() throws Exception {
assumeTrue(Platform.detect() == Platform.MACOS);
BuildTarget singleArchI386Target = BuildTargetFactory.newInstance("//:DemoApp#iphonesimulator-i386");
BuildTarget singleArchX8664Target = BuildTargetFactory.newInstance("//:DemoApp#iphonesimulator-x86_64");
BuildTarget target = BuildTargetFactory.newInstance("//:DemoApp#iphonesimulator-i386,iphonesimulator-x86_64");
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "multiarch_binary_linkmap", tmp);
workspace.setUp();
workspace.runBuckBuild(target.getFullyQualifiedName()).assertSuccess();
assertTrue("Has link map for i386 arch.", Files.exists(workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s-LinkMap").resolve(singleArchI386Target.getShortNameAndFlavorPostfix() + "-LinkMap.txt"))));
assertTrue("Has link map for x86_64 arch.", Files.exists(workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s-LinkMap").resolve(singleArchX8664Target.getShortNameAndFlavorPostfix() + "-LinkMap.txt"))));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBinaryIntegrationTest method testAppleBinaryWithLibraryDependencyBuildsSomething.
@Test
public void testAppleBinaryWithLibraryDependencyBuildsSomething() throws Exception {
assumeTrue(Platform.detect() == Platform.MACOS);
assumeTrue(AppleNativeIntegrationTestUtils.isApplePlatformAvailable(ApplePlatform.MACOSX));
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "apple_binary_with_library_dependency_builds_something", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//Apps/TestApp:TestApp").withAppendedFlavors(InternalFlavor.of("macosx-x86_64"));
workspace.runBuckCommand("build", target.getFullyQualifiedName()).assertSuccess();
Path outputPath = workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s"));
assertThat(Files.exists(outputPath), is(true));
assertThat(workspace.runCommand("file", outputPath.toString()).getStdout().get(), containsString("executable"));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBinaryIntegrationTest method testAppleBinaryHeaderSymlinkTree.
@Test
public void testAppleBinaryHeaderSymlinkTree() throws IOException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "apple_binary_header_symlink_tree", tmp);
workspace.setUp();
BuildTarget buildTarget = BuildTargetFactory.newInstance("//Apps/TestApp:TestApp#default," + CxxDescriptionEnhancer.HEADER_SYMLINK_TREE_FLAVOR);
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", buildTarget.getFullyQualifiedName());
result.assertSuccess();
Path projectRoot = tmp.getRoot().toRealPath();
Path inputPath = projectRoot.resolve(buildTarget.getBasePath());
Path outputPath = projectRoot.resolve(BuildTargets.getGenPath(filesystem, buildTarget, "%s"));
assertIsSymbolicLink(outputPath.resolve("Header.h"), inputPath.resolve("Header.h"));
assertIsSymbolicLink(outputPath.resolve("TestApp/Header.h"), inputPath.resolve("Header.h"));
}
Aggregations