]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/run_kselftest.sh: exit with error if tests fail
authorBrendan Jackman <jackmanb@google.com>
Tue, 11 Nov 2025 17:36:42 +0000 (17:36 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 19 Nov 2025 22:00:22 +0000 (15:00 -0700)
commitd9e6269e330392fd75f8d9db268e7e10541a7ba4
tree6639016096aebbfe6143286c60202bdc235d9a4e
parent26347f844381a5ae870b51efb8a927bc35ab7d42
selftests/run_kselftest.sh: exit with error if tests fail

Parsing KTAP is quite an inconvenience, but most of the time the thing
you really want to know is "did anything fail"?

Let's give the user the his information without them needing
to parse anything.

Because of the use of subshells and namespaces, this needs to be
communicated via a file. Just write arbitrary data into the file and
treat non-empty content as a signal that something failed.

In case any user depends on the current behaviour, such as running this
from a script with `set -e` and parsing the result for failures
afterwards, add a flag they can set to get the old behaviour, namely
--no-error-on-fail.

Link: https://lore.kernel.org/r/20251111-b4-ksft-error-on-fail-v3-1-0951a51135f6@google.com
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/kselftest/runner.sh
tools/testing/selftests/run_kselftest.sh