kunit: Print last test location on fault
authorMickaël Salaün <mic@digikod.net>
Mon, 8 Apr 2024 07:46:24 +0000 (09:46 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 May 2024 20:22:02 +0000 (14:22 -0600)
commit8bd5d74babc92558da67497918210e053515b2c4
tree520c4ffd646f8bd306272e03b455d6123cf2ca19
parent70585f05fbd2bfc25289ff8d95189fa2ed80b9a4
kunit: Print last test location on fault

This helps identify the location of test faults with opportunistic calls
to _KUNIT_SAVE_LOC().  This can be useful while writing tests or
debugging them.  It is possible to call KUNIT_SUCCESS() to explicit save
last location.

Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Link: https://lore.kernel.org/r/20240408074625.65017-7-mic@digikod.net
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/kunit/test.h
lib/kunit/try-catch.c