OSDN Git Service

selftests: add EXTRA_CLEAN for clean target
authorbamvor.zhangjian@huawei.com <bamvor.zhangjian@huawei.com>
Tue, 29 Nov 2016 11:55:51 +0000 (19:55 +0800)
committerShuah Khan <shuahkh@osg.samsung.com>
Thu, 5 Jan 2017 20:42:17 +0000 (13:42 -0700)
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>
tools/testing/selftests/exec/Makefile
tools/testing/selftests/ftrace/Makefile
tools/testing/selftests/kcmp/Makefile
tools/testing/selftests/lib.mk
tools/testing/selftests/powerpc/switch_endian/Makefile
tools/testing/selftests/pstore/Makefile
tools/testing/selftests/zram/Makefile

index 9eb1c3e..48d1f86 100644 (file)
@@ -1,5 +1,14 @@
 CFLAGS = -Wall
 
+TEST_GEN_PROGS := execveat
+TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
+# Makefile is a run-time dependency, since it's accessed by the execveat test
+TEST_FILES := Makefile
+
+EXTRA_CLEAN := subdir.moved execveat.moved xxxxx*
+
+include ../lib.mk
+
 subdir:
        mkdir -p $@
 script:
@@ -11,13 +20,3 @@ execveat.symlink: execveat
 execveat.denatured: execveat
        cp $< $@
        chmod -x $@
-
-TEST_GEN_PROGS := execveat
-TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
-# Makefile is a run-time dependency, since it's accessed by the execveat test
-TEST_FILES := Makefile
-
-include ../lib.mk
-
-clean:
-       rm -rf $(TEST_GEN_PROGS) $(TEST_GEN_FILES) subdir.moved execveat.moved xxxxx*
index a715300..6c64b42 100644 (file)
@@ -2,8 +2,6 @@ all:
 
 TEST_PROGS := ftracetest
 TEST_FILES := test.d
+EXTRA_CLEAN := logs/*
 
 include ../lib.mk
-
-clean:
-       rm -rf logs/*
index 9e8b673..74a8add 100644 (file)
@@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/
 
 TEST_GEN_PROGS := kcmp_test
 
+EXTRA_CLEAN := kcmp-test-file
+
 include ../lib.mk
 
-clean:
-       $(RM) $(TEST_GEN_PROGS) kcmp-test-file
index 68d7c01..0f7a371 100644 (file)
@@ -43,7 +43,7 @@ emit_tests:
 all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
 
 clean:
-       $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
+       $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN)
 
 %: %.c
        $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^
index bd01223..dbd05ac 100644 (file)
@@ -2,6 +2,8 @@ TEST_GEN_PROGS := switch_endian_test
 
 ASFLAGS += -O2 -Wall -g -nostdlib -m64
 
+EXTRA_CLEAN = *.o check-reversed.S
+
 include ../../lib.mk
 
 switch_endian_test: check-reversed.S
@@ -11,6 +13,3 @@ check-reversed.o: check.o
 
 check-reversed.S: check-reversed.o
        hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@
-
-clean:
-       $(RM) $(TEST_GEN_PROGS) *.o check-reversed.S
index bd7abe2..c5f2440 100644 (file)
@@ -5,11 +5,9 @@ all:
 
 TEST_PROGS := pstore_tests pstore_post_reboot_tests
 TEST_FILES := common_tests pstore_crash_test
+EXTRA_CLEAN := logs/* *uuid
 
 include ../lib.mk
 
 run_crash:
        @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; }
-
-clean:
-       rm -rf logs/* *uuid
index 29d8034..c3a87e5 100644 (file)
@@ -2,8 +2,7 @@ all:
 
 TEST_PROGS := zram.sh
 TEST_FILES := zram01.sh zram02.sh zram_lib.sh
+EXTRA_CLEAN := err.log
 
 include ../lib.mk
 
-clean:
-       $(RM) err.log