]> www.infradead.org Git - users/hch/misc.git/commit
selftests: harness: Stop using setjmp()/longjmp()
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Mon, 5 May 2025 15:15:30 +0000 (17:15 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Tue, 13 May 2025 05:35:54 +0000 (07:35 +0200)
commit6a25f787912a73613f12e7eefbebd72ee3d43f85
tree3090d38da3593c1e182b31c980dc6c39d34ad3a0
parent7befb97e8828f8042d8f100318f487ad0fa3c19b
selftests: harness: Stop using setjmp()/longjmp()

Usage of longjmp() was added to ensure that teardown is always run in
commit 63e6b2a42342 ("selftests/harness: Run TEARDOWN for ASSERT failures")
However instead of calling longjmp() to the teardown handler it is easier to
just call the teardown handler directly from __bail().
Any potential duplicate teardown invocations are harmless as the actual
handler will only ever be executed once since
commit fff37bd32c76 ("selftests/harness: Fix fixture teardown").

Additionally this removes a incompatibility with nolibc,
which does not support setjmp()/longjmp().

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250505-nolibc-kselftest-harness-v4-12-ee4dd5257135@linutronix.de
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/testing/selftests/kselftest_harness.h