Class TestRunner

java.lang.Object
org.ek9lang.cli.TestRunner

final class TestRunner extends Object
Discovers and executes @Test programs from compiled EK9 source.

Execution model:

  • Ungrouped tests: Execute in parallel using dedicated thread pool
  • Grouped tests: Execute sequentially within each group, groups run in parallel
  • All output is captured per-test; reporting happens AFTER all tests complete

Parallelism defaults to 75% of available processors to leave headroom.

  • Constructor Details

  • Method Details

    • discoverTests

      List<TestProgram> discoverTests()
      Discover all @Test programs from the compiled program.
      Returns:
      List of test programs with their metadata
    • executeTests

      List<TestResult> executeTests(List<TestProgram> tests)
      Execute all discovered tests.

      All tests are executed with output capture. NO output is produced during execution to prevent interleaving. All results are collected and returned for reporting AFTER execution completes.

      Parameters:
      tests - The tests to execute
      Returns:
      List of test results
    • reportResults

      boolean reportResults(List<TestResult> results)
      Report test results using the configured formatter.
      Parameters:
      results - The test results to report
      Returns:
      true if all tests passed
    • discoverTestsWithMetadata

      List<DiscoveredTest> discoverTestsWithMetadata()
      Discover all tests with full metadata (test type, test cases).
      Returns:
      List of discovered tests with metadata for reporting
    • runAll

      boolean runAll()
      Run all tests: discover, execute, and report.
      Returns:
      true if all tests passed