Seems like my local Ubuntu install is giving bogus warnings. Allow
local valgrind overrides.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
#include <ccan/take/take.h>
#include <ccan/str/str.h>
#include <ccan/foreach/foreach.h>
#include <ccan/take/take.h>
#include <ccan/str/str.h>
#include <ccan/foreach/foreach.h>
+#include <ccan/tal/path/path.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "tests_pass.h"
bool do_valgrind = false;
#include "tests_pass.h"
bool do_valgrind = false;
+const char *valgrind_suppress = "";
static const char *can_run(struct manifest *m)
{
static const char *can_run(struct manifest *m)
{
if (!is_excluded("tests_pass_valgrind")
&& run_command(m, &timeleft, &output,
if (!is_excluded("tests_pass_valgrind")
&& run_command(m, &timeleft, &output,
+ "valgrind -q true")) {
+ const char *sfile;
+
+ /* 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);
+ }
+
run_command_async(i, *timeleft,
"valgrind -q"
" --leak-check=full"
run_command_async(i, *timeleft,
"valgrind -q"
" --leak-check=full"
+ valgrind_suppress, options,
i->compiled[COMPILE_NORMAL],
i->valgrind_log);
return;
i->compiled[COMPILE_NORMAL],
i->valgrind_log);
return;
/* Set in tests_pass. */
extern bool do_valgrind;
/* Set in tests_pass. */
extern bool do_valgrind;
+extern const char *valgrind_suppress;
extern struct ccanlint tests_pass_valgrind;
extern struct ccanlint tests_pass_valgrind;
return;
first = list_top(&score->per_file_errors, struct file_error, list);
return;
first = list_top(&score->per_file_errors, struct file_error, list);
- command = tal_fmt(m, "valgrind --leak-check=full --db-attach=yes%s %s",
+ command = tal_fmt(m, "valgrind --leak-check=full --db-attach=yes%s %s %s",
concat(score, per_file_options(&tests_pass_valgrind,
first->file)),
concat(score, per_file_options(&tests_pass_valgrind,
first->file)),
- first->file->compiled[COMPILE_NORMAL]);
+ valgrind_suppress, first->file->compiled[COMPILE_NORMAL]);
if (system(command))
doesnt_matter();
}
if (system(command))
doesnt_matter();
}