Skip to content

Commit cad6f32

Browse files
broonieshuahkh
authored andcommitted
selftests: Deescalate error reporting
Commit 7e47389 ("selftests: Preserve subtarget failures in all/install") updated the propagation of errors from indivdual kselftest targets to be similar to that seen with FORCE_TARGETS. While it would be really nice to be in a position to do this currently it is premature to do this as the default behaviour. At present we default to trying to build all selftests but a combination of code quality issues and build dependencies mean that it is almost certain that at least one of them will fail to build (for example, several depend on clang so don't work in a GCC container) and a top level failure in the kselftest build reported. Further, the resulting failures mean that the install target does not run at all so any build problem is escallated to a complete failure to produce a kselftest tarball so CI systems that run into issues loose all selftests coverage. This has been causing disruption to a range of CI systems including KernelCI, mine and Arm's internal one. Revert the commit, users who need this behaviour should be able to use FORCE_TARGETS for the time being. At present users that do this (such as linux-next) are most likely building a subset of targets known to succeed in their environments. Link: https://lore.kernel.org/r/20260416-selftests-deescalate-error-reporting-v1-1-38e7c0536227@kernel.org Fixes: 7e47389 ("selftests: Preserve subtarget failures in all/install") Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent f8e0a5a commit cad6f32

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/testing/selftests/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ export KHDR_INCLUDES
209209
.DEFAULT_GOAL := all
210210

211211
all:
212-
@ret=0; \
212+
@ret=1; \
213213
for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \
214214
BUILD_TARGET=$$BUILD/$$TARGET; \
215215
mkdir $$BUILD_TARGET -p; \
216216
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET \
217217
O=$(abs_objtree) \
218218
$(if $(FORCE_TARGETS),|| exit); \
219-
[ $$? -eq 0 ] || ret=1; \
219+
ret=$$((ret * $$?)); \
220220
done; exit $$ret;
221221

222222
run_tests: all
@@ -274,7 +274,7 @@ ifdef INSTALL_PATH
274274
install -m 744 kselftest/ksft.py $(INSTALL_PATH)/kselftest/
275275
install -m 744 run_kselftest.sh $(INSTALL_PATH)/
276276
rm -f $(TEST_LIST)
277-
@ret=0; \
277+
@ret=1; \
278278
for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \
279279
BUILD_TARGET=$$BUILD/$$TARGET; \
280280
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install \
@@ -283,7 +283,7 @@ ifdef INSTALL_PATH
283283
OBJ_PATH=$(INSTALL_PATH) \
284284
O=$(abs_objtree) \
285285
$(if $(FORCE_TARGETS),|| exit); \
286-
[ $$? -eq 0 ] || ret=1; \
286+
ret=$$((ret * $$?)); \
287287
done; exit $$ret;
288288

289289

0 commit comments

Comments
 (0)