]> git.baikalelectronics.ru Git - kernel.git/commit
perf/hw_breakpoint: test: Skip the test if dependencies unmet
authorDavid Gow <davidgow@google.com>
Wed, 26 Oct 2022 14:10:40 +0000 (22:10 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 2 Nov 2022 11:22:05 +0000 (12:22 +0100)
commit4c2ee227bf7d4c43806b17d9f2c547aab5600d43
tree2bb1dce312665f3741732223852330c5c6030d87
parent69f7b48ed484fad71d6e930bfdaf0934d338b776
perf/hw_breakpoint: test: Skip the test if dependencies unmet

Running the test currently fails on non-SMP systems, despite being
enabled by default. This means that running the test with:

 ./tools/testing/kunit/kunit.py run --arch x86_64 hw_breakpoint

results in every hw_breakpoint test failing with:

 # test_one_cpu: failed to initialize: -22
 not ok 1 - test_one_cpu

Instead, use kunit_skip(), which will mark the test as skipped, and give
a more comprehensible message:

 ok 1 - test_one_cpu # SKIP not enough cpus

This makes it more obvious that the test is not suited to the test
environment, and so wasn't run, rather than having run and failed.

Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Daniel Latypov <dlatypov@google.com>
Acked-by: Marco Elver <elver@google.com>
Link: https://lore.kernel.org/r/20221026141040.1609203-1-davidgow@google.com
kernel/events/hw_breakpoint_test.c