Class TypecheckResult

java.lang.Object
org.checkerframework.framework.test.TypecheckResult

public class TypecheckResult extends Object
Represents the test results from typechecking one or more Java files using the given TestConfiguration.
  • Constructor Details

    • TypecheckResult

      protected TypecheckResult(TestConfiguration configuration, CompilationResult compilationResult, Collection<TestDiagnostic> expectedDiagnostics, Collection<TestDiagnostic> missingDiagnostics, Collection<TestDiagnostic> unexpectedDiagnostics)
      Creates a TypecheckResult.
      Parameters:
      configuration - The test configuration.
      compilationResult - The compilation result.
      expectedDiagnostics - the expected diagnostics
      missingDiagnostics - the diagnostics that were expected but were not issued
      unexpectedDiagnostics - the diagnostics that were issued but were not expected
  • Method Details

    • getConfiguration

      public TestConfiguration getConfiguration()
      Returns the test configuration.
      Returns:
      the test configuration
    • getCompilationResult

      public CompilationResult getCompilationResult()
      Returns the compilation result.
      Returns:
      the compilation result
    • getActualDiagnostics

      public Collection<Diagnostic<? extends JavaFileObject>> getActualDiagnostics()
      Returns the actual diagnostics.
      Returns:
      the actual diagnostics
    • getExpectedDiagnostics

      public Collection<TestDiagnostic> getExpectedDiagnostics()
      Returns the expected diagnostics.
      Returns:
      the expected diagnostics
    • didTestFail

      public boolean didTestFail()
      Returns true if the test failed.
      Returns:
      true if the test failed
    • getMissingDiagnostics

      public Collection<TestDiagnostic> getMissingDiagnostics()
      Returns the diagnostics that were expected but were not issued.
      Returns:
      the diagnostics that were expected but were not issued
    • getUnexpectedDiagnostics

      public Collection<TestDiagnostic> getUnexpectedDiagnostics()
      Returns the diagnostics that were issued but were not expected.
      Returns:
      the diagnostics that were issued but were not expected
    • getErrorHeaders

      public List<String> getErrorHeaders()
    • summarize

      public String summarize()
      Summarize unexpected and missing diagnostics.
      Returns:
      summary of failures
    • fromCompilationResults

      public static TypecheckResult fromCompilationResults(TestConfiguration configuration, CompilationResult result, Collection<TestDiagnostic> expectedDiagnostics)