[Concept,5/9] test: ut: Add -m as alias for the -f flag

Message ID 20251229160611.3899708-6-sjg@u-boot.org
State New
Headers
Series test: Various improvements to unit-test infrastructure |

Commit Message

Simon Glass Dec. 29, 2025, 4:06 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add -m as an alias for the -f flag which forces manual tests to run.
This provides consistency with external test runners that will use -m
for "manual" tests.

Also update the documentation to explain what manual tests are, and fix
a typo ("types" -> "times") in the -r description.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 doc/usage/cmd/ut.rst | 10 ++++++----
 test/cmd_ut.c        |  5 +++--
 2 files changed, 9 insertions(+), 6 deletions(-)
  

Patch

diff --git a/doc/usage/cmd/ut.rst b/doc/usage/cmd/ut.rst
index a26ee6ad7de..07cd970da6c 100644
--- a/doc/usage/cmd/ut.rst
+++ b/doc/usage/cmd/ut.rst
@@ -11,7 +11,7 @@  Synopsis
 
 ::
 
-    ut [-r<runs>] [-f] [-R] [-I<n>:<one_test>] [<suite> | all [<test>]] [<args>...]
+    ut [-fmr<runs>] [-R] [-I<n>:<one_test>] [<suite> | all [<test>]] [<args>...]
     ut [-s] info
 
 Description
@@ -26,11 +26,13 @@  suite
 test
     Speciifes a particular test to run, within a suite, or all suites
 
--f
-    Forces running of a manual test.
+-f, -m
+    Force running of manual tests. Manual tests have the `_norun` suffix and
+    are normally skipped because they require external setup (e.g., creating
+    disk images from Python/pytest).
 
 -r <n>
-    Specifies the number of types to run each test
+    Specifies the number of times to run each test
 
 -I <n>:<one_test>
     Test to run after <n> other tests have run.  This is used to find which test
diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index 8d8a2d763a2..050f7ee6caf 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -272,6 +272,7 @@  static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 			runs_per_text = dectoul(str + 2, NULL);
 			break;
 		case 'f':
+		case 'm':
 			force_run = true;
 			break;
 		case 'I':
@@ -340,9 +341,9 @@  static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 }
 
 U_BOOT_LONGHELP(ut,
-	"[-rs] [-f] [-R] [-I<n>:<one_test>] <suite> [<test> [<args>...]] - run unit tests\n"
+	"[-fmrs] [-R] [-I<n>:<one_test>] <suite> [<test> [<args>...]] - run unit tests\n"
 	"   -r<runs>   Number of times to run each test\n"
-	"   -f         Force 'manual' tests to run as well\n"
+	"   -f/-m      Force 'manual' tests to run as well\n"
 	"   -I         Test to run after <n> other tests have run\n"
 	"   -R         Preserve console recording on test failure\n"
 	"   -s         Show all suites with ut info\n"