X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Ftests_compile.c;h=473d55f821b668368a2aa673b16ded2096ca49e9;hp=4d8686798c0aa12040defb489cd28ebc4d7acd1b;hb=7bb7cd58c2d9df126dd6072e5f3bec1eb4dc916b;hpb=d50528d6c5f834bad874385b3a2c118bb39fb9ac diff --git a/tools/ccanlint/tests/tests_compile.c b/tools/ccanlint/tests/tests_compile.c index 4d868679..473d55f8 100644 --- a/tools/ccanlint/tests/tests_compile.c +++ b/tools/ccanlint/tests/tests_compile.c @@ -90,12 +90,14 @@ static void do_compile_tests(struct manifest *m, list_for_each(list, i, list) { if (!compile(score, m, i, false, list == &m->api_tests, keep, &cmdout)) { - score->error = "Failed to compile tests"; - score_file_error(score, i, 0, cmdout); + score_file_error(score, i, 0, + "Compile failed:\n%s", + cmdout); errors = true; } else if (!streq(cmdout, "")) { - score->error = "Test compiled with warnings"; - score_file_error(score, i, 0, cmdout); + score_file_error(score, i, 0, + "Compile gave warnings:\n%s", + cmdout); warnings = true; } } @@ -108,19 +110,22 @@ static void do_compile_tests(struct manifest *m, /* For historical reasons, "fail" often means "gives warnings" */ list_for_each(&m->compile_fail_tests, i, list) { if (!compile(score, m, i, false, false, false, &cmdout)) { - score->error = "Failed to compile without -DFAIL"; - score_file_error(score, i, 0, cmdout); + score_file_error(score, i, 0, + "Compile without -DFAIL failed:\n%s", + cmdout); return; } if (!streq(cmdout, "")) { - score->error = "Compile with warnigns without -DFAIL"; - score_file_error(score, i, 0, cmdout); + score_file_error(score, i, 0, + "Compile gave warnings" + " without -DFAIL:\n%s", + cmdout); return; } if (compile(score, m, i, true, false, false, &cmdout) && streq(cmdout, "")) { - score->error = "Compiled successfully with -DFAIL?"; - score_file_error(score, i, 0, NULL); + score_file_error(score, i, 0, + "Compiled successfully with -DFAIL?"); return; } }