Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/sched_ext: Improve runner error reporting for invalid arguments

Report an error for './runner foo' (positional arg instead of -t) and
for './runner -t foo' when the filter matches no tests. Previously both
cases produced no error output.

Pre-scan the test list before the main loop so the error is reported
immediately, avoiding spurious SKIP output from '-s' when no tests
match.

Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Cheng-Yang Chou and committed by
Tejun Heo
ff1befcb 39375419

+20
+20
tools/testing/selftests/sched_ext/runner.c
··· 164 164 } 165 165 } 166 166 167 + if (optind < argc) { 168 + fprintf(stderr, "Unexpected argument '%s'. Use -t to filter tests.\n", 169 + argv[optind]); 170 + return 1; 171 + } 172 + 173 + if (filter) { 174 + for (i = 0; i < __scx_num_tests; i++) { 175 + if (!should_skip_test(&__scx_tests[i], filter)) 176 + break; 177 + } 178 + if (i == __scx_num_tests) { 179 + fprintf(stderr, "No tests matched filter '%s'\n", filter); 180 + fprintf(stderr, "Available tests (use -l to list):\n"); 181 + for (i = 0; i < __scx_num_tests; i++) 182 + fprintf(stderr, " %s\n", __scx_tests[i].name); 183 + return 1; 184 + } 185 + } 186 + 167 187 for (i = 0; i < __scx_num_tests; i++) { 168 188 enum scx_test_status status; 169 189 struct scx_test *test = &__scx_tests[i];