use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class ProjectIntegrationTest method testBuckProjectDryRun.
@Test
public void testBuckProjectDryRun() throws IOException {
ProcessResult result = runBuckProjectWithoutVerification("project1", "--deprecated-ij-generation", "--dry-run", "-v", "5");
ImmutableSortedSet<String> expectedResult = ImmutableSortedSet.of("//:project_config", "//:root_module", "//libs:generated", "//libs:generated_jar", "//libs:generated_source_jar", "//libs:guava", "//libs:jsr305", "//libs:junit", "//modules/dep1:dep1", "//modules/dep1:project_config", "//modules/dep1:test", "//modules/tip:project_config", "//modules/tip:test", "//modules/tip:tip");
ImmutableSortedSet<String> actualResult = ImmutableSortedSet.copyOf(Splitter.on('\n').omitEmptyStrings().split(result.getStdout()));
assertEquals("`buck project --dry-run` should print the list of targets that would be included.", expectedResult, actualResult);
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class ProjectIntegrationTest method testVersion2BuckProjectWithUnusedLibraries.
@Test
public void testVersion2BuckProjectWithUnusedLibraries() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "experimental_project_with_unused_libraries", temporaryFolder);
workspace.setUp();
ProcessResult result = workspace.runBuckCommand("project");
result.assertSuccess("buck project should exit cleanly");
assertFalse(workspace.resolve(".idea/libraries/library_libs_jsr305.xml").toFile().exists());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class PythonSrcZipIntegrationTest method testDependingOnSrcZipWorks.
@Test
public void testDependingOnSrcZipWorks() throws IOException {
// This test should pass.
ProcessResult result1 = workspace.runBuckCommand("test", "//:test");
result1.assertSuccess();
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class PythonTestIntegrationTest method testPythonTest.
@Test
public void testPythonTest() throws IOException {
// This test should pass.
ProcessResult result1 = workspace.runBuckCommand("test", "//:test-success");
result1.assertSuccess();
workspace.resetBuildLogFile();
ProcessResult runResult1 = workspace.runBuckCommand("run", "//:test-success");
runResult1.assertSuccess("python test binary should exit 0 on success");
// This test should fail.
ProcessResult result2 = workspace.runBuckCommand("test", "//:test-failure");
result2.assertTestFailure();
assertThat("`buck test` should fail because test_that_fails() failed.", result2.getStderr(), containsString("test_that_fails"));
ProcessResult runResult2 = workspace.runBuckCommand("run", "//:test-failure");
runResult2.assertExitCode("python test binary should exit with expected error code on failure", PythonRunTestsStep.TEST_FAILURES_EXIT_CODE);
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class PythonTestIntegrationTest method testPythonSkippedResult.
@Test
public void testPythonSkippedResult() throws IOException, InterruptedException {
assumePythonVersionIsAtLeast("2.7", "unittest skip support was added in Python-2.7");
ProcessResult result = workspace.runBuckCommand("test", "//:test-skip").assertSuccess();
assertThat(result.getStderr(), containsString("1 Skipped"));
}
Aggregations