linux/include/kunit
Stephen Boyd 5ac7973032 platform: Add test managed platform_device/driver APIs
Introduce KUnit resource wrappers around platform_driver_register(),
platform_device_alloc(), and platform_device_add() so that test authors
can register platform drivers/devices from their tests and have the
drivers/devices automatically be unregistered when the test is done.

This makes test setup code simpler when a platform driver or platform
device is needed. Add a few test cases at the same time to make sure the
APIs work as intended.

Cc: Brendan Higgins <brendan.higgins@linux.dev>
Reviewed-by: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20240718210513.3801024-6-sboyd@kernel.org
2024-07-29 15:33:12 -07:00
..
assert.h kunit: Rename KUNIT_ASSERT_FAILURE to KUNIT_FAIL_AND_ABORT for readability 2024-07-12 10:12:05 -06:00
attributes.h kunit: Add ability to filter attributes 2023-07-26 13:29:15 -06:00
device.h kunit: Add APIs for managing devices 2023-12-18 13:28:08 -07:00
of.h of: Add test managed wrappers for of_overlay_apply()/of_node_put() 2024-07-29 15:33:12 -07:00
platform_device.h platform: Add test managed platform_device/driver APIs 2024-07-29 15:33:12 -07:00
resource.h kunit: Add a macro to wrap a deferred action function 2023-12-18 13:21:14 -07:00
skbuff.h kunit: add a convenience allocation wrapper for SKBs 2024-01-03 15:35:07 +01:00
static_stub.h kunit: Allow passing function pointer to kunit_activate_static_stub() 2024-01-03 09:06:52 -07:00
test-bug.h kunit: test-bug.h: include stddef.h for NULL 2023-07-18 15:38:13 -06:00
test.h kunit: Introduce KUNIT_ASSERT_MEMEQ and KUNIT_ASSERT_MEMNEQ macros 2024-07-12 10:12:11 -06:00
try-catch.h kunit: Handle test faults 2024-05-06 14:22:02 -06:00
visibility.h kunit: add macro to allow conditionally exposing static symbols to tests 2022-12-12 14:13:48 -07:00