X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Frun_tests_valgrind.c;h=9dd8247eb0774613e04b00142d8b7bd046965e00;hp=5819b5eba4a5342ce6f93aba4d9941a6d3924ca9;hb=32710c917e41b6a283ab73190614623c1a8e9508;hpb=357700fd05c2cf25563a0058fd68f2ffea827e74 diff --git a/tools/ccanlint/tests/run_tests_valgrind.c b/tools/ccanlint/tests/run_tests_valgrind.c index 5819b5eb..9dd8247e 100644 --- a/tools/ccanlint/tests/run_tests_valgrind.c +++ b/tools/ccanlint/tests/run_tests_valgrind.c @@ -17,7 +17,8 @@ /* Note: we already test safe_mode in run_tests.c */ static const char *can_run_vg(struct manifest *m) { - char *output = run_command(m, "valgrind -q true"); + unsigned int timeleft = default_timeout_ms; + char *output = run_command(m, &timeleft, "valgrind -q --error-exitcode=0 true"); if (output) return talloc_asprintf(m, "No valgrind support: %s", output); @@ -30,7 +31,9 @@ struct run_tests_result { const char *output; }; -static void *do_run_tests_vg(struct manifest *m) +static void *do_run_tests_vg(struct manifest *m, + bool keep, + unsigned int *timeleft) { struct list_head *list = talloc(m, struct list_head); struct run_tests_result *res; @@ -50,8 +53,9 @@ static void *do_run_tests_vg(struct manifest *m) list_for_each(&m->run_tests, i, list) { run_tests_vg.total_score++; - /* FIXME: timeout here */ - cmdout = run_command(m, "valgrind -q %s", i->compiled); + cmdout = run_command(m, timeleft, + "valgrind -q --error-exitcode=100 %s", + i->compiled); if (cmdout) { res = talloc(list, struct run_tests_result); res->file = i; @@ -62,8 +66,9 @@ static void *do_run_tests_vg(struct manifest *m) list_for_each(&m->api_tests, i, list) { run_tests_vg.total_score++; - /* FIXME: timeout here */ - cmdout = run_command(m, "valgrind -q %s", i->compiled); + cmdout = run_command(m, timeleft, + "valgrind -q --error-exitcode=100 %s", + i->compiled); if (cmdout) { res = talloc(list, struct run_tests_result); res->file = i; @@ -127,7 +132,7 @@ static void run_under_debugger_vg(struct manifest *m, void *check_result) } struct ccanlint run_tests_vg = { - .key = "valgrind", + .key = "valgrind-tests", .name = "Module's run and api tests succeed under valgrind", .score = score_run_tests_vg, .check = do_run_tests_vg,