tools/testing/selftests/sched_ext/runner.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/sched_ext/runner.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/sched_ext/runner.c- Extension
.c- Size
- 5961 bytes
- Lines
- 256
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hunistd.hsignal.hlibgen.hbpf/bpf.hscx_test.h
Detected Declarations
function sigint_handlerfunction print_test_preamblefunction print_test_resultfunction should_skip_testfunction run_testfunction test_validfunction mainfunction scx_test_register
Annotated Snippet
switch (opt) {
case 'q':
quiet = true;
break;
case 's':
print_skipped = true;
break;
case 'l':
list = true;
break;
case 't':
filter = optarg;
break;
default:
fprintf(stderr, help_fmt, basename(argv[0]));
return opt != 'h';
}
}
if (optind < argc) {
fprintf(stderr, "Unexpected argument '%s'. Use -t to filter tests.\n",
argv[optind]);
return 1;
}
if (filter) {
for (i = 0; i < __scx_num_tests; i++) {
if (!should_skip_test(&__scx_tests[i], filter))
break;
}
if (i == __scx_num_tests) {
fprintf(stderr, "No tests matched filter '%s'\n", filter);
fprintf(stderr, "Available tests (use -l to list):\n");
for (i = 0; i < __scx_num_tests; i++)
fprintf(stderr, " %s\n", __scx_tests[i].name);
return 1;
}
}
for (i = 0; i < __scx_num_tests; i++) {
enum scx_test_status status;
struct scx_test *test = &__scx_tests[i];
if (exit_req)
break;
if (list) {
printf("%s\n", test->name);
if (i == (__scx_num_tests - 1))
return 0;
continue;
}
if (filter && should_skip_test(test, filter)) {
/*
* Printing the skipped tests and their preambles can
* add a lot of noise to the runner output. Printing
* this is only really useful for CI, so let's skip it
* by default.
*/
if (print_skipped) {
print_test_preamble(test, quiet);
print_test_result(test, SCX_TEST_SKIP, ++testnum);
}
continue;
}
print_test_preamble(test, quiet);
status = run_test(test);
print_test_result(test, status, ++testnum);
switch (status) {
case SCX_TEST_PASS:
passed++;
break;
case SCX_TEST_SKIP:
skipped_tests[skipped++] = test->name;
break;
case SCX_TEST_FAIL:
failed_tests[failed++] = test->name;
break;
}
}
printf("\n\n=============================\n\n");
printf("RESULTS:\n\n");
printf("PASSED: %u\n", passed);
printf("SKIPPED: %u\n", skipped);
printf("FAILED: %u\n", failed);
if (skipped > 0) {
printf("\nSkipped tests:\n");
for (i = 0; i < skipped; i++)
Annotation
- Immediate include surface: `stdio.h`, `unistd.h`, `signal.h`, `libgen.h`, `bpf/bpf.h`, `scx_test.h`.
- Detected declarations: `function sigint_handler`, `function print_test_preamble`, `function print_test_result`, `function should_skip_test`, `function run_test`, `function test_valid`, `function main`, `function scx_test_register`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.