]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/sched_ext: Return non-zero exit code on test failure
authorzhidao su <suzhidao@xiaomi.com>
Thu, 19 Mar 2026 05:30:26 +0000 (13:30 +0800)
committerTejun Heo <tj@kernel.org>
Sat, 21 Mar 2026 18:35:51 +0000 (08:35 -1000)
runner.c always returned 0 regardless of test results.  The kselftest
framework (tools/testing/selftests/kselftest/runner.sh) invokes the runner
binary and treats a non-zero exit code as a test failure; with the old
code, failed sched_ext tests were silently hidden from the parent harness
even though individual "not ok" TAP lines were emitted.

Return 1 when at least one test failed, 0 when all tests passed or were
skipped.

Signed-off-by: zhidao su <suzhidao@xiaomi.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/sched_ext/runner.c

index 37ad56c3eb2993da7dbfa920c13ca8047eb52bc9..4c68efa1512ad93981403dd768ff7a4b70be0c76 100644 (file)
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
                        printf("  - %s\n", failed_tests[i]);
        }
 
-       return 0;
+       return failed > 0 ? 1 : 0;
 }
 
 void scx_test_register(struct scx_test *test)