Commit 80d443e8 authored by bamvor.zhangjian@huawei.com's avatar bamvor.zhangjian@huawei.com Committed by Shuah Khan

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: default avatarBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent 5a2d4a57
CFLAGS = -Wall 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: subdir:
mkdir -p $@ mkdir -p $@
script: script:
...@@ -11,13 +20,3 @@ execveat.symlink: execveat ...@@ -11,13 +20,3 @@ execveat.symlink: execveat
execveat.denatured: execveat execveat.denatured: execveat
cp $< $@ cp $< $@
chmod -x $@ 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*
...@@ -2,8 +2,6 @@ all: ...@@ -2,8 +2,6 @@ all:
TEST_PROGS := ftracetest TEST_PROGS := ftracetest
TEST_FILES := test.d TEST_FILES := test.d
EXTRA_CLEAN := logs/*
include ../lib.mk include ../lib.mk
clean:
rm -rf logs/*
...@@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ ...@@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/
TEST_GEN_PROGS := kcmp_test TEST_GEN_PROGS := kcmp_test
EXTRA_CLEAN := kcmp-test-file
include ../lib.mk include ../lib.mk
clean:
$(RM) $(TEST_GEN_PROGS) kcmp-test-file
...@@ -43,7 +43,7 @@ emit_tests: ...@@ -43,7 +43,7 @@ emit_tests:
all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
clean: 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 %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^ $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^
......
...@@ -2,6 +2,8 @@ TEST_GEN_PROGS := switch_endian_test ...@@ -2,6 +2,8 @@ TEST_GEN_PROGS := switch_endian_test
ASFLAGS += -O2 -Wall -g -nostdlib -m64 ASFLAGS += -O2 -Wall -g -nostdlib -m64
EXTRA_CLEAN = *.o check-reversed.S
include ../../lib.mk include ../../lib.mk
switch_endian_test: check-reversed.S switch_endian_test: check-reversed.S
...@@ -11,6 +13,3 @@ check-reversed.o: check.o ...@@ -11,6 +13,3 @@ check-reversed.o: check.o
check-reversed.S: check-reversed.o check-reversed.S: check-reversed.o
hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@
clean:
$(RM) $(TEST_GEN_PROGS) *.o check-reversed.S
...@@ -5,11 +5,9 @@ all: ...@@ -5,11 +5,9 @@ all:
TEST_PROGS := pstore_tests pstore_post_reboot_tests TEST_PROGS := pstore_tests pstore_post_reboot_tests
TEST_FILES := common_tests pstore_crash_test TEST_FILES := common_tests pstore_crash_test
EXTRA_CLEAN := logs/* *uuid
include ../lib.mk include ../lib.mk
run_crash: run_crash:
@sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; } @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; }
clean:
rm -rf logs/* *uuid
...@@ -2,8 +2,7 @@ all: ...@@ -2,8 +2,7 @@ all:
TEST_PROGS := zram.sh TEST_PROGS := zram.sh
TEST_FILES := zram01.sh zram02.sh zram_lib.sh TEST_FILES := zram01.sh zram02.sh zram_lib.sh
EXTRA_CLEAN := err.log
include ../lib.mk include ../lib.mk
clean:
$(RM) err.log
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment