From: Simon Glass Date: Fri, 7 Feb 2025 18:30:46 +0000 (-0700) Subject: test: Update fdt_overlay to do init from tests X-Git-Tag: v2025.07-rc1~18^2~104^2~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7290bc4b7248118046f748d80088a40f9171576;p=pandora-u-boot.git test: Update fdt_overlay 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 --- diff --git a/include/test/fdt_overlay.h b/include/test/fdt_overlay.h index 34e8020a496..251ad0ec97a 100644 --- a/include/test/fdt_overlay.h +++ b/include/test/fdt_overlay.h @@ -12,4 +12,8 @@ /* Declare a new FDT-overlay test */ #define FDT_OVERLAY_TEST(_name, _flags) UNIT_TEST(_name, _flags, fdt_overlay) +/* Declare init for FDT-overlay test */ +#define FDT_OVERLAY_TEST_INIT(_name, _flags) \ + UNIT_TEST_INIT(_name, _flags, fdt_overlay) + #endif /* __TEST_OVERLAY_H__ */ diff --git a/test/fdt_overlay/cmd_ut_fdt_overlay.c b/test/fdt_overlay/cmd_ut_fdt_overlay.c index ac8a3b2be23..c716c6bd6b0 100644 --- a/test/fdt_overlay/cmd_ut_fdt_overlay.c +++ b/test/fdt_overlay/cmd_ut_fdt_overlay.c @@ -81,6 +81,7 @@ static int fdt_overlay_init(struct unit_test_state *uts) return 0; } +FDT_OVERLAY_TEST_INIT(fdt_overlay_init, 0); static int fdt_getprop_str(void *fdt, const char *path, const char *name, const char **out) @@ -243,7 +244,6 @@ int do_ut_fdt_overlay(struct unit_test_state *uts, struct cmd_tbl *cmdtp, const int n_ents = UNIT_TEST_SUITE_COUNT(fdt_overlay); int ret = -ENOMEM; - ut_assertok(fdt_overlay_init(uts)); ret = cmd_ut_category(uts, "fdt_overlay", "fdt_overlay_test_", tests, n_ents, argc, argv);