[tip: locking/futex] selftests/futex: Report failures of the functional subdirectory

From: tip-bot2 for Sasha Levin

Date: Mon Nov 30 2026 - 16:07:24 EST


The following commit has been merged into the locking/futex branch of tip:

Commit-ID: 5b11eb8eb218d19a723e77c78e8d80949d20b97a
Gitweb: https://git.kernel.org/tip/5b11eb8eb218d19a723e77c78e8d80949d20b97a
Author: Sasha Levin <sashal@xxxxxxxxxx>
AuthorDate: Wed, 14 Oct 2026 16:01:11 -04:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Mon, 30 Nov 2026 22:03:34 +01:00

selftests/futex: Report failures of the functional subdirectory

The futex suite builds its tests in the functional subdirectory and then
copies run.sh into the output directory. The copy is the last command of
the loop, so its status replaces that of the build, and "make all"
succeeds even when the functional tests fail to compile.

Fold the copy into the status of the subdirectory, count a failure to
create the output directory as well, and let the build and installation
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 futex/<subdir> so that a failure is visible even when
make itself succeeds.

Fixes: 9c3340ea7f5d ("selftests: futex: copy sub-dir test scripts for make O=dir run")
Fixes: 9705315b7562 ("selftests/futex: Update Makefile to use lib.mk")
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Link: https://patch.msgid.link/20261014200115.1363363-4-sashal@xxxxxxxxxx
---
tools/testing/selftests/futex/Makefile | 32 ++++++++++++++++---------
1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
index 78ab2cd..d692377 100644
--- a/tools/testing/selftests/futex/Makefile
+++ b/tools/testing/selftests/futex/Makefile
@@ -4,26 +4,36 @@ SUBDIRS := functional
TEST_PROGS := run.sh

include ../lib.mk
+include $(selfdir)/build_report.mk

all:
- @for DIR in $(SUBDIRS); do \
- BUILD_TARGET=$(OUTPUT)/$$DIR; \
- mkdir $$BUILD_TARGET -p; \
- $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
- if [ -e $$DIR/$(TEST_PROGS) ]; then \
- rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \
- fi \
- done
+ @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=$$?; \
+ if [ -e $$DIR/$(TEST_PROGS) ]; then \
+ rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/ || \
+ [ $$status -ne 0 ] || status=1; \
+ fi; \
+ $(call ksft_record_build_status,all,futex/$$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,futex/$$SUBDIR); \
+ $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \
+ [ $$status -eq 0 ] && ret=0; \
+ done; exit $$ret
endef

override define CLEAN