From: Sasha Levin <sashal@kernel.org>
To: Shuah Khan <shuah@kernel.org>
Cc: "Sasha Levin" <sashal@kernel.org>,
"Mark Brown" <broonie@kernel.org>,
"Ricardo B. Marlière" <rbm@suse.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/7] selftests: keep the build status from wrapping to success
Date: Wed, 14 Oct 2026 16:01:09 -0400 [thread overview]
Message-ID: <20261014200115.1363363-2-sashal@kernel.org> (raw)
In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org>
The top-level all and install rules return failure only when every
selected target fails, which commit cad6f32665cb ("selftests: Deescalate
error reporting") deliberately kept as the default. They implement this
by multiplying the exit statuses of the targets:
ret=$$((ret * $$?))
A failing recursive make exits with status 2, so eight failing targets
produce 256, and "exit 256" reports success. Building eight or more
targets that all fail therefore succeeds, and install goes on to
package an empty installation.
Record a successful target instead of multiplying statuses. The rules
still fail only when no target succeeds, and FORCE_TARGETS still stops
at the first failure.
Fixes: 5f70bde26a48 ("selftests: fix build behaviour on targets' failures")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 04cf073114318..a442b239f0610 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -236,7 +236,7 @@ all:
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET \
O=$(abs_objtree) \
$(if $(FORCE_TARGETS),|| exit); \
- ret=$$((ret * $$?)); \
+ [ $$? -eq 0 ] && ret=0; \
done; exit $$ret;
run_tests: all
@@ -303,7 +303,7 @@ ifdef INSTALL_PATH
OBJ_PATH=$(INSTALL_PATH) \
O=$(abs_objtree) \
$(if $(FORCE_TARGETS),|| exit); \
- ret=$$((ret * $$?)); \
+ [ $$? -eq 0 ] && ret=0; \
done; exit $$ret;
--
2.53.0
next prev parent reply other threads:[~2026-10-14 20:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 20:01 [PATCH 0/7] selftests: report per-suite build results without failing the build Sasha Levin
2026-10-14 20:01 ` Sasha Levin
2026-10-14 20:01 ` Sasha Levin [this message]
2026-10-14 20:01 ` [PATCH 2/7] selftests: optionally record per-suite build and install results Sasha Levin
2026-10-14 20:01 ` [PATCH 3/7] selftests/futex: report failures of the functional subdirectory Sasha Levin
2026-10-14 20:01 ` [PATCH 4/7] kselftest/arm64: keep building and installing after a subdirectory fails Sasha Levin
2026-10-14 20:01 ` [PATCH 5/7] selftests/riscv: " Sasha Levin
2026-10-14 20:01 ` Sasha Levin
2026-10-14 20:01 ` [PATCH 6/7] selftests/powerpc: report the outcome of each subdirectory Sasha Levin
2026-10-14 20:01 ` [PATCH 7/7] selftests/sparc64: report failures of the drivers subdirectory Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261014200115.1363363-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rbm@suse.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.