Enum Class TestOutputFormat

java.lang.Object
java.lang.Enum<TestOutputFormat>
org.ek9lang.cli.TestOutputFormat
All Implemented Interfaces:
Serializable, Comparable<TestOutputFormat>, Constable

public enum TestOutputFormat extends Enum<TestOutputFormat>
Output format for test results. Follows the EK9 pattern of numbered suffixes (-t0, -t1, -t2, -t3) similar to optimization (-O0, -O1, etc.) and error levels (-E0, -E1, etc.).
  • Enum Constant Details

    • TERSE

      public static final TestOutputFormat TERSE
      Terse output - minimal summary only. Format: "N tests: X passed, Y failed" Use case: Scripting, CI pass/fail checks.
    • HUMAN

      public static final TestOutputFormat HUMAN
      Human-readable output with visual formatting. Includes test names, durations, failure details with icons. Use case: Interactive terminal usage (default).
    • JSON

      public static final TestOutputFormat JSON
      JSON structured output for programmatic consumption. Full metadata including locations, expressions, timing. Use case: AI/LLM integration, custom tooling.
    • JUNIT_XML

      public static final TestOutputFormat JUNIT_XML
      JUnit XML format for CI/CD integration. Compatible with Jenkins, GitHub Actions, GitLab CI. Use case: Enterprise CI/CD pipelines.
  • Method Details

    • values

      public static TestOutputFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TestOutputFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • matches

      public boolean matches(String flag)
      Check if this format matches the given command line flag.
    • fromFlag

      public static TestOutputFormat fromFlag(String flag)
      Parse a command line flag to determine the output format.
      Parameters:
      flag - The flag to parse (e.g., "-t", "-t0", "-t2")
      Returns:
      The matching format, or HUMAN as default
    • getPrimaryFlag

      public String getPrimaryFlag()
      Get the primary flag for this format.