diff --git a/9unit.c b/9unit.c index d24e295..ff1cf8d 100644 --- a/9unit.c +++ b/9unit.c @@ -157,6 +157,14 @@ append_test_log(TestState *s, const char *msg) s->last_log = entry; } +void +log_test_context(TestState *s) +{ + if (!s) return; + if (s->full_context) append_test_log(s, s->full_context); + else append_test_log(s, ""); +} + void run_test(TestState *s, TestResult (*t)(TestState *)) { diff --git a/9unit.h b/9unit.h index d102554..1ddf718 100644 --- a/9unit.h +++ b/9unit.h @@ -72,6 +72,9 @@ extern void append_test_log( const char * // the message to append ); +// notes the current full context in the log +extern void log_test_context(TestState *); + // Runs a single test extern void run_test( TestState *, // the TestState data