Stripped the path from test log filenames.

This commit is contained in:
Pietro Gagliardi 2019-05-26 13:31:55 -04:00
parent dbbf84becc
commit 07c613b2e1
1 changed files with 14 additions and 2 deletions

View File

@ -197,10 +197,22 @@ void testingprivTLogfFull(testingT *t, const char *file, long line, const char *
va_end(ap);
}
static const char *basename(const char *file)
{
const char *p;
for (;;) {
p = strpbrk(file, "/\\");
if (p == NULL)
break;
file = p + 1;
}
return file;
}
void testingprivTLogvfFull(testingT *t, const char *file, long line, const char *format, va_list ap)
{
// TODO extract filename from file
testingprivOutbufPrintf(t->outbuf, "%s:%ld: ", file, line);
testingprivOutbufPrintf(t->outbuf, "%s:%ld: ", basename(file), line);
testingprivOutbufVprintf(t->outbuf, format, ap);
testingprivOutbufPrintf(t->outbuf, "\n");
}