]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/compulsory_tests/has_tests.c
ccanlint: fix directory issues properly.
[ccan] / tools / ccanlint / compulsory_tests / has_tests.c
index 662a178147276f59f2560f5ef5096dd181580b5f..46998d58cb0bb40148f050aa0c64c0bc6413e7f3 100644 (file)
@@ -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,