From: Sasha Levin <sashal@kernel.org>
To: Shuah Khan <shuah@kernel.org>
Cc: "Sasha Levin" <sashal@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Andreas Larsson" <andreas@gaisler.com>,
sparclinux@vger.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 7/7] selftests/sparc64: report failures of the drivers subdirectory
Date: Wed, 14 Oct 2026 16:01:15 -0400 [thread overview]
Message-ID: <20261014200115.1363363-8-sashal@kernel.org> (raw)
In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org>
The sparc64 suite builds and installs its subdirectories in shell loops
whose status is that of the last command. For the build that is the
copy of the subdirectory's test script, so "make all" succeeds even
when the drivers tests fail to compile, and FORCE_TARGETS has no effect.
Fold the copy into the status of the subdirectory and let both loops
return failure when no subdirectory succeeds, which matches how the
top-level selftests Makefile treats its targets, or as soon as one fails
when FORCE_TARGETS is set. When a build report is requested, record
each subdirectory as sparc64/<subdir>. Invoke the subdirectories with
$(MAKE) so that they use the parent's jobserver.
Fixes: 3c545084130c ("selftests: sparc64: char: Selftest for privileged ADI driver")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/sparc64/Makefile | 33 ++++++++++++++++--------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/tools/testing/selftests/sparc64/Makefile b/tools/testing/selftests/sparc64/Makefile
index 88f7be76f962d..a979c819348a0 100644
--- a/tools/testing/selftests/sparc64/Makefile
+++ b/tools/testing/selftests/sparc64/Makefile
@@ -2,6 +2,8 @@
ARCH ?= $(shell uname -m 2>/dev/null || echo not)
override ARCH := $(shell echo $(ARCH) | sed -e s/x86_64/x86/)
+include ../build_report.mk
+
ifneq ($(ARCH),sparc64)
nothing:
.PHONY: all clean run_tests install
@@ -18,33 +20,42 @@ TEST_PROGS := run.sh
include ../lib.mk
all:
- @for DIR in $(SUBDIRS); do \
- BUILD_TARGET=$(OUTPUT)/$$DIR; \
- mkdir $$BUILD_TARGET -p; \
- make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
+ @ret=$(if $(SUBDIRS),1,0); for DIR in $(SUBDIRS); do \
+ BUILD_TARGET=$(OUTPUT)/$$DIR; \
+ mkdir -p $$BUILD_TARGET && \
+ $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
+ status=$$?; \
#SUBDIR test prog name should be in the form: SUBDIR_test.sh \
TEST=$$DIR"_test.sh"; \
if [ -e $$DIR/$$TEST ]; then \
- rsync -a $$DIR/$$TEST $$BUILD_TARGET/; \
- fi \
- done
+ rsync -a $$DIR/$$TEST $$BUILD_TARGET/ || \
+ [ $$status -ne 0 ] || status=1; \
+ fi; \
+ $(call ksft_record_build_status,all,sparc64/$$DIR); \
+ $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \
+ [ $$status -eq 0 ] && ret=0; \
+ done; exit $$ret
override define INSTALL_RULE
mkdir -p $(INSTALL_PATH)
install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
- @for SUBDIR in $(SUBDIRS); do \
+ @ret=$(if $(SUBDIRS),1,0); for SUBDIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \
- mkdir $$BUILD_TARGET -p; \
+ mkdir -p $$BUILD_TARGET && \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
- done;
+ status=$$?; \
+ $(call ksft_record_build_status,install,sparc64/$$SUBDIR); \
+ $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \
+ [ $$status -eq 0 ] && ret=0; \
+ done; exit $$ret
endef
override define CLEAN
@for DIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
mkdir $$BUILD_TARGET -p; \
- make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
+ $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
done
endef
endif
--
2.53.0
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 ` [PATCH 1/7] selftests: keep the build status from wrapping to success Sasha Levin
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 ` Sasha Levin [this message]
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-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andreas@gaisler.com \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rbm@suse.com \
--cc=shuah@kernel.org \
--cc=sparclinux@vger.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.