Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: add EXTRA_CLEAN for clean target

Some testcases need the clean extra data after running. This patch
introduce the "EXTRA_CLEAN" variable to address this requirement.

After KBUILD_OUTPUT is enabled in later patch, it will be easy to
decide to if we need do the cleanup in the KBUILD_OUTPUT path(if the
testcase ran immediately after compiled).

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>

authored by

bamvor.zhangjian@huawei.com and committed by
Shuah Khan
80d443e8 5a2d4a57

+17 -24
+9 -10
tools/testing/selftests/exec/Makefile
··· 1 1 CFLAGS = -Wall 2 2 3 + TEST_GEN_PROGS := execveat 4 + TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir 5 + # Makefile is a run-time dependency, since it's accessed by the execveat test 6 + TEST_FILES := Makefile 7 + 8 + EXTRA_CLEAN := subdir.moved execveat.moved xxxxx* 9 + 10 + include ../lib.mk 11 + 3 12 subdir: 4 13 mkdir -p $@ 5 14 script: ··· 20 11 execveat.denatured: execveat 21 12 cp $< $@ 22 13 chmod -x $@ 23 - 24 - TEST_GEN_PROGS := execveat 25 - TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir 26 - # Makefile is a run-time dependency, since it's accessed by the execveat test 27 - TEST_FILES := Makefile 28 - 29 - include ../lib.mk 30 - 31 - clean: 32 - rm -rf $(TEST_GEN_PROGS) $(TEST_GEN_FILES) subdir.moved execveat.moved xxxxx*
+1 -3
tools/testing/selftests/ftrace/Makefile
··· 2 2 3 3 TEST_PROGS := ftracetest 4 4 TEST_FILES := test.d 5 + EXTRA_CLEAN := logs/* 5 6 6 7 include ../lib.mk 7 - 8 - clean: 9 - rm -rf logs/*
+2 -2
tools/testing/selftests/kcmp/Makefile
··· 2 2 3 3 TEST_GEN_PROGS := kcmp_test 4 4 5 + EXTRA_CLEAN := kcmp-test-file 6 + 5 7 include ../lib.mk 6 8 7 - clean: 8 - $(RM) $(TEST_GEN_PROGS) kcmp-test-file
+1 -1
tools/testing/selftests/lib.mk
··· 43 43 all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) 44 44 45 45 clean: 46 - $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) 46 + $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) 47 47 48 48 %: %.c 49 49 $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^
+2 -3
tools/testing/selftests/powerpc/switch_endian/Makefile
··· 2 2 3 3 ASFLAGS += -O2 -Wall -g -nostdlib -m64 4 4 5 + EXTRA_CLEAN = *.o check-reversed.S 6 + 5 7 include ../../lib.mk 6 8 7 9 switch_endian_test: check-reversed.S ··· 13 11 14 12 check-reversed.S: check-reversed.o 15 13 hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ 16 - 17 - clean: 18 - $(RM) $(TEST_GEN_PROGS) *.o check-reversed.S
+1 -3
tools/testing/selftests/pstore/Makefile
··· 5 5 6 6 TEST_PROGS := pstore_tests pstore_post_reboot_tests 7 7 TEST_FILES := common_tests pstore_crash_test 8 + EXTRA_CLEAN := logs/* *uuid 8 9 9 10 include ../lib.mk 10 11 11 12 run_crash: 12 13 @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; } 13 - 14 - clean: 15 - rm -rf logs/* *uuid
+1 -2
tools/testing/selftests/zram/Makefile
··· 2 2 3 3 TEST_PROGS := zram.sh 4 4 TEST_FILES := zram01.sh zram02.sh zram_lib.sh 5 + EXTRA_CLEAN := err.log 5 6 6 7 include ../lib.mk 7 8 8 - clean: 9 - $(RM) err.log