]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/tests_pass_valgrind.c
tools: don't unnecessarily redefine _GNU_SOURCE in config.h
[ccan] / tools / ccanlint / tests / tests_pass_valgrind.c
index 33eb6b1f6f083ee258b06460f5b1593357405eec..f17fbca4f9b7fa633e1c6e2a045d36f5284586c7 100644 (file)
@@ -112,6 +112,7 @@ 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",
@@ -126,7 +127,7 @@ static void do_run_tests_vg(struct manifest *m,
                                i->leak_info = get_leaks(output, &err);
                        }
                        if (err)
-                               score_file_error(score, i, 0, err);
+                               score_file_error(score, i, 0, "%s", err);
                        else
                                score->score++;
                }
@@ -148,15 +149,17 @@ static void do_leakcheck_vg(struct manifest *m,
        foreach_ptr(list, &m->run_tests, &m->api_tests) {
                list_for_each(list, i, list) {
                        if (i->leak_info) {
-                               score_file_error(score, i, 0, i->leak_info);
+                               score_file_error(score, i, 0, "%s",
+                                                i->leak_info);
                                leaks = true;
                        }
                }
        }
 
+       /* FIXME: We don't fail for this, since many tests leak. */ 
+       score->pass = true;
        if (!leaks) {
                score->score = 1;
-               score->pass = true;
        }
 }