use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditDependenciesCommandIntegrationTest method testRunningWithNoParameterCausesBuildError.
@Test
public void testRunningWithNoParameterCausesBuildError() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
workspace.setUp();
// Print all of the inputs to the rule.
ProcessResult result = workspace.runBuckCommand("audit", "dependencies");
result.assertFailure();
assertThat(result.getStderr(), containsString("Must specify at least one build target.\n"));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditDependenciesCommandIntegrationTest method testTransitiveDependencies.
@Test
public void testTransitiveDependencies() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
workspace.setUp();
// Print all of the inputs to the rule.
ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "--transitive", "//example:one");
result.assertSuccess();
assertEquals(workspace.getFileContents("stdout-one-transitive"), result.getStdout());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditInputCommandIntegrationTest method testBuckAuditInputJsonAppleResourceDirs.
@Test
public void testBuckAuditInputJsonAppleResourceDirs() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_input", tmp);
workspace.setUp();
// Print all of the inputs to the rule in JSON format.
ProcessResult result = workspace.runBuckCommand("audit", "input", "//example:foo", "--json");
result.assertSuccess();
assertEquals(workspace.getFileContents(expectedStdoutJson), result.getStdout());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditInputCommandIntegrationTest method testBuckAuditInputAppleResourceDirs.
@Test
public void testBuckAuditInputAppleResourceDirs() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_input", tmp);
workspace.setUp();
// Print all of the inputs to the rule.
ProcessResult result = workspace.runBuckCommand("audit", "input", "//example:foo");
result.assertSuccess();
assertEquals(workspace.getFileContents(expectedStdout), result.getStdout());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class DaemonIntegrationTest method whenCrossCellSourceInvalidatedThenRebuildFails.
@Test
public void whenCrossCellSourceInvalidatedThenRebuildFails() throws IOException, InterruptedException {
final ProjectWorkspace primary = TestDataHelper.createProjectWorkspaceForScenario(this, "crosscell_file_watching/primary", tmp.newFolder());
primary.setUp();
final ProjectWorkspace secondary = TestDataHelper.createProjectWorkspaceForScenario(this, "crosscell_file_watching/secondary", tmp.newFolder());
secondary.setUp();
TestDataHelper.overrideBuckconfig(primary, ImmutableMap.of("repositories", ImmutableMap.of("secondary", secondary.getPath(".").normalize().toString())));
primary.runBuckdCommand("build", "//:cxxbinary").assertSuccess();
ProcessResult result = primary.runBuckdCommand("run", "//:cxxbinary");
result.assertSuccess();
String fileName = "sum.cpp";
Files.write(secondary.getPath(fileName), "#error Failure".getBytes(Charsets.UTF_8));
result = primary.runBuckdCommand("build", "//:cxxbinary");
assertThat("Failure should be due to compilation error.", result.getStderr(), containsString("#error Failure"));
result.assertFailure();
// Make the file valid again, but change the output
Files.write(secondary.getPath(fileName), "#include \"sum.hpp\"\nint sum(int a, int b) {return a;}".getBytes(Charsets.UTF_8));
primary.runBuckdCommand("build", "//:cxxbinary").assertSuccess();
result = primary.runBuckdCommand("run", "//:cxxbinary");
result.assertFailure();
}
Aggregations