@@ -1,4 +1,4 @@
-CFLAGS = -Wall
+CFLAGS = -Wall -g
BINARIES = execveat
DEPS = execveat.symlink execveat.denatured script
all: $(BINARIES) $(DEPS)
@@ -18,11 +18,19 @@ execveat.denatured: execveat
$(CC) $(CFLAGS) -o $@ $^
TEST_PROGS := execveat
-TEST_FILES := $(DEPS)
+TEST_FILES := script
include ../lib.mk
-override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
+override RUN_TESTS := mkdir -p subdir; (./execveat && echo "selftests: execveat [PASS]") || echo "selftests: execveat [FAIL]"
+
+override EMIT_TESTS := echo "mkdir -p subdir; touch Makefile; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
+
+override define INSTALL_RULE
+ mkdir -p $(INSTALL_PATH)
+ install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+ cp -a execveat.symlink execveat.denatured $(INSTALL_PATH)
+endef
clean:
rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
Fix three issues in exec testcase: Add RUN_TESTS rules in order to running the testcases in the build directory through "make TARGETS=exec kselftest" Copy symbol link and non-executable file instead of install it, otherwise this test will fail after installation. Exec testcases need a "Makefile" in line 346, otherwise it will be ENOENT instead of EACCES. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> --- tools/testing/selftests/exec/Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)