kunit: Add speed attribute
authorRae Moar <rmoar@google.com>
Tue, 25 Jul 2023 21:25:13 +0000 (21:25 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 26 Jul 2023 19:29:04 +0000 (13:29 -0600)
commit02c2d0c2a84172c3c7ec0229c61db55d23dd4730
tree7650b2cb6ee1aba5515d9b087b343a4ac50c65f8
parent39e92cb1e4a1f6a12097ea2aa9e9ca6f2d2f8a83
kunit: Add speed attribute

Add speed attribute to the test attribute API. This attribute will allow
users to mark tests with a category of speed.

Currently the categories of speed proposed are: normal, slow, and very_slow
(outlined in enum kunit_speed). These are outlined in the enum kunit_speed.

The assumed default speed for tests is "normal". This indicates that the
test takes a relatively trivial amount of time (less than 1 second),
regardless of the machine it is running on. Any test slower than this could
be marked as "slow" or "very_slow".

Add the macro KUNIT_CASE_SLOW to set a test as slow, as this is likely a
common use of the attributes API.

Add an example of marking a slow test to kunit-example-test.c.

Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Rae Moar <rmoar@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/kunit/test.h
lib/kunit/attributes.c
lib/kunit/kunit-example-test.c