diff options
| author | bamvor.zhangjian@huawei.com <bamvor.zhangjian@huawei.com> | 2016-11-29 06:55:51 -0500 |
|---|---|---|
| committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-01-05 15:42:17 -0500 |
| commit | 80d443e8876602be2c130f79c4de81e12e2a700d (patch) | |
| tree | dbe443dd36f2b043654ccff605dca385f4b8e70a /tools | |
| parent | 5a2d4a5763c96a19170f81f2c4bb3cc9515f854a (diff) | |
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>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/selftests/exec/Makefile | 19 | ||||
| -rw-r--r-- | tools/testing/selftests/ftrace/Makefile | 4 | ||||
| -rw-r--r-- | tools/testing/selftests/kcmp/Makefile | 4 | ||||
| -rw-r--r-- | tools/testing/selftests/lib.mk | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/powerpc/switch_endian/Makefile | 5 | ||||
| -rw-r--r-- | tools/testing/selftests/pstore/Makefile | 4 | ||||
| -rw-r--r-- | tools/testing/selftests/zram/Makefile | 3 |
7 files changed, 17 insertions, 24 deletions
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 9eb1c3e4d339..48d1f863d584 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | CFLAGS = -Wall | 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 | subdir: | 12 | subdir: |
| 4 | mkdir -p $@ | 13 | mkdir -p $@ |
| 5 | script: | 14 | script: |
| @@ -11,13 +20,3 @@ execveat.symlink: execveat | |||
| 11 | execveat.denatured: execveat | 20 | execveat.denatured: execveat |
| 12 | cp $< $@ | 21 | cp $< $@ |
| 13 | chmod -x $@ | 22 | chmod -x $@ |
| 14 | |||
| 15 | TEST_GEN_PROGS := execveat | ||
| 16 | TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir | ||
| 17 | # Makefile is a run-time dependency, since it's accessed by the execveat test | ||
| 18 | TEST_FILES := Makefile | ||
| 19 | |||
| 20 | include ../lib.mk | ||
| 21 | |||
| 22 | clean: | ||
| 23 | rm -rf $(TEST_GEN_PROGS) $(TEST_GEN_FILES) subdir.moved execveat.moved xxxxx* | ||
diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index a71530097352..6c64b421a4fd 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile | |||
| @@ -2,8 +2,6 @@ all: | |||
| 2 | 2 | ||
| 3 | TEST_PROGS := ftracetest | 3 | TEST_PROGS := ftracetest |
| 4 | TEST_FILES := test.d | 4 | TEST_FILES := test.d |
| 5 | EXTRA_CLEAN := logs/* | ||
| 5 | 6 | ||
| 6 | include ../lib.mk | 7 | include ../lib.mk |
| 7 | |||
| 8 | clean: | ||
| 9 | rm -rf logs/* | ||
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 9e8b673d41b1..74a8adda58fb 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile | |||
| @@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ | |||
| 2 | 2 | ||
| 3 | TEST_GEN_PROGS := kcmp_test | 3 | TEST_GEN_PROGS := kcmp_test |
| 4 | 4 | ||
| 5 | EXTRA_CLEAN := kcmp-test-file | ||
| 6 | |||
| 5 | include ../lib.mk | 7 | include ../lib.mk |
| 6 | 8 | ||
| 7 | clean: | ||
| 8 | $(RM) $(TEST_GEN_PROGS) kcmp-test-file | ||
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 68d7c01b9f06..0f7a371beff7 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk | |||
| @@ -43,7 +43,7 @@ emit_tests: | |||
| 43 | all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) | 43 | all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) |
| 44 | 44 | ||
| 45 | clean: | 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 | %: %.c | 48 | %: %.c |
| 49 | $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^ | 49 | $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^ |
diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile index bd0122306da6..dbd05ac8dbf7 100644 --- a/tools/testing/selftests/powerpc/switch_endian/Makefile +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile | |||
| @@ -2,6 +2,8 @@ TEST_GEN_PROGS := switch_endian_test | |||
| 2 | 2 | ||
| 3 | ASFLAGS += -O2 -Wall -g -nostdlib -m64 | 3 | ASFLAGS += -O2 -Wall -g -nostdlib -m64 |
| 4 | 4 | ||
| 5 | EXTRA_CLEAN = *.o check-reversed.S | ||
| 6 | |||
| 5 | include ../../lib.mk | 7 | include ../../lib.mk |
| 6 | 8 | ||
| 7 | switch_endian_test: check-reversed.S | 9 | switch_endian_test: check-reversed.S |
| @@ -11,6 +13,3 @@ check-reversed.o: check.o | |||
| 11 | 13 | ||
| 12 | check-reversed.S: check-reversed.o | 14 | check-reversed.S: check-reversed.o |
| 13 | hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ | 15 | hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ |
| 14 | |||
| 15 | clean: | ||
| 16 | $(RM) $(TEST_GEN_PROGS) *.o check-reversed.S | ||
diff --git a/tools/testing/selftests/pstore/Makefile b/tools/testing/selftests/pstore/Makefile index bd7abe24ea08..c5f2440ba1f7 100644 --- a/tools/testing/selftests/pstore/Makefile +++ b/tools/testing/selftests/pstore/Makefile | |||
| @@ -5,11 +5,9 @@ all: | |||
| 5 | 5 | ||
| 6 | TEST_PROGS := pstore_tests pstore_post_reboot_tests | 6 | TEST_PROGS := pstore_tests pstore_post_reboot_tests |
| 7 | TEST_FILES := common_tests pstore_crash_test | 7 | TEST_FILES := common_tests pstore_crash_test |
| 8 | EXTRA_CLEAN := logs/* *uuid | ||
| 8 | 9 | ||
| 9 | include ../lib.mk | 10 | include ../lib.mk |
| 10 | 11 | ||
| 11 | run_crash: | 12 | run_crash: |
| 12 | @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; } | 13 | @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; } |
| 13 | |||
| 14 | clean: | ||
| 15 | rm -rf logs/* *uuid | ||
diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile index 29d80346e3eb..c3a87e5f9d36 100644 --- a/tools/testing/selftests/zram/Makefile +++ b/tools/testing/selftests/zram/Makefile | |||
| @@ -2,8 +2,7 @@ all: | |||
| 2 | 2 | ||
| 3 | TEST_PROGS := zram.sh | 3 | TEST_PROGS := zram.sh |
| 4 | TEST_FILES := zram01.sh zram02.sh zram_lib.sh | 4 | TEST_FILES := zram01.sh zram02.sh zram_lib.sh |
| 5 | EXTRA_CLEAN := err.log | ||
| 5 | 6 | ||
| 6 | include ../lib.mk | 7 | include ../lib.mk |
| 7 | 8 | ||
| 8 | clean: | ||
| 9 | $(RM) err.log | ||
