コード例 #1
0
ファイル: BuckConfigTest.java プロジェクト: highgic/buck
  @Test
  public void testBuckPyIgnorePaths() throws IOException {
    ProjectWorkspace workspace =
        TestDataHelper.createProjectWorkspaceForScenario(
            this, "buck_py_ignore_paths", temporaryFolder);
    workspace.setUp();

    ProcessResult result = workspace.runBuckCommand("test", "--all");
    result.assertExitCode("buck test --all should exit cleanly", 0);
  }
コード例 #2
0
  @Test
  public void testIfCommandExitsZeroThenGenruleFails() throws IOException {
    assumeTrue(
        "This genrule uses the 'bash' argument, which is not supported on Windows. ",
        Platform.detect() != Platform.WINDOWS);
    ProjectWorkspace workspace =
        TestDataHelper.createProjectWorkspaceForScenario(
            this, "genrule_failing_command", temporaryFolder);
    workspace.setUp();

    ProcessResult buildResult = workspace.runBuckCommand("build", "//:fail");
    buildResult.assertExitCode(1);

    // We make sure that we failed for the right reason.
    assertThat(
        buildResult.getStderr(),
        containsString("BUILD FAILED: //:fail failed on step \"genrule\" with exit code 1"));
  }