Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88baa78d authored by bamvor.zhangjian@huawei.com's avatar bamvor.zhangjian@huawei.com Committed by Shuah Khan
Browse files

selftests: remove duplicated all and clean target



Currently, kselftest use TEST_PROGS, TEST_PROGS_EXTENDED, TEST_FILES to
indicate the test program, extended test program and test files. It is
easy to understand the purpose of these files. But mix of compiled and
uncompiled files lead to duplicated "all" and "clean" targets.

In order to remove the duplicated targets, introduce TEST_GEN_PROGS,
TEST_GEN_PROGS_EXTENDED, TEST_GEN_FILES to indicate the compiled
objects.

Also, the later patch will make use of TEST_GEN_XXX to redirect these
files to output directory indicated by KBUILD_OUTPUT or O.

And add this changes to "Contributing new tests(details)" of
Documentation/kselftest.txt.

Signed-off-by: default avatarBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent 7ce7d89f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -95,3 +95,15 @@ In general, the rules for selftests are

 * Don't cause the top-level "make run_tests" to fail if your feature is
   unconfigured.

Contributing new tests(details)
===============================

 * Use TEST_GEN_XXX if such binaries or files are generated during
   compiling.
   TEST_PROGS, TEST_GEN_PROGS mean it is the excutable tested by
   default.
   TEST_PROGS_EXTENDED, TEST_GEN_PROGS_EXTENDED mean it is the
   executable which is not tested by default.
   TEST_FILES, TEST_GEN_FILES mean it is the file which is used by
   test.
+2 −8
Original line number Diff line number Diff line
CFLAGS += -Wall -O2 -I../../../../usr/include

test_objs = test_verifier test_maps test_lru_map
TEST_GEN_PROGS = test_verifier test_maps test_lru_map

TEST_PROGS := test_verifier test_maps test_lru_map test_kmod.sh
TEST_FILES := $(test_objs)

all: $(test_objs)
TEST_PROGS := test_kmod.sh

include ../lib.mk

clean:
	$(RM) $(test_objs)
+3 −7
Original line number Diff line number Diff line
@@ -3,17 +3,13 @@ uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)

ifeq ($(ARCH),x86)
TEST_PROGS := breakpoint_test
TEST_GEN_PROGS := breakpoint_test
endif
ifeq ($(ARCH),aarch64)
TEST_PROGS := breakpoint_test_arm64
TEST_GEN_PROGS := breakpoint_test_arm64
endif

TEST_PROGS += step_after_suspend_test

all: $(TEST_PROGS)
TEST_GEN_PROGS += step_after_suspend_test

include ../lib.mk
clean:
	rm -fr breakpoint_test breakpoint_test_arm64 step_after_suspend_test
+2 −9
Original line number Diff line number Diff line
TEST_FILES := validate_cap
TEST_PROGS := test_execve

BINARIES := $(TEST_FILES) $(TEST_PROGS)
TEST_GEN_FILES := validate_cap
TEST_GEN_PROGS := test_execve

CFLAGS += -O2 -g -std=gnu99 -Wall
LDLIBS += -lcap-ng -lrt -ldl

all: $(BINARIES)

clean:
	$(RM) $(BINARIES)

include ../lib.mk
+1 −7
Original line number Diff line number Diff line
CFLAGS = -Wall

test_objs = open-unlink create-read

all: $(test_objs)

TEST_GEN_FILES := open-unlink create-read
TEST_PROGS := efivarfs.sh
TEST_FILES := $(test_objs)

include ../lib.mk
clean:
	rm -f $(test_objs)
Loading