implemented log_test_context()
This commit is contained in:
8
9unit.c
8
9unit.c
@@ -157,6 +157,14 @@ append_test_log(TestState *s, const char *msg)
|
|||||||
s->last_log = entry;
|
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
|
void
|
||||||
run_test(TestState *s, TestResult (*t)(TestState *))
|
run_test(TestState *s, TestResult (*t)(TestState *))
|
||||||
{
|
{
|
||||||
|
|||||||
3
9unit.h
3
9unit.h
@@ -72,6 +72,9 @@ extern void append_test_log(
|
|||||||
const char * // the message to append
|
const char * // the message to append
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// notes the current full context in the log
|
||||||
|
extern void log_test_context(TestState *);
|
||||||
|
|
||||||
// Runs a single test
|
// Runs a single test
|
||||||
extern void run_test(
|
extern void run_test(
|
||||||
TestState *, // the TestState data
|
TestState *, // the TestState data
|
||||||
|
|||||||
Reference in New Issue
Block a user