use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class ProjectIntegrationTest method testGeneratesWorkspaceFromBinary.
@Test
public void testGeneratesWorkspaceFromBinary() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "project_implicit_workspace_generation", temporaryFolder);
workspace.setUp();
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("project", "//bin:bin");
result.assertSuccess();
Files.exists(workspace.resolve("bin/bin.xcworkspace/contents.xcworkspacedata"));
Files.exists(workspace.resolve("bin/bin.xcodeproj/project.pbxproj"));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class BuildKeepGoingIntegrationTest method testVariousSuccessTypesInReport.
@Test
public void testVariousSuccessTypesInReport() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "keep_going", tmp).setUp();
workspace.enableDirCache();
ProcessResult result1 = buildTwoGoodRulesAndAssertSuccess(workspace);
String expectedReport1 = "OK //:rule_with_output BUILT_LOCALLY " + GENRULE_OUTPUT_PATH + "\n" + "OK //:rule_without_output BUILT_LOCALLY\n";
assertThat(result1.getStderr(), containsString(expectedReport1));
ProcessResult result2 = buildTwoGoodRulesAndAssertSuccess(workspace);
String expectedReport2 = "OK //:rule_with_output MATCHING_RULE_KEY " + GENRULE_OUTPUT_PATH + "\n" + "OK //:rule_without_output MATCHING_RULE_KEY\n";
assertThat(result2.getStderr(), containsString(expectedReport2));
workspace.runBuckCommand("clean").assertSuccess();
ProcessResult result3 = buildTwoGoodRulesAndAssertSuccess(workspace);
String expectedReport3 = "OK //:rule_with_output FETCHED_FROM_CACHE " + GENRULE_OUTPUT_PATH + "\n" + "OK //:rule_without_output BUILT_LOCALLY\n";
assertThat(result3.getStderr(), containsString(expectedReport3));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class BuildKeepGoingIntegrationTest method testKeepGoingWithMultipleSuccessfulTargets.
@Test
public void testKeepGoingWithMultipleSuccessfulTargets() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "keep_going", tmp).setUp();
ProcessResult result = buildTwoGoodRulesAndAssertSuccess(workspace);
String expectedReport = "OK //:rule_with_output BUILT_LOCALLY " + GENRULE_OUTPUT_PATH + "\n" + "OK //:rule_without_output BUILT_LOCALLY\n";
assertThat(result.getStderr(), containsString(expectedReport));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class BuildWithNoTargetSpecifiedIntegrationTest method testBuckBuildWithoutTargetWithUnderTenAliasesConfigured.
/**
* Ensure that if there are multiple aliases (but less than ten) they
* are all displayed as targets in the order specified in .buckconfig.
*/
@Test
public void testBuckBuildWithoutTargetWithUnderTenAliasesConfigured() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "project_with_five_aliases", temporaryFolder);
workspace.setUp();
ProcessResult result = workspace.runBuckCommand("build");
result.assertFailure("buck build should exit with an error.");
assertThat(Joiner.on(' ').join("`buck build` should suggest the five aliases found in .buckconfig", "(in the order in which they are listed in) as targets."), result.getStderr(), containsString(Joiner.on('\n').join("BUILD FAILED: Must specify at least one build target.", "Try building one of the following targets:", "myapp my_app mi_app mon_app mein_app") + '\n'));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class CommandLineTargetNodeSpecParserIntegrationTest method trailingColonTargets.
@Test
public void trailingColonTargets() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "command_line_parser", tmp);
workspace.setUp();
// First check for correct usage.
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("targets", "//simple:").assertSuccess();
assertEquals(ImmutableSet.of("//simple:simple"), ImmutableSet.copyOf(Splitter.on('\n').omitEmptyStrings().split(result.getStdout())));
result = workspace.runBuckCommand("targets", "//simple:.");
result.assertFailure("No rule found when resolving target //simple:. in build file //simple/BUCK");
}
Aggregations