X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fcompulsory_tests%2Fhas_tests.c;h=46998d58cb0bb40148f050aa0c64c0bc6413e7f3;hp=662a178147276f59f2560f5ef5096dd181580b5f;hb=747a69435d9f83c0968d9689c4951bc0233ffc5e;hpb=501b31cddfaa3e8a4374dc84f6f75d07dd2d0abb diff --git a/tools/ccanlint/compulsory_tests/has_tests.c b/tools/ccanlint/compulsory_tests/has_tests.c index 662a1781..46998d58 100644 --- a/tools/ccanlint/compulsory_tests/has_tests.c +++ b/tools/ccanlint/compulsory_tests/has_tests.c @@ -15,10 +15,11 @@ static char test_is_not_dir[] = "test is not a directory"; static void *check_has_tests(struct manifest *m) { 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 +124,7 @@ static void handle_no_tests(struct manifest *m, void *check_result) } struct ccanlint has_tests = { - .name = "No tests", + .name = "Has tests", .check = check_has_tests, .describe = describe_has_tests, .handle = handle_no_tests,