ccanlint: Add -k option to keep results.
[ccan] / tools / ccanlint / compulsory_tests / run_tests.c
index 2fd87a8c5c4978204926440aa4f6ef02c27cbdbf..9f1f4a4a21723f21a1bf96408e83c6e4f8ad305d 100644 (file)
@@ -27,7 +27,9 @@ struct run_tests_result {
        const char *output;
 };
 
        const char *output;
 };
 
-static void *do_run_tests(struct manifest *m)
+static void *do_run_tests(struct manifest *m,
+                         bool keep,
+                         unsigned int *timeleft)
 {
        struct list_head *list = talloc(m, struct list_head);
        struct run_tests_result *res;
 {
        struct list_head *list = talloc(m, struct list_head);
        struct run_tests_result *res;
@@ -47,8 +49,7 @@ static void *do_run_tests(struct manifest *m)
 
        list_for_each(&m->run_tests, i, list) {
                run_tests.total_score++;
 
        list_for_each(&m->run_tests, i, list) {
                run_tests.total_score++;
-               /* FIXME: timeout here */
-               cmdout = run_command(m, i->compiled);
+               cmdout = run_command(m, timeleft, i->compiled);
                if (cmdout) {
                        res = talloc(list, struct run_tests_result);
                        res->file = i;
                if (cmdout) {
                        res = talloc(list, struct run_tests_result);
                        res->file = i;
@@ -59,8 +60,7 @@ static void *do_run_tests(struct manifest *m)
 
        list_for_each(&m->api_tests, i, list) {
                run_tests.total_score++;
 
        list_for_each(&m->api_tests, i, list) {
                run_tests.total_score++;
-               /* FIXME: timeout here */
-               cmdout = run_command(m, i->compiled);
+               cmdout = run_command(m, timeleft, i->compiled);
                if (cmdout) {
                        res = talloc(list, struct run_tests_result);
                        res->file = i;
                if (cmdout) {
                        res = talloc(list, struct run_tests_result);
                        res->file = i;
@@ -125,7 +125,7 @@ static void run_under_debugger(struct manifest *m, void *check_result)
 
 struct ccanlint run_tests = {
        .key = "run",
 
 struct ccanlint run_tests = {
        .key = "run",
-       .name = "run and api tests run successfully",
+       .name = "Module's run and api tests pass",
        .score = score_run_tests,
        .check = do_run_tests,
        .describe = describe_run_tests,
        .score = score_run_tests,
        .check = do_run_tests,
        .describe = describe_run_tests,