@@ -93,9 +93,9 @@ TOOLS_INCLUDES := -isystem $(top_srcdir)/tools/include/uapi
# TEST_PROGS are for test shell scripts.
# TEST_CUSTOM_PROGS and TEST_PROGS will be run by common run_tests
# and install targets. Common clean doesn't touch them.
-TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS))
-TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED))
-TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES))
+override TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS))
+override TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED))
+override TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES))
all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) \
$(if $(TEST_GEN_MODS_DIR),gen_mods_dir)
Documentation/dev-tools/kselftest.rst says you can use the "TARGETS" variable on the make command line to run only tests targeted for a single subsystem: $ make TARGETS="size timers" kselftest A natural way to narrow down further to a particular test in a subsystem is to specify e.g., TEST_GEN_PROGS: $ make TARGETS=net TEST_PROGS= TEST_GEN_PROGS=tun kselftest However, this does not work well because the following statement in tools/testing/selftests/lib.mk gets ignored: TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) Add the override directive to make it and similar ones will be effective even when TEST_GEN_PROGS and similar variables are specified in the command line. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> --- tools/testing/selftests/lib.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- base-commit: dd83757f6e686a2188997cb58b5975f744bb7786 change-id: 20250306-lib-4ac9711c10a2 Best regards,