summaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-08 03:35:10 +0300
committerTom Rini <trini@konsulko.com>2021-03-12 17:57:30 +0300
commita7a98755b888254cbc1857c567ce898a8e105e0f (patch)
tree0edc3980d46d0e17f31661064c58b72873d2fa67 /include/test
parent5c1cf4d2dab12a8f5b4a49dc2f06f582db69c1ef (diff)
downloadu-boot-a7a98755b888254cbc1857c567ce898a8e105e0f.tar.xz
test: Add a macros for finding tests in linker_lists
At present we use the linker list directly. This is not very friendly, so add a helpful macro instead. This will also allow us to change the naming later without updating this code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/test.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/test/test.h b/include/test/test.h
index 5eeec35f52..b16c9135f2 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -93,6 +93,12 @@ struct unit_test {
.func = _name, \
}
+/* Get the start of a list of unit tests for a particular category */
+#define UNIT_TEST_SUITE_START(_suite) \
+ ll_entry_start(struct unit_test, _suite)
+#define UNIT_TEST_SUITE_COUNT(_suite) \
+ ll_entry_count(struct unit_test, _suite)
+
/* Sizes for devres tests */
enum {
TEST_DEVRES_SIZE = 100,