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";
}
}
struct ccanlint has_tests = {
- .name = "No tests",
+ .key = "has-tests",
+ .name = "Module has tests",
.check = check_has_tests,
.describe = describe_has_tests,
.handle = handle_no_tests,
};
+
+REGISTER_TEST(has_tests, NULL);