Skip to content

Commit ef8252b

Browse files
committed
Align experimental integration with upstream patterns
- Use upstream conditional compilation directives - Match upstream verbosity check (> .min instead of >= 0) - Simplify AdvancedConsoleOutputRecorder options for skeleton - Fix event handler ordering to match upstream pattern - Maintain zero impact on default behavior
1 parent f6c46fa commit ef8252b

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

Sources/Testing/ABI/EntryPoints/EntryPoint.swift

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,40 +51,35 @@ func entryPoint(passing args: __CommandLineArguments_v0?, eventHandler: Event.Ha
5151
}
5252
configuration.verbosity = args.verbosity
5353

54-
if configuration.verbosity >= 0 {
54+
#if !SWT_NO_FILE_IO
55+
// Configure the event recorder to write events to stderr.
56+
if configuration.verbosity > .min {
5557
// Check for experimental console output flag
5658
if Environment.flag(named: "SWT_ENABLE_EXPERIMENTAL_CONSOLE_OUTPUT") {
59+
// Use experimental AdvancedConsoleOutputRecorder
5760
var advancedOptions = Event.AdvancedConsoleOutputRecorder.Options()
58-
advancedOptions.base = .for(FileHandle.stderr)
59-
60-
advancedOptions.base.useANSIEscapeCodes = true
61-
advancedOptions.base.ansiColorBitDepth = 24
62-
#if os(macOS)
63-
advancedOptions.base.useSFSymbols = true
64-
#endif
65-
66-
advancedOptions.useHierarchicalOutput = true
61+
advancedOptions.base = .for(.stderr)
6762

6863
let eventRecorder = Event.AdvancedConsoleOutputRecorder(options: advancedOptions) { string in
6964
try? FileHandle.stderr.write(string)
7065
}
7166

72-
// Replace the event handler completely with our advanced recorder
73-
configuration.eventHandler = { event, context in
67+
configuration.eventHandler = { [oldEventHandler = configuration.eventHandler] event, context in
7468
eventRecorder.handle(event, in: context)
69+
oldEventHandler(event, context)
7570
}
7671
} else {
77-
// Use the standard console output recorder
72+
// Use the standard console output recorder (default behavior)
7873
let eventRecorder = Event.ConsoleOutputRecorder(options: .for(.stderr)) { string in
7974
try? FileHandle.stderr.write(string)
8075
}
81-
8276
configuration.eventHandler = { [oldEventHandler = configuration.eventHandler] event, context in
83-
oldEventHandler(event, context)
8477
eventRecorder.record(event, in: context)
78+
oldEventHandler(event, context)
8579
}
8680
}
8781
}
82+
#endif
8883

8984
// If the caller specified an alternate event handler, hook it up too.
9085
if let eventHandler {

Sources/Testing/Events/Recorder/Event.Symbol.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,22 @@ extension Event.Symbol {
6161
("\u{10065F}", "arrow.triangle.turn.up.right.diamond.fill")
6262
case let .pass(knownIssueCount):
6363
if knownIssueCount > 0 {
64-
("\u{100791}", "diamond.fill")
64+
("\u{100883}", "xmark.diamond")
6565
} else {
66-
("\u{100663}", "checkmark.diamond.fill")
66+
("\u{10105B}", "checkmark.diamond.fill")
6767
}
6868
case .passWithWarnings:
69-
("\u{10078B}", "exclamationmark.diamond.fill")
69+
("\u{100123}", "questionmark.diamond.fill")
7070
case .fail:
71-
("\u{100791}", "diamond.fill")
71+
("\u{100884}", "xmark.diamond.fill")
7272
case .difference:
73-
("\u{100635}", "plusminus.circle.fill")
73+
("\u{10017A}", "plus.forwardslash.minus")
7474
case .warning:
75-
("\u{10078B}", "exclamationmark.diamond.fill")
75+
("\u{1001FF}", "exclamationmark.triangle.fill")
7676
case .details:
77-
("\u{100631}", "arrow.down.right.circle.fill")
77+
("\u{100135}", "arrow.turn.down.right")
7878
case .attachment:
79-
("\u{100631}", "arrow.down.right.circle.fill")
79+
("\u{100237}", "doc")
8080
}
8181
}
8282

0 commit comments

Comments
 (0)