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";
}
"warnings, and then run: it is expected to use libtap to report its\n"
"results in a simple and portable format. It should #include the C\n"
"files from the module directly (so it can probe the internals): the\n"
- "module will not be linked in.\n\n"
+ "module will not be linked in. The test will be run in a temporary\n"
+ "directory, with the test directory symlinked under test/.\n\n"
"api tests are just like a run test, except it is a guarantee of API\n"
"stability: this test should pass on all future versions of the\n"
}
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,