implemented log_test_context()

This commit is contained in:
jlamothe 2023-11-20 05:03:33 +00:00
parent 24ed9060ba
commit 01e9cb8794
2 changed files with 11 additions and 0 deletions

View File

@ -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, "<no context>");
}
void
run_test(TestState *s, TestResult (*t)(TestState *))
{

View File

@ -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