X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Ftests_pass.c;h=af71dbe4c9f58cce4cc5da90a8e58da2c84b129b;hp=cb093264c74ba7d2a3500c49fe6b2151f6518395;hb=79ac0049672b1f27b1a7121d06cc38721f76b8e1;hpb=54d5123a56011f805500a8d18e178874300be1f7 diff --git a/tools/ccanlint/tests/tests_pass.c b/tools/ccanlint/tests/tests_pass.c index cb093264..af71dbe4 100644 --- a/tools/ccanlint/tests/tests_pass.c +++ b/tools/ccanlint/tests/tests_pass.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -17,6 +18,7 @@ #include "tests_pass.h" bool do_valgrind = false; +const char *valgrind_suppress = ""; static const char *can_run(struct manifest *m) { @@ -27,9 +29,18 @@ static const char *can_run(struct manifest *m) if (!is_excluded("tests_pass_valgrind") && run_command(m, &timeleft, &output, - "valgrind -q true")) + "valgrind -q true")) { + const char *sfile; + do_valgrind = true; + /* Check for suppressions file for all of CCAN. */ + sfile = path_join(m, ccan_dir, ".valgrind_suppressions"); + if (path_is_file(sfile)) + valgrind_suppress = tal_fmt(m, "--suppressions=%s", + sfile); + } + return NULL; } @@ -67,9 +78,9 @@ static void run_test(void *ctx, run_command_async(i, *timeleft, "valgrind -q" " --leak-check=full" - " --log-fd=3 %s %s" + " --log-fd=3 %s %s %s" " 3> %s", - options, + valgrind_suppress, options, i->compiled[COMPILE_NORMAL], i->valgrind_log); return;