summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-01-04 21:11:47 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-01-04 21:11:47 +1030
commitb3a47758b62c98a3a981e7b822e68c37380831e3 (patch)
treef6c77104d80119d32fbbb73d6ab0926a157d394a
parent2d4243996a4ace6d4eac1da460dd5bbcb31304ce (diff)
ccanlint: have valgrind fail with an error, always
The upcoming failtest module can only tell that a child failed when it exits with a non-zero error. So we need this, although it means for ccanlint it still needs to look at output to distinguish a memory leak from a real error.
-rw-r--r--tools/ccanlint/tests/run_tests_valgrind.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/tools/ccanlint/tests/run_tests_valgrind.c b/tools/ccanlint/tests/run_tests_valgrind.c
index b5e4eff8..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++;
}
}