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 <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-02-07 11:30:46 -07:00
parent 8bfd7b3b4d
commit 0fac05b062
2 changed files with 5 additions and 1 deletions

View File

@@ -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__ */

View File

@@ -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);