]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/tests_pass_valgrind.c
ccanlint: use ccan/autodata
[ccan] / tools / ccanlint / tests / tests_pass_valgrind.c
index 8ccdad963ee072e88a32400ce3b3cba9f29ff987..773a85e66a5a17aca87595bb0ca8f67441158a2e 100644 (file)
@@ -18,9 +18,6 @@
 #include <string.h>
 #include <ctype.h>
 
-REGISTER_TEST(tests_pass_valgrind);
-REGISTER_TEST(tests_pass_valgrind_noleaks);
-
 /* Note: we already test safe_mode in run_tests.c */
 static const char *can_run_vg(struct manifest *m)
 {
@@ -29,6 +26,20 @@ static const char *can_run_vg(struct manifest *m)
        return NULL;
 }
 
+static void do_leakcheck_vg(struct manifest *m,
+                           unsigned int *timeleft,
+                           struct score *score);
+
+static struct ccanlint tests_pass_valgrind_noleaks = {
+       .key = "tests_pass_valgrind_noleaks",
+       .name = "Module's run and api tests have no memory leaks",
+       .check = do_leakcheck_vg,
+       .takes_options = true,
+       .needs = "tests_pass_valgrind"
+};
+REGISTER_TEST(tests_pass_valgrind_noleaks);
+
+
 /* Example output:
 ==2749== Conditional jump or move depends on uninitialised value(s)
 ==2749==    at 0x4026C60: strnlen (mc_replace_strmem.c:263)
@@ -257,12 +268,4 @@ struct ccanlint tests_pass_valgrind = {
        .takes_options = true,
        .needs = "tests_pass"
 };
-
-struct ccanlint tests_pass_valgrind_noleaks = {
-       .key = "tests_pass_valgrind_noleaks",
-       .name = "Module's run and api tests have no memory leaks",
-       .check = do_leakcheck_vg,
-       .takes_options = true,
-       .needs = "tests_pass_valgrind"
-};
-
+REGISTER_TEST(tests_pass_valgrind);