X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fcompulsory_tests%2Fhas_tests.c;h=04dd4495bb33e2207f8402ecb4ff3bf1ecff0fbe;hp=cd31d2229cca047d41c758c7702d58bf1c7f725c;hb=fb4c4c3ddc24772f71a64ec02d2c9ddaeb6e9f6b;hpb=0c532d80a73cae44360595c762dddefcd7e0a4ec diff --git a/tools/ccanlint/compulsory_tests/has_tests.c b/tools/ccanlint/compulsory_tests/has_tests.c index cd31d222..04dd4495 100644 --- a/tools/ccanlint/compulsory_tests/has_tests.c +++ b/tools/ccanlint/compulsory_tests/has_tests.c @@ -12,13 +12,16 @@ static char test_is_not_dir[] = "test is not a directory"; -static void *check_has_tests(struct manifest *m) +static void *check_has_tests(struct manifest *m, + bool keep, + unsigned int *timeleft) { struct stat st; + char *test_dir = talloc_asprintf(m, "%s/test", m->dir); - if (lstat("test", &st) != 0) { + if (lstat(test_dir, &st) != 0) { if (errno != ENOENT) - err(1, "statting test/"); + err(1, "statting %s", test_dir); return "You have no test directory"; } @@ -123,7 +126,8 @@ static void handle_no_tests(struct manifest *m, void *check_result) } struct ccanlint has_tests = { - .name = "Has tests", + .key = "has-tests", + .name = "Module has tests", .check = check_has_tests, .describe = describe_has_tests, .handle = handle_no_tests,