kunit: Warn if tests are slow
authorMaxime Ripard <mripard@kernel.org>
Thu, 26 Oct 2023 08:59:31 +0000 (10:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:51:37 +0000 (11:51 +0100)
commit858c0840ef02e9f49dba3860a6c6d06d181de43d
tree0b4fc164ad5f2e2935154ca6ae65760fcff41c8d
parentf88c602fd0ab289d03e0e279ce83ddf01c24ec22
kunit: Warn if tests are slow

[ Upstream commit f8f2847f739dc899d0e563eac01299dadefa64ff ]

Kunit recently gained support to setup attributes, the first one being
the speed of a given test, then allowing to filter out slow tests.

A slow test is defined in the documentation as taking more than one
second. There's an another speed attribute called "super slow" but whose
definition is less clear.

Add support to the test runner to check the test execution time, and
report tests that should be marked as slow but aren't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
lib/kunit/test.c