Lines Matching refs:test
21 * Construct a test directory with the following structure:
446 struct basic_test *test = &tests[i];
455 if (!(test->how.flags & O_CREAT))
456 test->how.flags |= O_PATH;
458 if (test->dir)
459 dfd = openat(rootfd, test->dir, O_PATH | O_DIRECTORY);
462 E_assert(dfd, "failed to openat root '%s': %m", test->dir);
466 fd = sys_openat2(dfd, test->path, &test->how);
467 if (test->pass)
468 failed = (fd < 0 || !fdequal(fd, rootfd, test->out.path));
470 failed = (fd != test->out.err);
488 if (test->pass)
489 resultfn("%s gives path '%s'\n", test->name,
490 test->out.path ?: ".");
492 resultfn("%s fails with %d (%s)\n", test->name,
493 test->out.err, strerror(-test->out.err));