use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class ProjectIntegrationTest method testBuckProjectSliceWithProjectInDifferentBuckFile.
/**
* Verify we can build a project by specifying a target, even if it depends on a target whose
* project is not in the same buck file as the targets it's for.
*/
@Test
public void testBuckProjectSliceWithProjectInDifferentBuckFile() throws IOException {
ProcessResult result = runBuckProjectAndVerify("project_slice_with_project_in_different_buck_file", "--deprecated-ij-generation", "//:root", "-v", "5");
assertEquals("`buck project` should report the files it modified.", Joiner.on('\n').join("MODIFIED FILES:", ".idea/compiler.xml", ".idea/misc.xml", ".idea/modules.xml", ".idea/runConfigurations/Debug_Buck_test.xml", "module_.iml", "modules/module_modules_dep1.iml") + '\n', result.getStdout());
assertThat("`buck project` should contain warning to synchronize IntelliJ.", result.getStderr(), containsString(" :: Please resynchronize IntelliJ via File->Synchronize " + "or Cmd-Opt-Y (Mac) or Ctrl-Alt-Y (PC/Linux)"));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class ProjectIntegrationTest method testBuckProjectSliceDryRun.
@Test
public void testBuckProjectSliceDryRun() throws IOException {
ProcessResult result = runBuckProjectWithoutVerification("project_slice", "--deprecated-ij-generation", "--dry-run", "--without-tests", "//modules/dep1:dep1", "//:root", "-v", "5");
ImmutableSortedSet<String> expectedResult = ImmutableSortedSet.of("//:project_config", "//:root", "//libs:guava", "//libs:jsr305", "//libs:junit", "//modules/dep1:dep1", "//modules/dep1:project_config", "//modules/dep1:test");
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 testBuckProjectSliceWithTestsDependenciesInDifferentBuckFile.
/**
* Verify that if we build a project by specifying a target, the tests dependencies are
* referenced even if they are defined in a buck file that would not have been parsed otherwise.
*/
@Test
public void testBuckProjectSliceWithTestsDependenciesInDifferentBuckFile() throws IOException {
ProcessResult result = runBuckProjectAndVerify("project_slice_with_tests_dependencies_in_different_buck_file", "--deprecated-ij-generation", "//modules/dep1:dep1", "-v", "5");
assertEquals("`buck project` should report the files it modified.", Joiner.on('\n').join("MODIFIED FILES:", ".idea/compiler.xml", ".idea/misc.xml", ".idea/modules.xml", ".idea/runConfigurations/Debug_Buck_test.xml", "modules/dep1/module_modules_dep1.iml", "modules/dep2/module_modules_dep2.iml", "tests/module_tests.iml") + '\n', result.getStdout());
assertThat("`buck project` should contain warning to synchronize IntelliJ.", result.getStderr(), containsString(" :: Please resynchronize IntelliJ via File->Synchronize " + "or Cmd-Opt-Y (Mac) or Ctrl-Alt-Y (PC/Linux)"));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class ProjectIntegrationTest method testBuckProjectSliceWithAndroidBinaryWithRDotJavaAutogenerationDisabled.
@Test
public void testBuckProjectSliceWithAndroidBinaryWithRDotJavaAutogenerationDisabled() throws IOException {
ProcessResult result = runBuckProjectAndVerify("project_with_android_binary_autogeneration_disabled", "--deprecated-ij-generation", "--disable-r-java-idea-generator", "//apps/sample:app", "-v", "5");
assertEquals("`buck project` should report the files it modified.", Joiner.on('\n').join("MODIFIED FILES:", ".idea/compiler.xml", ".idea/misc.xml", ".idea/modules.xml", ".idea/runConfigurations/Debug_Buck_test.xml", "apps/sample/module_apps_sample.iml", "java/com/sample/lib/module_java_com_sample_lib.iml", "res/com/sample/asset_only/module_res_com_sample_asset_only.iml", "res/com/sample/base/module_res_com_sample_base.iml", "res/com/sample/title/module_res_com_sample_title.iml", "res/com/sample/top/module_res_com_sample_top.iml") + '\n', result.getStdout());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class ProjectIntegrationTest method testBuckProjectSliceWithTestsProjectInDifferentBuckFile.
/**
* Verify that if we build a project by specifying a target, the tests' projects rules are
* referenced even if they are defined in a different buck file from the tests.
*/
@Test
public void testBuckProjectSliceWithTestsProjectInDifferentBuckFile() throws IOException {
ProcessResult result = runBuckProjectAndVerify("project_slice_with_tests_project_in_different_buck_file", "--deprecated-ij-generation", "//modules/dep1:dep1", "-v", "5");
assertEquals("`buck project` should report the files it modified.", Joiner.on('\n').join("MODIFIED FILES:", ".idea/compiler.xml", ".idea/misc.xml", ".idea/modules.xml", ".idea/runConfigurations/Debug_Buck_test.xml", "modules/dep1/module_modules_dep1.iml", "tests/module_tests_test1.iml") + '\n', result.getStdout());
assertThat("`buck project` should contain warning to synchronize IntelliJ.", result.getStderr(), containsString(" :: Please resynchronize IntelliJ via File->Synchronize " + "or Cmd-Opt-Y (Mac) or Ctrl-Alt-Y (PC/Linux)"));
}
Aggregations