Skip to content

Commit 99aaceb

Browse files
Yauheni Kaliutashuahkh
authored andcommitted
selftests: do not use .ONESHELL
Using one shell for the whole recipe with long lists can cause make[1]: execvp: /bin/sh: Argument list too long with some shells. Triggered by commit 309b81f ("selftests/bpf: Install generated test progs") It requires to change the rule which rely on the one shell behaviour (run_tests). Simplify also INSTALL_SINGLE_RULE, remove extra echo, required to workaround .ONESHELL. Signed-off-by: Yauheni Kaliuta <[email protected]> Cc: Jiri Benc <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 05790fd commit 99aaceb

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

tools/testing/selftests/lib.mk

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ else
5959
all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
6060
endif
6161

62-
.ONESHELL:
6362
define RUN_TESTS
64-
@BASE_DIR="$(selfdir)"; \
63+
BASE_DIR="$(selfdir)"; \
6564
. $(selfdir)/kselftest/runner.sh; \
6665
if [ "X$(summary)" != "X" ]; then \
6766
per_test_logging=1; \
@@ -71,22 +70,21 @@ endef
7170

7271
run_tests: all
7372
ifdef building_out_of_srctree
74-
@if [ "X$(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)" != "X" ]; then
75-
@rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT)
73+
@if [ "X$(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)" != "X" ]; then \
74+
rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \
7675
fi
77-
@if [ "X$(TEST_PROGS)" != "X" ]; then
78-
$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS))
79-
else
80-
$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS))
76+
@if [ "X$(TEST_PROGS)" != "X" ]; then \
77+
$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS)) ; \
78+
else \
79+
$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS)); \
8180
fi
8281
else
83-
$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS))
82+
@$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS))
8483
endif
8584

8685
define INSTALL_SINGLE_RULE
8786
$(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH))
88-
$(if $(INSTALL_LIST),@echo rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/)
89-
$(if $(INSTALL_LIST),@rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/)
87+
$(if $(INSTALL_LIST),rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/)
9088
endef
9189

9290
define INSTALL_RULE

0 commit comments

Comments
 (0)