From 79bff11ddd55204cf0ed4f43985e096a30cbf137 Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Fri, 28 Aug 2020 16:21:31 -0400 Subject: [PATCH] fancier run test stuff --- app/run-test.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/run-test.sh b/app/run-test.sh index 722cb939..d923e855 100755 --- a/app/run-test.sh +++ b/app/run-test.sh @@ -4,14 +4,25 @@ if [ -z "$1" ]; then echo "Usage: ./run-test.sh " exit 1 elif [ "$1" = "all" ]; then + echo "" > ./build/tests/pass-fail.log find tests -name native_posix.keymap -exec dirname \{\} \; | xargs -l -P 4 ./run-test.sh - exit $? + err=$? + sort -k2 ./build/tests/pass-fail.log + exit $err fi testcase="$1" echo "Running $testcase:" -west build -d build/$testcase -b native_posix -- -DZMK_CONFIG=$testcase > /dev/null -./build/$testcase/zephyr/zmk.exe | sed -e "s/.*> //" | sed -n -f $testcase/events.patterns > build/$testcase/keycode_events.log - -diff -au $testcase/keycode_events.snapshot build/$testcase/keycode_events.log +west build -d build/$testcase -b native_posix -- -DZMK_CONFIG=$testcase > /dev/null 2>&1 +if [ $? -gt 0 ]; then + echo "FAIL: $testcase did not build" >> ./build/tests/pass-fail.log +else + ./build/$testcase/zephyr/zmk.exe | sed -e "s/.*> //" | sed -n -f $testcase/events.patterns > build/$testcase/keycode_events.log + diff -au $testcase/keycode_events.snapshot build/$testcase/keycode_events.log + if [ $? -gt 0 ]; then + echo "FAIL: $testcase" >> ./build/tests/pass-fail.log + else + echo "PASS: $testcase" >> ./build/tests/pass-fail.log + fi +fi \ No newline at end of file