X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Frun_tests_valgrind.c;h=ec3a31981c21f01331fd6d1a934a95f33f452f60;hp=21b8660af09b0dbcc2c3cdd840ffc780146c649f;hb=b3a47758b62c98a3a981e7b822e68c37380831e3;hpb=070a8e6aa3d2b50553d84f7d6e8e37b5a112804c diff --git a/tools/ccanlint/tests/run_tests_valgrind.c b/tools/ccanlint/tests/run_tests_valgrind.c index 21b8660a..ec3a3198 100644 --- a/tools/ccanlint/tests/run_tests_valgrind.c +++ b/tools/ccanlint/tests/run_tests_valgrind.c @@ -108,26 +108,24 @@ static void do_run_tests_vg(struct manifest *m, score->total++; /* FIXME: Valgrind's output sucks. XML is unreadable by * humans, and you can't have both. */ - if (run_command(score, timeleft, &cmdout, - "valgrind -q --leak-check=full" - " --log-fd=3 %s %s" - " 3> valgrind.log", - run_tests_vg.options ? - run_tests_vg.options : "", - i->compiled)) { - output = grab_file(i, "valgrind.log", NULL); - if (!output || output[0] == '\0') { - err = NULL; - } else { - i->leak_info = get_leaks(output, &err); - } - if (err) { - score_file_error(score, i, 0, err); - } else - score->score++; + run_command(score, timeleft, &cmdout, + "valgrind -q --error-exitcode=101" + " --leak-check=full" + " --log-fd=3 %s %s" + " 3> valgrind.log", + run_tests_vg.options ? + run_tests_vg.options : "", + i->compiled); + output = grab_file(i, "valgrind.log", NULL); + if (!output || output[0] == '\0') { + err = NULL; } else { - score_file_error(score, i, 0, cmdout); + i->leak_info = get_leaks(output, &err); } + if (err) + score_file_error(score, i, 0, err); + else + score->score++; } } @@ -171,7 +169,9 @@ static void run_under_debugger_vg(struct manifest *m, struct score *score) return; first = list_top(&score->per_file_errors, struct file_error, list); - command = talloc_asprintf(m, "valgrind --db-attach=yes %s", + command = talloc_asprintf(m, "valgrind --db-attach=yes%s %s", + run_tests_vg.options ? + run_tests_vg.options : "", first->file->compiled); if (system(command)) doesnt_matter();