From c7326f969178ab2a231944f09d9bfec52f053f44 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 7 Feb 2025 11:30:48 -0700 Subject: test: Update bootstd to do init from tests Rather than having an init function and then running the tests, create a test-init function to do it. This will allow us to get rid of the command function. Signed-off-by: Simon Glass --- test/boot/bootstd_common.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/boot/bootstd_common.c') diff --git a/test/boot/bootstd_common.c b/test/boot/bootstd_common.c index 724e3d9bdd2..e28cae7f374 100644 --- a/test/boot/bootstd_common.c +++ b/test/boot/bootstd_common.c @@ -21,8 +21,14 @@ /* tracks whether bootstd_setup_for_tests() has been run yet */ bool vbe_setup_done; -/* set up MMC for VBE tests */ -int bootstd_setup_for_tests(void) +/** + * bootstd_setup_for_tests() - Set up MMC data for VBE tests + * + * Some data is needed for VBE tests to work. This function sets that up. + * + * @return 0 if OK, -ve on error + */ +static int bootstd_setup_for_tests(struct unit_test_state *uts) { ALLOC_CACHE_ALIGN_BUFFER(u8, buf, MMC_MAX_BLOCK_LEN); struct udevice *mmc; @@ -55,6 +61,7 @@ int bootstd_setup_for_tests(void) return 0; } +BOOTSTD_TEST_INIT(bootstd_setup_for_tests, 0); int bootstd_test_drop_bootdev_order(struct unit_test_state *uts) { @@ -99,13 +106,6 @@ int do_ut_bootstd(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag, { struct unit_test *tests = UNIT_TEST_SUITE_START(bootstd); const int n_ents = UNIT_TEST_SUITE_COUNT(bootstd); - int ret; - - ret = bootstd_setup_for_tests(); - if (ret) { - printf("Failed to set up for bootstd tests (err=%d)\n", ret); - return CMD_RET_FAILURE; - } return cmd_ut_category(uts, "bootstd", "bootstd_", tests, n_ents, argc, argv); -- cgit v1.2.3 From 7e1c6bd0778baffd90164e69f1d5f8ea8729a5ae Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 7 Feb 2025 11:30:49 -0700 Subject: test: Drop the function for running bootstd tests Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass --- test/boot/bootstd_common.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'test/boot/bootstd_common.c') diff --git a/test/boot/bootstd_common.c b/test/boot/bootstd_common.c index e28cae7f374..6a84810983c 100644 --- a/test/boot/bootstd_common.c +++ b/test/boot/bootstd_common.c @@ -100,13 +100,3 @@ void bootstd_reset_usb(void) { usb_started = false; } - -int do_ut_bootstd(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag, - int argc, char *const argv[]) -{ - struct unit_test *tests = UNIT_TEST_SUITE_START(bootstd); - const int n_ents = UNIT_TEST_SUITE_COUNT(bootstd); - - return cmd_ut_category(uts, "bootstd", "bootstd_", - tests, n_ents, argc, argv); -} -- cgit v1.2.3 From 32aba887e3d7cbcdf8fd98c107aaa79f3bd44a16 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 7 Feb 2025 11:30:56 -0700 Subject: test: Drop suites.h This file is empty now. Remove it and its uses. Signed-off-by: Simon Glass --- test/boot/bootstd_common.c | 1 - 1 file changed, 1 deletion(-) (limited to 'test/boot/bootstd_common.c') diff --git a/test/boot/bootstd_common.c b/test/boot/bootstd_common.c index 6a84810983c..052c0fe5cc6 100644 --- a/test/boot/bootstd_common.c +++ b/test/boot/bootstd_common.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include "bootstd_common.h" -- cgit v1.2.3