[PATCH v2 07/44] test: Rename test suites to match their linker-list name

Simon Glass sjg at chromium.org
Mon Jan 20 22:25:29 CET 2025


Some suites have a different name from that used in the linker list.
That makes it hard to programmatically match the name printed when the
suite runs to the linker-list name it has.

Update the names so they are the same.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 include/test/cmd.h    | 2 +-
 test/boot/upl.c       | 3 +--
 test/cmd/addrmap.c    | 2 +-
 test/cmd/cmd_ut_cmd.c | 4 ++--
 test/cmd/exit.c       | 2 +-
 test/cmd/mem.c        | 2 +-
 test/cmd/pci_mps.c    | 2 +-
 test/cmd/setexpr.c    | 2 +-
 test/dm/test-dm.c     | 3 +--
 test/env/cmd_ut_env.c | 3 +--
 10 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/include/test/cmd.h b/include/test/cmd.h
index c200570e423..3d1e3e3bddb 100644
--- a/include/test/cmd.h
+++ b/include/test/cmd.h
@@ -10,6 +10,6 @@
 #include <test/test.h>
 
 /* Declare a new command test */
-#define CMD_TEST(_name, _flags) UNIT_TEST(_name, _flags, cmd_test)
+#define CMD_TEST(_name, _flags) UNIT_TEST(_name, _flags, cmd)
 
 #endif /* __TEST_CMD_H__ */
diff --git a/test/boot/upl.c b/test/boot/upl.c
index 99f02b7951b..ef65cf34055 100644
--- a/test/boot/upl.c
+++ b/test/boot/upl.c
@@ -432,6 +432,5 @@ int do_ut_upl(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	struct unit_test *tests = UNIT_TEST_SUITE_START(upl_test);
 	const int n_ents = UNIT_TEST_SUITE_COUNT(upl_test);
 
-	return cmd_ut_category("cmd_upl", "cmd_upl_", tests, n_ents, argc,
-			       argv);
+	return cmd_ut_category("upl", "cmd_upl_", tests, n_ents, argc, argv);
 }
diff --git a/test/cmd/addrmap.c b/test/cmd/addrmap.c
index b34be895f5d..43897615aa9 100644
--- a/test/cmd/addrmap.c
+++ b/test/cmd/addrmap.c
@@ -30,6 +30,6 @@ int do_ut_addrmap(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	struct unit_test *tests = UNIT_TEST_SUITE_START(addrmap_test);
 	const int n_ents = UNIT_TEST_SUITE_COUNT(addrmap_test);
 
-	return cmd_ut_category("cmd_addrmap", "cmd_addrmap_", tests, n_ents,
+	return cmd_ut_category("addrmap", "cmd_addrmap_", tests, n_ents,
 			       argc, argv);
 }
diff --git a/test/cmd/cmd_ut_cmd.c b/test/cmd/cmd_ut_cmd.c
index e77fa1c7f01..ad192563c5a 100644
--- a/test/cmd/cmd_ut_cmd.c
+++ b/test/cmd/cmd_ut_cmd.c
@@ -13,8 +13,8 @@
 
 int do_ut_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
-	struct unit_test *tests = UNIT_TEST_SUITE_START(cmd_test);
-	const int n_ents = UNIT_TEST_SUITE_COUNT(cmd_test);
+	struct unit_test *tests = UNIT_TEST_SUITE_START(cmd);
+	const int n_ents = UNIT_TEST_SUITE_COUNT(cmd);
 
 	return cmd_ut_category("cmd", "cmd_test_", tests, n_ents, argc, argv);
 }
diff --git a/test/cmd/exit.c b/test/cmd/exit.c
index af58a57fca7..cf65c05e283 100644
--- a/test/cmd/exit.c
+++ b/test/cmd/exit.c
@@ -116,6 +116,6 @@ int do_ut_exit(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	struct unit_test *tests = UNIT_TEST_SUITE_START(exit_test);
 	const int n_ents = UNIT_TEST_SUITE_COUNT(exit_test);
 
-	return cmd_ut_category("cmd_exit", "exit_test_", tests, n_ents,
+	return cmd_ut_category("exit", "exit_test_", tests, n_ents,
 			       argc, argv);
 }
diff --git a/test/cmd/mem.c b/test/cmd/mem.c
index f1bbab6055b..d6f2544a4e9 100644
--- a/test/cmd/mem.c
+++ b/test/cmd/mem.c
@@ -14,6 +14,6 @@ int do_ut_mem(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	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,
+	return cmd_ut_category("mem", "mem_test_", tests, n_ents, argc,
 			       argv);
 }
diff --git a/test/cmd/pci_mps.c b/test/cmd/pci_mps.c
index a265105600c..0c57d15d636 100644
--- a/test/cmd/pci_mps.c
+++ b/test/cmd/pci_mps.c
@@ -35,6 +35,6 @@ int do_ut_pci_mps(struct cmd_tbl *cmdtp, int flag, int argc,
 	struct unit_test *tests = UNIT_TEST_SUITE_START(pci_mps_test);
 	const int n = UNIT_TEST_SUITE_COUNT(pci_mps_test);
 
-	return cmd_ut_category("cmd_pci_mps", "pci_mps_test_", tests, n,
+	return cmd_ut_category("pci_mps", "pci_mps_test_", tests, n,
 			       argc, argv);
 }
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index 21a3268bd81..9b3277f2ad9 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -485,6 +485,6 @@ int do_ut_setexpr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	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,
+	return cmd_ut_category("setexpr", "setexpr_test_", tests, n_ents,
 			       argc, argv);
 }
diff --git a/test/dm/test-dm.c b/test/dm/test-dm.c
index 4bc2c45db61..7cfbefe02da 100644
--- a/test/dm/test-dm.c
+++ b/test/dm/test-dm.c
@@ -11,6 +11,5 @@ int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	struct unit_test *tests = UNIT_TEST_SUITE_START(dm_test);
 	const int n_ents = UNIT_TEST_SUITE_COUNT(dm_test);
 
-	return cmd_ut_category("driver model", "dm_test_", tests, n_ents, argc,
-			       argv);
+	return cmd_ut_category("dm", "dm_test_", tests, n_ents, argc, argv);
 }
diff --git a/test/env/cmd_ut_env.c b/test/env/cmd_ut_env.c
index 9f16a978f2a..494b5db395b 100644
--- a/test/env/cmd_ut_env.c
+++ b/test/env/cmd_ut_env.c
@@ -80,6 +80,5 @@ int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	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);
+	return cmd_ut_category("env", "env_test_", tests, n_ents, argc, argv);
 }
-- 
2.43.0



More information about the U-Boot mailing list