selftests: Extract run_kselftest.sh and generate stand-alone test list

Instead of building a script on the fly (which just repeats the same
thing for each test collection), move the script out of the Makefile and
into run_kselftest.sh, which reads kselftest-list.txt.

Adjust the emit_tests target to report each test on a separate line so
that test running tools (e.g. LAVA) can easily remove individual
tests (for example, as seen in [1]).

[1] 2e7b62155e

Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Kees Cook
2020-09-28 13:26:48 -07:00
committed by Shuah Khan
parent 997a91fd44
commit f0f0a5df4e
3 changed files with 37 additions and 22 deletions

View File

@@ -107,9 +107,8 @@ endif
emit_tests:
for TEST in $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS); do \
BASENAME_TEST=`basename $$TEST`; \
echo " \\"; \
echo -n " \"$$BASENAME_TEST\""; \
done; \
echo "$(COLLECTION):$$BASENAME_TEST"; \
done
# define if isn't already. It is undefined in make O= case.
ifeq ($(RM),)