@@ -73,14 +73,9 @@ ifdef building_out_of_srctree
@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \
rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \
fi
- @if [ "X$(TEST_PROGS)" != "X" ]; then \
- $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS)) ; \
- else \
- $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS)); \
- fi
-else
- @$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS))
endif
+ @$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) \
+ $(addprefix $(OUTPUT)/,$(TEST_PROGS)))
define INSTALL_SINGLE_RULE
$(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH))
Remove redundant check for TEST_PROGS and use the same command for in- and out-of-source builds, and fix bug with adding $(OUTPUT)/ to first $(TEST_PROGS) element only: 1) use $(addprefix ...) function to add $(OUTPUT). In case of blank $(TEST_PROGS) it will be expanded to blank, so no need for extra check; 2) $(OUTPUT) is always initialized to current dir or supplied value, so it does not make any harm to add it unconditionally. Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com> --- tools/testing/selftests/lib.mk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)