Class TestRunner
java.lang.Object
org.ek9lang.cli.TestRunner
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) List<TestProgram> Discover all @Test programs from the compiled program.(package private) List<DiscoveredTest> Discover all tests with full metadata (test type, test cases).(package private) List<TestResult> executeTests(List<TestProgram> tests) Execute all discovered tests.(package private) booleanreportResults(List<TestResult> results) Report test results using the configured formatter.(package private) booleanrunAll()Run all tests: discover, execute, and report.
-
Constructor Details
-
TestRunner
TestRunner(CompilationContext compilationContext)
-
-
Method Details
-
discoverTests
List<TestProgram> discoverTests()Discover all @Test programs from the compiled program.- Returns:
- List of test programs with their metadata
-
executeTests
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
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
-