ret = test_harness_argv_check(argc, argv);
for (f = __fixture_list; f; f = f->next) {
for (v = f->variant ?: &no_variant; v; v = v->next) {
unsigned int old_tests = test_count;
for (t = f->tests; t; t = t->next)
if (test_enabled(argc, argv, f, v, t))
test_count++;
if (old_tests != test_count)
case_count++;
}
}
ksft_print_header();
ksft_set_plan(test_count);
ksft_print_msg("Starting %u tests from %u test cases.\n",
test_count, case_count);
for (f = __fixture_list; f; f = f->next) {
for (v = f->variant ?: &no_variant; v; v = v->next) {
for (t = f->tests; t; t = t->next) {
if (!test_enabled(argc, argv, f, v, t))
continue;
...
__run_test(f, v, t);
t->results = NULL;
if (__test_passed(t))
pass_count++;
else
ret = 1;
}
}
}
$./harness-selftest -h
Usage: ./harness-selftest [-h|-l] [-t|-T|-v|-V|-f|-F|-r name]
-h print help
-l list all tests
-t name include test
-T name exclude test
-v name include variant
-V name exclude variant
-f name include fixture
-F name exclude fixture
-r name run specified test
Test filter options can be specified multiple times. The filtering stops
at the first match. For example to include all tests from variant 'bla'
but not test 'foo' specify '-T foo -v bla'.
for (f = __fixture_list; f; f = f->next) {
for (v = f->variant ?: &no_variant; v; v = v->next) {
unsigned int old_tests = test_count;
for (t = f->tests; t; t = t->next)
if (test_enabled(argc, argv, f, v, t))
test_count++;
if (old_tests != test_count)
case_count++;
}
}