Stripped the path from test log filenames.
This commit is contained in:
parent
dbbf84becc
commit
07c613b2e1
|
@ -197,10 +197,22 @@ void testingprivTLogfFull(testingT *t, const char *file, long line, const char *
|
||||||
va_end(ap);
|
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)
|
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: ", basename(file), line);
|
||||||
testingprivOutbufPrintf(t->outbuf, "%s:%ld: ", file, line);
|
|
||||||
testingprivOutbufVprintf(t->outbuf, format, ap);
|
testingprivOutbufVprintf(t->outbuf, format, ap);
|
||||||
testingprivOutbufPrintf(t->outbuf, "\n");
|
testingprivOutbufPrintf(t->outbuf, "\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue