selftests/mm: add helper for logging test start and results
authorMark Brown <broonie@kernel.org>
Tue, 27 May 2025 16:04:46 +0000 (17:04 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 1 Jun 2025 05:46:16 +0000 (22:46 -0700)
commit3f192afbede24c60e59db1272ad155a3a44f5fe7
tree9d1f80322e4ca0c6296a5c7bad5ca0d92efeb293
parent109364fce504dae70b13eccc51a7bfc71528d154
selftests/mm: add helper for logging test start and results

Several of the MM tests have a pattern of printing a description of the
test to be run then reporting the actual TAP result using a generic string
not connected to the specific test, often in a shared function used by
many tests.  The name reported typically varies depending on the specific
result rather than the test too.  This causes problems for tooling that
works with test results, the names reported with the results are used to
deduplicate tests and track them between runs so both duplicated names and
changing names cause trouble for things like UIs and automated bisection.

As a first step towards matching these tests better with the expectations
of kselftest provide helpers which record the test name as part of the
initial print and then use that as part of reporting a result.

This is not added as a generic kselftest helper partly because the use of
a variable to store the test name doesn't fit well with the header only
implementation of kselftest.h and partly because it's not really an
intended pattern.  Ideally at some point the mm tests that use it will be
updated to not need it.

Link: https://lkml.kernel.org/r/20250527-selftests-mm-cow-dedupe-v2-2-ff198df8e38e@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/vm_util.h