X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fcompulsory_tests%2Frun_tests.c;h=52c5fb1041877f2e8daa4613b50bf9a14212c512;hp=763b54a3e66924e38a8611680992cccec6101c58;hb=6c579abb882331704795349a7d3c5797bc408562;hpb=747a69435d9f83c0968d9689c4951bc0233ffc5e diff --git a/tools/ccanlint/compulsory_tests/run_tests.c b/tools/ccanlint/compulsory_tests/run_tests.c index 763b54a3..52c5fb10 100644 --- a/tools/ccanlint/compulsory_tests/run_tests.c +++ b/tools/ccanlint/compulsory_tests/run_tests.c @@ -27,7 +27,7 @@ struct run_tests_result { const char *output; }; -static void *do_run_tests(struct manifest *m) +static void *do_run_tests(struct manifest *m, unsigned int *timeleft) { struct list_head *list = talloc(m, struct list_head); struct run_tests_result *res; @@ -47,8 +47,7 @@ static void *do_run_tests(struct manifest *m) 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; @@ -59,8 +58,7 @@ static void *do_run_tests(struct manifest *m) 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; @@ -104,6 +102,9 @@ static const char *describe_run_tests(struct manifest *m, return descrip; } +/* Gcc's warn_unused_result is fascist bullshit. */ +#define doesnt_matter() + static void run_under_debugger(struct manifest *m, void *check_result) { char *command; @@ -116,11 +117,13 @@ static void run_under_debugger(struct manifest *m, void *check_result) first = list_top(list, struct run_tests_result, list); command = talloc_asprintf(m, "gdb -ex 'break tap.c:136' -ex 'run' %s", first->file->compiled); - system(command); + if (system(command)) + doesnt_matter(); } struct ccanlint run_tests = { - .name = "run and api tests run successfully", + .key = "run", + .name = "Module's run and api tests pass", .score = score_run_tests, .check = do_run_tests, .describe = describe_run_tests,