Lines Matching refs:t
144 static int num_subtests(const struct test_suite *t) in num_subtests() argument
148 if (!t->test_cases) in num_subtests()
152 while (t->test_cases[num].name) in num_subtests()
158 static bool has_subtests(const struct test_suite *t) in has_subtests() argument
160 return num_subtests(t) > 1; in has_subtests()
163 static const char *skip_reason(const struct test_suite *t, int subtest) in skip_reason() argument
165 if (!t->test_cases) in skip_reason()
168 return t->test_cases[subtest >= 0 ? subtest : 0].skip_reason; in skip_reason()
171 static const char *test_description(const struct test_suite *t, int subtest) in test_description() argument
173 if (t->test_cases && subtest >= 0) in test_description()
174 return t->test_cases[subtest].desc; in test_description()
176 return t->desc; in test_description()
179 static test_fnptr test_function(const struct test_suite *t, int subtest) in test_function() argument
182 return t->test_cases[0].run_case; in test_function()
184 return t->test_cases[subtest].run_case; in test_function()
263 #define for_each_test(j, k, t) \ argument
265 while ((t = tests[j][k++]) != NULL)
267 static int test_and_print(struct test_suite *t, int subtest) in test_and_print() argument
272 err = run_test(t, subtest); in test_and_print()
275 if (!has_subtests(t)) in test_and_print()
276 pr_debug("%s:", t->desc); in test_and_print()
278 pr_debug("%s subtest %d:", t->desc, subtest + 1); in test_and_print()
285 const char *reason = skip_reason(t, subtest); in test_and_print()
369 struct test_suite *t; in __cmd_test() local
374 for_each_test(j, k, t) { in __cmd_test()
375 int len = strlen(test_description(t, -1)); in __cmd_test()
381 for_each_test(j, k, t) { in __cmd_test()
385 if (!perf_test__matches(test_description(t, -1), curr, argc, argv)) { in __cmd_test()
389 subn = num_subtests(t); in __cmd_test()
392 if (perf_test__matches(test_description(t, subi), in __cmd_test()
401 pr_info("%3d: %-*s:", i, width, test_description(t, -1)); in __cmd_test()
408 if (!has_subtests(t)) { in __cmd_test()
409 test_and_print(t, -1); in __cmd_test()
411 int subn = num_subtests(t); in __cmd_test()
430 int len = strlen(test_description(t, subi)); in __cmd_test()
437 if (!perf_test__matches(test_description(t, subi), in __cmd_test()
442 test_description(t, subi)); in __cmd_test()
443 test_and_print(t, subi); in __cmd_test()
460 struct test_suite t = { in perf_test__list_shell() local
464 if (!perf_test__matches(t.desc, curr, argc, argv)) in perf_test__list_shell()
467 pr_info("%3d: %s\n", i, t.desc); in perf_test__list_shell()
475 struct test_suite *t; in perf_test__list() local
478 for_each_test(j, k, t) { in perf_test__list()
481 if (!perf_test__matches(test_description(t, -1), curr, argc, argv)) in perf_test__list()
484 pr_info("%3d: %s\n", i, test_description(t, -1)); in perf_test__list()
486 if (has_subtests(t)) { in perf_test__list()
487 int subn = num_subtests(t); in perf_test__list()
492 test_description(t, subi)); in perf_test__list()