.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,
int do_ut_bloblist(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test,
- bloblist_test);
- const int n_ents = ll_entry_count(struct unit_test, bloblist_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(bloblist_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(bloblist_test);
return cmd_ut_category("bloblist", "bloblist_test_",
tests, n_ents, argc, argv);
int do_ut_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test, bootm_test);
- const int n_ents = ll_entry_count(struct unit_test, bootm_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(bootm_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(bootm_test);
return cmd_ut_category("bootm", "bootm_test_", tests, n_ents,
argc, argv);
int do_ut_mem(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test, mem_test);
- const int n_ents = ll_entry_count(struct unit_test, mem_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(mem_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(mem_test);
return cmd_ut_category("cmd_mem", "mem_test_", tests, n_ents, argc,
argv);
int do_ut_setexpr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test,
- setexpr_test);
- const int n_ents = ll_entry_count(struct unit_test, setexpr_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(setexpr_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(setexpr_test);
return cmd_ut_category("cmd_setexpr", "setexpr_test_", tests, n_ents,
argc, argv);
int do_ut_compression(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test,
- compression_test);
- const int n_ents = ll_entry_count(struct unit_test, compression_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(compression_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(compression_test);
return cmd_ut_category("compression", "compression_test_",
tests, n_ents, argc, argv);
int dm_test_run(const char *test_name)
{
- struct unit_test *tests = ll_entry_start(struct unit_test, dm_test);
- const int n_ents = ll_entry_count(struct unit_test, dm_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(dm_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(dm_test);
int ret;
ret = ut_run_list("driver model", "dm_test_", tests, n_ents, test_name);
int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test, env_test);
- const int n_ents = ll_entry_count(struct unit_test, env_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(env_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(env_test);
return cmd_ut_category("environment", "env_test_",
tests, n_ents, argc, argv);
int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test, lib_test);
- const int n_ents = ll_entry_count(struct unit_test, lib_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(lib_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(lib_test);
return cmd_ut_category("lib", "lib_test_", tests, n_ents, argc, argv);
}
int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test, log_test);
- const int n_ents = ll_entry_count(struct unit_test, log_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(log_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(log_test);
return cmd_ut_category("log", "log_test_",
tests, n_ents, argc, argv);
int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test,
- optee_test);
- const int n_ents = ll_entry_count(struct unit_test, optee_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(optee_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(optee_test);
struct unit_test_state *uts;
void *fdt_optee = &__dtb_test_optee_optee_begin;
void *fdt_no_optee = &__dtb_test_optee_no_optee_begin;
int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test,
- overlay_test);
- const int n_ents = ll_entry_count(struct unit_test, overlay_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(overlay_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(overlay_test);
struct unit_test_state *uts;
void *fdt_base = &__dtb_test_fdt_base_begin;
void *fdt_overlay = &__dtb_test_fdt_overlay_begin;
int do_ut_str(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test,
- str_test);
- const int n_ents = ll_entry_count(struct unit_test, str_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(str_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(str_test);
return cmd_ut_category("str", "str_", tests, n_ents, argc, argv);
}
int do_ut_unicode(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- struct unit_test *tests = ll_entry_start(struct unit_test, unicode_test);
- const int n_ents = ll_entry_count(struct unit_test, unicode_test);
+ struct unit_test *tests = UNIT_TEST_SUITE_START(unicode_test);
+ const int n_ents = UNIT_TEST_SUITE_COUNT(unicode_test);
return cmd_ut_category("Unicode", "unicode_test_",
tests, n_ents, argc, argv);