From dc6bbb7bdfa676eb8b5710952f58eba60f6caac6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 28 Dec 2025 20:53:14 -0700 Subject: [PATCH] doc: ut: Document return value Add documentation for the return value of the ut command: - Returns 0 on success if all tests pass - Returns 1 on failure if any test fails - Skipped tests do not cause a failure Also explain when tests may be skipped and how to detect skipped tests programmatically using the -E flag. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- doc/usage/cmd/ut.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/usage/cmd/ut.rst b/doc/usage/cmd/ut.rst index c40928dece9..731579e5b1d 100644 --- a/doc/usage/cmd/ut.rst +++ b/doc/usage/cmd/ut.rst @@ -84,6 +84,23 @@ To specify a list of suites to run, can also be a comma-separated list. See :ref:`develop/tests_writing:writing c tests` for more information on how to write unit tests. +Return Value +------------ + +The `ut` command returns 0 (success) if all tests pass, or 1 (failure) if any +test fails. + +Skipped tests do not cause a failure return. Tests may be skipped for several +reasons: + +- Manual tests (with `_norun` suffix) are skipped unless `-f` or `-m` is used +- Tests requiring features not available on the current platform (e.g., + `UTF_OTHER_FDT` on non-sandbox, console recording disabled) +- Tests that explicitly request to be skipped by returning `-EAGAIN` + +To detect skipped tests programmatically, use the `-E` flag and check for +`Result: SKIP:` lines in the output. + ut all ~~~~~~