]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/run_tests_valgrind.c
ccanlint: rename test keys
[ccan] / tools / ccanlint / tests / run_tests_valgrind.c
index b5e4eff8f881e305d2a53fb7f6b2d0682f69634a..6e18338d19f0c2edf3a119d4805f5fe02913f6ed 100644 (file)
@@ -108,26 +108,24 @@ static void do_run_tests_vg(struct manifest *m,
                        score->total++;
                        /* FIXME: Valgrind's output sucks.  XML is unreadable by
                         * humans, and you can't have both. */
-                       if (run_command(score, timeleft, &cmdout,
-                                       "valgrind -q --leak-check=full"
-                                       " --log-fd=3 %s %s"
-                                       " 3> valgrind.log",
-                                       run_tests_vg.options ?
-                                       run_tests_vg.options : "",
-                                       i->compiled)) {
-                               output = grab_file(i, "valgrind.log", NULL);
-                               if (!output || output[0] == '\0') {
-                                       err = NULL;
-                               } else {
-                                       i->leak_info = get_leaks(output, &err);
-                               }
-                               if (err) {
-                                       score_file_error(score, i, 0, err);
-                               } else
-                                       score->score++;
+                       run_command(score, timeleft, &cmdout,
+                                   "valgrind -q --error-exitcode=101"
+                                   " --leak-check=full"
+                                   " --log-fd=3 %s %s"
+                                   " 3> valgrind.log",
+                                   run_tests_vg.options ?
+                                   run_tests_vg.options : "",
+                                   i->compiled);
+                       output = grab_file(i, "valgrind.log", NULL);
+                       if (!output || output[0] == '\0') {
+                               err = NULL;
                        } else {
-                               score_file_error(score, i, 0, cmdout);
+                               i->leak_info = get_leaks(output, &err);
                        }
+                       if (err)
+                               score_file_error(score, i, 0, err);
+                       else
+                               score->score++;
                }
        }
 
@@ -180,7 +178,7 @@ static void run_under_debugger_vg(struct manifest *m, struct score *score)
 }
 
 struct ccanlint run_tests_vg = {
-       .key = "valgrind-tests",
+       .key = "tests_pass_valgrind",
        .name = "Module's run and api tests succeed under valgrind",
        .can_run = can_run_vg,
        .check = do_run_tests_vg,
@@ -191,7 +189,7 @@ struct ccanlint run_tests_vg = {
 REGISTER_TEST(run_tests_vg, &run_tests, NULL);
 
 struct ccanlint run_tests_vg_leak = {
-       .key = "valgrind-leaks",
+       .key = "tests_pass_valgrind_noleaks",
        .name = "Module's run and api tests leak memory",
        .check = do_leakcheck_vg,
 };