output_sink rendering the run as TAP (Test Anything Protocol). More...
output_sink rendering the run as TAP (Test Anything Protocol).
Built from output_sink's structured test_finished hook rather than by parsing the human-readable text tts::stdout_sink prints, so it reports one "ok N - name" / "not ok N - name" line per TTS_CASE regardless of -v/-q, followed by a trailing "1..N" plan line once dump()ed - or automatically, via finish(), to the target given at construction (tts::output_handler::default_sink() by default). It does not (currently) reflect TTS_CASE_TPL's per-type breakdown or TTS_WHEN / TTS_AND_THEN sub-scenarios, since those don't have their own hook - only the enclosing TTS_CASE does.
Public Member Functions | |
| virtual void | assertion_failed (text const &location, text const &message, bool fatal) |
| void | clear () |
| Discards everything gathered so far. | |
| void | dump () |
| Streams the TAP-rendered report to stdout, then clears the gathered results. | |
| void | dump (output_sink &target) |
| Forwards the TAP-rendered report to target, then clears the gathered results. | |
| void | finish () override |
| Dumps the TAP-rendered report to the target given at construction. | |
| virtual void | flush () |
| Flushes this sink's destination, if that means anything for it. No-op by default. | |
| text | render () const |
| Renders everything gathered so far as TAP-formatted text. | |
| 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) |
| void | test_finished (text const &name, bool passed, bool invalid, unsigned long long duration_ns) override |
| virtual void | test_started (text const &name) |
| void | write (text const &) 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 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.
|
inlineoverridevirtual |
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 from tts::output_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.