Skip to content

Commit 8831664

Browse files
committed
feat: Add advanced hierarchical console output recorder for Swift Testing
- Implement Event.AdvancedConsoleOutputRecorder with beautiful tree structure - Add SF symbols support with colors (play.circle, checkmark.circle, x.circle, etc.) - Right-aligned timing display with 80-column fixed width - Unicode box-drawing characters for hierarchical test output - Issues displayed as sub-nodes under failed tests - Enhanced start message with test count and running status - Thread-safe parallel execution support - Color-coded final summary with status icons - Replace basic ConsoleOutputRecorder with enhanced version - Add demo test files for validation Features: ✅ Hierarchical tree structure with proper indentation ✅ SF Symbols on macOS with Unicode fallback ✅ Right-aligned timing information ✅ Color-coded status icons and output ✅ Issues as expandable sub-nodes ✅ Enhanced start/end messages ✅ Thread-safe concurrent test execution
1 parent 0022e29 commit 8831664

File tree

4 files changed

+1074
-4
lines changed

4 files changed

+1074
-4
lines changed

Sources/Testing/ABI/EntryPoints/EntryPoint.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,18 @@ func entryPoint(passing args: __CommandLineArguments_v0?, eventHandler: Event.Ha
5454
#if !SWT_NO_FILE_IO
5555
// Configure the event recorder to write events to stderr.
5656
if configuration.verbosity > .min {
57-
let eventRecorder = Event.ConsoleOutputRecorder(options: .for(.stderr)) { string in
57+
// Use the advanced console output recorder for hierarchical display
58+
var advancedOptions = Event.AdvancedConsoleOutputRecorder.Options()
59+
advancedOptions.base = .for(.stderr)
60+
advancedOptions.useHierarchicalOutput = true
61+
62+
let eventRecorder = Event.AdvancedConsoleOutputRecorder(options: advancedOptions) { string in
5863
try? FileHandle.stderr.write(string)
5964
}
60-
configuration.eventHandler = { [oldEventHandler = configuration.eventHandler] event, context in
61-
eventRecorder.record(event, in: context)
62-
oldEventHandler(event, context)
65+
66+
// Replace the event handler completely with our advanced recorder
67+
configuration.eventHandler = { event, context in
68+
eventRecorder.handle(event, in: context)
6369
}
6470
}
6571
#endif

0 commit comments

Comments
 (0)