feat(tests): run subdirectory of tests
example: `west test tests/hold-tap` will run all hold-tap tests.
This commit is contained in:
parent
3ac1a11a37
commit
2f1170c01a
1 changed files with 12 additions and 3 deletions
|
@ -8,15 +8,24 @@
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Usage: ./run-test.sh <path to testcase>"
|
echo "Usage: ./run-test.sh <path to testcase>"
|
||||||
exit 1
|
exit 1
|
||||||
elif [ "$1" = "all" ]; then
|
fi
|
||||||
|
|
||||||
|
path="$1"
|
||||||
|
if [ path = "all" ]; then
|
||||||
|
path = "tests"
|
||||||
|
fi
|
||||||
|
|
||||||
|
testcases=$(find $path -name native_posix.keymap -exec dirname \{\} \;)
|
||||||
|
num_cases=$(echo "$testcases" | wc -l)
|
||||||
|
if [ $num_cases -gt 1 ]; then
|
||||||
echo "" > ./build/tests/pass-fail.log
|
echo "" > ./build/tests/pass-fail.log
|
||||||
find tests -name native_posix.keymap -exec dirname \{\} \; | xargs -l -P 4 ./run-test.sh
|
echo "$testcases" | xargs -l -P 4 ./run-test.sh
|
||||||
err=$?
|
err=$?
|
||||||
sort -k2 ./build/tests/pass-fail.log
|
sort -k2 ./build/tests/pass-fail.log
|
||||||
exit $err
|
exit $err
|
||||||
fi
|
fi
|
||||||
|
|
||||||
testcase="$1"
|
testcase="$path"
|
||||||
echo "Running $testcase:"
|
echo "Running $testcase:"
|
||||||
|
|
||||||
west build -d build/$testcase -b native_posix -- -DZMK_CONFIG=$testcase > /dev/null 2>&1
|
west build -d build/$testcase -b native_posix -- -DZMK_CONFIG=$testcase > /dev/null 2>&1
|
||||||
|
|
Loading…
Reference in a new issue