use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class PrebuiltAppleFrameworkIntegrationTest method testPrebuiltAppleFrameworkCopiedToBundle.
@Test
public void testPrebuiltAppleFrameworkCopiedToBundle() throws IOException, InterruptedException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "prebuilt_apple_framework_links", tmp);
workspace.setUp();
ProjectFilesystem filesystem = new ProjectFilesystem(workspace.getDestPath());
BuildTarget target = BuildTargetFactory.newInstance("//app:TestAppBundle#dwarf-and-dsym,include-frameworks");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", target.getFullyQualifiedName());
result.assertSuccess();
Path includedFramework = workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s")).resolve("TestAppBundle.app").resolve("Frameworks").resolve("BuckTest.framework");
assertTrue(Files.isDirectory(includedFramework));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class CustomAutodepsIntegrationTest method useCustomAutodepsForPythonRules.
/**
* Tests a case where a set of {@code python_library()} and {@code python_binary()} rules specify
* {@code autodeps=True} to load their {@code deps} from a {@code BUCK.autodeps} file that is
* generated by something other than {@code buck autodeps}. This ensures that external users can
* perform their own experiments with auto-generating dependencies.
*/
@Test
public void useCustomAutodepsForPythonRules() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "custom_autodeps", tmpFolder);
workspace.setUp();
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("run", "//:app");
result.assertSuccess();
assertEquals("If the dependencies were loaded correctly, main.py should load code from lib1.py.", "Hello!", result.getStdout().trim());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class ProjectIntegrationTest method testGeneratingWorkspaceForXcodeWithoutSettingIde.
@Test
public void testGeneratingWorkspaceForXcodeWithoutSettingIde() throws IOException {
// .buckconfig has no ide set, so buck should correctly guess that
// apple_stuff requires Xcode workspace
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "generating_workspace_for_xcode_without_setting_ide", temporaryFolder);
workspace.setUp();
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("project", "//App:TestAppBinary");
result.assertSuccess();
String workspacePathString = temporaryFolder.getRoot().toString();
workspacePathString += "/App/TestAppBinary.xcworkspace";
Path workspacePath = temporaryFolder.getRoot().resolve(workspacePathString);
assertThat(Files.exists(workspacePath), Matchers.equalTo(true));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class ProjectIntegrationTest method generatingAllWorkspacesWillNotIncludeAllProjectsInEachOfThem.
@Test
public void generatingAllWorkspacesWillNotIncludeAllProjectsInEachOfThem() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "generating_all_workspaces_will_not_include_all_projects_in_each_of_them", temporaryFolder);
workspace.setUp();
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("project");
result.assertSuccess();
workspace.verify();
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class ProjectIntegrationTest method testGeneratesWorkspaceFromLibrary.
@Test
public void testGeneratesWorkspaceFromLibrary() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "project_implicit_workspace_generation", temporaryFolder);
workspace.setUp();
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("project", "//lib:lib");
result.assertSuccess();
Files.exists(workspace.resolve("lib/lib.xcworkspace/contents.xcworkspacedata"));
Files.exists(workspace.resolve("lib/lib.xcodeproj/project.pbxproj"));
}
Aggregations