kunit: add tests for using current KUnit test field
authorRae Moar <rmoar@google.com>
Mon, 3 Apr 2023 20:19:30 +0000 (20:19 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 5 Apr 2023 18:51:30 +0000 (12:51 -0600)
commita42077b787680cbc365a96446b30f32399fa3f6f
treee54b89d16d310ab3914cea2b96cb32daf2f308b5
parent8110a3cab05ee4a26f36015f0423fb2b5cea1392
kunit: add tests for using current KUnit test field

Create test suite called "kunit_current" to add test coverage for the use
of current->kunit_test, which returns the current KUnit test.

Add two test cases:
- kunit_current_test to test current->kunit_test and the method
  kunit_get_current_test(), which utilizes current->kunit_test.

- kunit_current_fail_test to test the method
  kunit_fail_current_test(), which utilizes current->kunit_test.

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