Lines Matching refs:t

943 static inline void __register_test(struct __test_metadata *t)  in __register_test()  argument
945 __LIST_APPEND(t->fixture->tests, t); in __register_test()
953 static inline int __bail(int for_realz, struct __test_metadata *t) in __bail() argument
957 if (t->teardown_fn) in __bail()
958 t->teardown_fn(false, t, t->self, t->variant); in __bail()
965 static void __wait_for_test(struct __test_metadata *t) in __wait_for_test() argument
978 childfd = syscall(__NR_pidfd_open, t->pid, 0); in __wait_for_test()
980 t->exit_code = KSFT_FAIL; in __wait_for_test()
983 t->name); in __wait_for_test()
989 ret = poll(&poll_child, 1, t->timeout * 1000); in __wait_for_test()
991 t->exit_code = KSFT_FAIL; in __wait_for_test()
994 t->name); in __wait_for_test()
999 kill(-(t->pid), SIGKILL); in __wait_for_test()
1001 child = waitpid(t->pid, &status, WNOHANG); in __wait_for_test()
1003 t->exit_code = KSFT_FAIL; in __wait_for_test()
1006 t->name, t->pid, errno); in __wait_for_test()
1011 t->exit_code = KSFT_FAIL; in __wait_for_test()
1013 "# %s: Test terminated by timeout\n", t->name); in __wait_for_test()
1018 t->exit_code = WEXITSTATUS(status); in __wait_for_test()
1019 } else if (t->termsig != -1) { in __wait_for_test()
1020 t->exit_code = KSFT_FAIL; in __wait_for_test()
1023 t->name, in __wait_for_test()
1029 t->exit_code = KSFT_PASS; in __wait_for_test()
1033 t->exit_code = KSFT_FAIL; in __wait_for_test()
1036 t->name); in __wait_for_test()
1040 t->exit_code = KSFT_FAIL; in __wait_for_test()
1044 t->name); in __wait_for_test()
1045 } else if (WTERMSIG(status) == t->termsig) { in __wait_for_test()
1046 t->exit_code = KSFT_PASS; in __wait_for_test()
1050 t->name, in __wait_for_test()
1054 t->exit_code = KSFT_FAIL; in __wait_for_test()
1057 t->name, in __wait_for_test()
1066 struct __test_metadata *t; in test_harness_list_tests() local
1070 t = f->tests; in test_harness_list_tests()
1080 t == f->tests ? f->name : "", in test_harness_list_tests()
1082 t ? t->name : ""); in test_harness_list_tests()
1085 t = t ? t->next : NULL; in test_harness_list_tests()
1086 } while (v || t); in test_harness_list_tests()
1138 struct __test_metadata *t) in test_enabled() argument
1150 if (!strcmp(t->name, optarg)) in test_enabled()
1165 tlen = strlen(t->name); in test_enabled()
1170 !strncmp(t->name, &optarg[flen + 1 + vlen + !!vlen], tlen)) in test_enabled()
1185 struct __test_metadata *t) in __run_test() argument
1193 t->exit_code = KSFT_PASS; in __run_test()
1194 t->trigger = 0; in __run_test()
1195 t->aborted = false; in __run_test()
1196 t->no_teardown = NULL; in __run_test()
1197 memset(t->results->reason, 0, sizeof(t->results->reason)); in __run_test()
1200 f->name, variant->name[0] ? "." : "", variant->name, t->name); in __run_test()
1211 t->exit_code = KSFT_FAIL; in __run_test()
1214 t->fn(t, variant); in __run_test()
1215 _exit(t->exit_code); in __run_test()
1217 t->pid = child; in __run_test()
1218 __wait_for_test(t); in __run_test()
1221 __test_passed(t) ? "OK" : "FAIL", test_name); in __run_test()
1225 if (xfail->test == t) in __run_test()
1228 t->exit_code = __test_passed(t) ? KSFT_XPASS : KSFT_XFAIL; in __run_test()
1230 if (t->results->reason[0]) in __run_test()
1231 diagnostic = t->results->reason; in __run_test()
1232 else if (t->exit_code == KSFT_PASS || t->exit_code == KSFT_FAIL) in __run_test()
1237 ksft_test_result_code(t->exit_code, test_name, in __run_test()
1247 struct __test_metadata *t; in test_harness_run() local
1261 for (t = f->tests; t; t = t->next) in test_harness_run()
1262 if (test_enabled(argc, argv, f, v, t)) in test_harness_run()
1279 for (t = f->tests; t; t = t->next) { in test_harness_run()
1280 if (!test_enabled(argc, argv, f, v, t)) in test_harness_run()
1283 t->results = results; in test_harness_run()
1284 __run_test(f, v, t); in test_harness_run()
1285 t->results = NULL; in test_harness_run()
1286 if (__test_passed(t)) in test_harness_run()