test: add a helper function to mark test progress

Makes debugging easier: just insert a few peck_mark() calls and see
them correctly mixed into the output.
This commit is contained in:
Peter Hutterer 2022-03-03 13:46:18 +10:00
parent e9e67449d5
commit 81d6fb335d
2 changed files with 11 additions and 0 deletions

View file

@ -1056,3 +1056,10 @@ peck_eis_event_type_name(enum eis_event_type type)
#undef CASE_STRING
assert(!"Unhandled EIS event type");
}
void
_peck_mark(struct peck *peck, const char *func, int line)
{
static uint32_t mark = 0;
log_debug(peck, "mark %3d: line %d in %s()\n", mark++, line, func);
}

View file

@ -134,6 +134,10 @@ struct peck;
struct peck *
peck_new(void);
void _peck_mark(struct peck *peck, const char *func, int line);
/** Add debug marker to the log output */
#define peck_mark(peck_) _peck_mark(peck_, __func__, __LINE__)
void
peck_enable_eis_behavior(struct peck *peck, enum peck_eis_behavior behavior);