Search in sources :

Example 96 with ProjectWorkspace

use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.

the class AuditConfigCommandIntegrationTest method testConfigBuckConfigUI.

@Test
public void testConfigBuckConfigUI() throws IOException {
    ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_config", tmp);
    workspace.setUp();
    ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("audit", "config", "missing_section.badvalue", "ignored_section", "ignored_section.dotted.value", "second_section.some_property", "ignored_section.short_value", "ignored_section.long_value");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-buckconfig"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) Test(org.junit.Test)

Example 97 with ProjectWorkspace

use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testJSONOutput.

@Test
public void testJSONOutput() 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", "--json", "//example:one");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-one.json"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Example 98 with ProjectWorkspace

use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testTestsThatArentNecessarilyIncludedInOriginalParseAreIncludedInOutput.

@Test
public void testTestsThatArentNecessarilyIncludedInOriginalParseAreIncludedInOutput() 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", "--include-tests", "--transitive", "//lib/lib1:lib1");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-lib1-transitive-tests"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Example 99 with ProjectWorkspace

use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testThatJSONOutputWithMultipleInputsIsGroupedByInput.

@Test
public void testThatJSONOutputWithMultipleInputsIsGroupedByInput() 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", "--json", "//example:two", "//example:three");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-two-three.json"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Example 100 with ProjectWorkspace

use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testThatTransitiveJSONOutputWithMultipleInputsIsGroupedByInput.

@Test
public void testThatTransitiveJSONOutputWithMultipleInputsIsGroupedByInput() 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", "--json", "//example:one", "//example:two", "//example:three");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-one-two-three-transitive.json"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Aggregations

ProjectWorkspace (com.facebook.buck.testutil.integration.ProjectWorkspace)747 Test (org.junit.Test)726 Path (java.nio.file.Path)219 BuildTarget (com.facebook.buck.model.BuildTarget)177 ProcessResult (com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult)127 ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)89 Matchers.containsString (org.hamcrest.Matchers.containsString)50 BuckBuildLog (com.facebook.buck.testutil.integration.BuckBuildLog)47 ProcessExecutor (com.facebook.buck.util.ProcessExecutor)35 ZipInspector (com.facebook.buck.testutil.integration.ZipInspector)21 HumanReadableException (com.facebook.buck.util.HumanReadableException)14 OcamlRuleBuilder.createStaticLibraryBuildTarget (com.facebook.buck.ocaml.OcamlRuleBuilder.createStaticLibraryBuildTarget)13 TestConsole (com.facebook.buck.testutil.TestConsole)12 FakeProjectFilesystem (com.facebook.buck.testutil.FakeProjectFilesystem)10 DefaultProcessExecutor (com.facebook.buck.util.DefaultProcessExecutor)10 Cell (com.facebook.buck.rules.Cell)9 TestContext (com.facebook.buck.testutil.integration.TestContext)9 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)9 MappedByteBuffer (java.nio.MappedByteBuffer)9 FileChannel (java.nio.channels.FileChannel)9