Class HumanTestFormatter
java.lang.Object
org.ek9lang.cli.HumanTestFormatter
- All Implemented Interfaces:
TestResultFormatter
Human-readable test output formatter (-t or -t1).
Provides visual formatting with colors, icons, test type indicators, and clear structure.
Uses
TerminalColors for terminal capability detection
and graceful fallback.
Discovery output (with colors/emoji):
Found 6 tests: 2 assert (unit tests with assertions) 1 blackbox (output validated against expected_output.txt) 3 parameterized (6 cases total) Group "database": 2 tests (sequential execution)
Results output (with colors/emoji):
✅ PASS module::SimpleTest [Assert] (3ms)
✅ PASS module::OutputTest [BlackBox] (2ms)
✅ PASS module::ParamTest [Param:hello] (4ms)
❌ FAIL module::ParamTest [Param:edge] (1ms)
Output mismatch (case: edge)
Summary: 3 passed, 1 failed (4 results from 3 programs)
Types: 1 assert, 1 blackbox, 2 parameterized
Duration: 10ms
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreportDiscovery(List<DiscoveredTest> tests, PrintStream out) Report the discovery of tests before execution begins.voidreportExecutionStart(int testCount, PrintStream out) Report that test execution is starting.voidreportResults(List<TestResult> results, PrintStream out) Report all test results after execution completes.
-
Constructor Details
-
HumanTestFormatter
HumanTestFormatter(boolean verbose)
-
-
Method Details
-
reportDiscovery
Description copied from interface:TestResultFormatterReport the discovery of tests before execution begins.The discovery report should include:
- Test type breakdown (assert-based vs blackbox vs parameterized)
- Total test case count (including parameterized cases)
- Group information if applicable
- Specified by:
reportDiscoveryin interfaceTestResultFormatter- Parameters:
tests- The discovered tests with metadataout- The output stream
-
reportExecutionStart
Description copied from interface:TestResultFormatterReport that test execution is starting. Some formatters may output a progress message here.- Specified by:
reportExecutionStartin interfaceTestResultFormatter- Parameters:
testCount- The number of tests to executeout- The output stream
-
reportResults
Description copied from interface:TestResultFormatterReport all test results after execution completes.- Specified by:
reportResultsin interfaceTestResultFormatter- Parameters:
results- The test resultsout- The output stream
-