From 8655b77d57ace45d4d040ef297cf172f3c12f4bd Mon Sep 17 00:00:00 2001 From: Carlos Maniero Date: Wed, 3 May 2023 22:11:12 -0300 Subject: munit: Show the filename as the first when error Munit uses the follow format: Error: file.c:line: error message But this error format does not works well with vim make program. This commit changes the error to the follow format: file.c:line: Error: error message Signed-off-by: Carlos Maniero --- test/munit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/munit.c b/test/munit.c index 2500018..43e8e13 100644 --- a/test/munit.c +++ b/test/munit.c @@ -171,6 +171,9 @@ munit_logf_exv(MunitLogLevel level, FILE* fp, const char* filename, int line, co if (level < munit_log_level_visible) return; + if (filename != NULL) + fprintf(fp, "%s:%d: ", filename, line); + switch (level) { case MUNIT_LOG_DEBUG: fputs("Debug", fp); @@ -190,8 +193,6 @@ munit_logf_exv(MunitLogLevel level, FILE* fp, const char* filename, int line, co } fputs(": ", fp); - if (filename != NULL) - fprintf(fp, "%s:%d: ", filename, line); vfprintf(fp, format, ap); fputc('\n', fp); } -- cgit v1.2.3