Default output_sink, streaming every message straight to stdout. More...
Default output_sink, streaming every message straight to stdout.
This is the sink TTS uses unless a power user installs another one, matching its historical behavior of streaming output as it is produced.
Public Member Functions | |
| virtual void | assertion_failed (text const &location, text const &message, bool fatal) |
| virtual void | finish () |
| void | flush () override |
| Flushes this sink's destination, if that means anything for it. No-op by default. | |
| virtual void | suite_aborted () |
| virtual void | suite_finished (unsigned long long fail_count, unsigned long long invalid_count) |
| virtual void | suite_metric (outcome kind, unsigned long long count, unsigned long long total) |
| virtual void | test_finished (text const &name, bool passed, bool invalid, unsigned long long duration_ns) |
| virtual void | test_started (text const &name) |
| void | write (text const &t) override |
| Writes t to this sink's destination. | |
|
inlinevirtualinherited |
Called once per failing/fatal assertion, always and before the corresponding text (if any - it's suppressed under -q for a plain failure, though never for a fatal one). No-op by default. Not called for passing assertions - test_finished()'s passed already covers that case, and most consumers of this hook don't want one event per assertion.
Reimplemented in tts::colorized_sink, tts::diagnostics_sink, tts::json_sink, and tts::junit_sink.
|
inlinevirtualinherited |
Called once, after tts::report() returns - every other hook has already fired by then - so an accumulate-style sink (e.g. tts::tap_sink) can render and flush its buffered content to its own destination. No-op by default: pass-through sinks that already forward write() as it happens (e.g. tts::colorized_sink) have nothing left to do here. Like --shard, this is only called by the default driver (TTS_MAIN) - a TTS_CUSTOM_DRIVER_FUNCTION manages whichever sink it installed itself, including dumping it, so its driver never calls finish() on its own.
Reimplemented in tts::json_sink, tts::junit_sink, and tts::tap_sink.
|
inlinevirtualinherited |
Called if the suite aborts early due to a TTS_FATAL failure, before tts::report() (and thus suite_finished()) runs. No-op by default.
Reimplemented in tts::colorized_sink.
|
inlinevirtualinherited |
Called once the whole suite has finished running (from tts::report()), with its aggregate outcome, always - even under -q. No-op by default.
Reimplemented in tts::colorized_sink.
|
inlinevirtualinherited |
Called once per non-zero outcome category, right before its "N/M (P%) <label>" segment is printed as part of the Results: ... summary. No-op by default.
Reimplemented in tts::colorized_sink.
|
inlinevirtualinherited |
Called once a TTS_CASE / TTS_CASE_TPL / TTS_CASE_WITH has finished running, always and before its corresponding text (if any - suppressed under -q), with its outcome and how long it took to run, in nanoseconds. No-op by default.
Reimplemented in tts::colorized_sink, tts::json_sink, tts::junit_sink, and tts::tap_sink.
|
inlinevirtualinherited |
Called when a TTS_CASE / TTS_CASE_TPL / TTS_CASE_WITH is about to run. No-op by default - opt-in for sinks that want structured per-test events instead of (or in addition to) parsing the formatted text stream.
Reimplemented in tts::colorized_sink.