-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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] https://github.com/Linaro/test-definitions/pull/208/commits/2e7b62155e4998e54ac0587704932484d4ff84c8 Signed-off-by: Kees Cook <keescook@chromium.org> Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
- Loading branch information
Kees Cook
authored and
Shuah Khan
committed
Oct 7, 2020
1 parent
997a91f
commit f0f0a5d
Showing
3 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# Run installed kselftest tests. | ||
# | ||
BASE_DIR=$(realpath $(dirname $0)) | ||
cd $BASE_DIR | ||
TESTS="$BASE_DIR"/kselftest-list.txt | ||
if [ ! -r "$TESTS" ] ; then | ||
echo "$0: Could not find list of tests to run ($TESTS)" >&2 | ||
exit 1 | ||
fi | ||
available="$(cat "$TESTS")" | ||
|
||
. ./kselftest/runner.sh | ||
ROOT=$PWD | ||
|
||
if [ "$1" = "--summary" ] ; then | ||
logfile="$BASE_DIR"/output.log | ||
cat /dev/null > $logfile | ||
fi | ||
|
||
collections=$(echo "$available" | cut -d: -f1 | uniq) | ||
for collection in $collections ; do | ||
[ -w /dev/kmsg ] && echo "kselftest: Running tests in $collection" >> /dev/kmsg | ||
tests=$(echo "$available" | grep "^$collection:" | cut -d: -f2) | ||
(cd "$collection" && run_many $tests) | ||
done |