]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/tests_pass_valgrind.c
ccanlint: print coverage amount when -vv
[ccan] / tools / ccanlint / tests / tests_pass_valgrind.c
index 4c4338b6c1c6d3ab20ad9e93a61cdf3da8361c78..da61dd364729daf87c42cbeb91fbe184e9069e0b 100644 (file)
@@ -17,7 +17,7 @@
 #include <string.h>
 #include <ctype.h>
 
-struct ccanlint run_tests_vg;
+REGISTER_TEST(tests_pass_valgrind);
 
 /* Note: we already test safe_mode in run_tests.c */
 static const char *can_run_vg(struct manifest *m)
@@ -112,11 +112,12 @@ static void do_run_tests_vg(struct manifest *m,
                         * humans, and you can't have both. */
                        run_command(score, timeleft, &cmdout,
                                    "valgrind -q --error-exitcode=101"
+                                   " --child-silent-after-fork=yes"
                                    " --leak-check=full"
                                    " --log-fd=3 %s %s"
                                    " 3> valgrind.log",
-                                   run_tests_vg.options ?
-                                   run_tests_vg.options : "",
+                                   tests_pass_valgrind.options ?
+                                   tests_pass_valgrind.options : "",
                                    i->compiled);
                        output = grab_file(i, "valgrind.log", NULL);
                        if (!output || output[0] == '\0') {
@@ -173,8 +174,8 @@ static void run_under_debugger_vg(struct manifest *m, struct score *score)
 
        first = list_top(&score->per_file_errors, struct file_error, list);
        command = talloc_asprintf(m, "valgrind --db-attach=yes%s %s",
-                                 run_tests_vg.options ?
-                                 run_tests_vg.options : "",
+                                 tests_pass_valgrind.options ?
+                                 tests_pass_valgrind.options : "",
                                  first->file->compiled);
        if (system(command))
                doesnt_matter();
@@ -190,8 +191,6 @@ struct ccanlint tests_pass_valgrind = {
        .needs = "tests_pass"
 };
 
-REGISTER_TEST(tests_pass_valgrind);
-
 struct ccanlint tests_pass_valgrind_noleaks = {
        .key = "tests_pass_valgrind_noleaks",
        .name = "Module's run and api tests have no memory leaks",