Documentation: kunit: Note that assertions should not be used in cleanup
authorDavid Gow <davidgow@google.com>
Wed, 10 May 2023 05:38:30 +0000 (13:38 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 12 May 2023 00:17:29 +0000 (18:17 -0600)
commit410f07492eaef600fe817eef9fd272f6692a451a
tree8a73fa665ae423cfdfcde07611d32c539baf52ae
parent55e8c1b49ac5a7f5567430cc83f2d270d8b7ce46
Documentation: kunit: Note that assertions should not be used in cleanup

As assertions abort the test cleanup process, they should be avoided
from within a suite's exit function, or from within resource 'free'
functions. Unlike with initialisation or main test execution, no further
cleanup will be performed after a failed assertion, potentially causing
a leak of resources.

Reviewed-by: Sadiya Kazi <sadiyakazi@google.com>
Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Documentation/dev-tools/kunit/usage.rst