diff --git a/app/run-test.sh b/app/run-test.sh index cbc6fbbf..da4803d6 100755 --- a/app/run-test.sh +++ b/app/run-test.sh @@ -28,21 +28,20 @@ echo "Running $testcase:" west build -d build/$testcase -b native_posix -- -DZMK_CONFIG="$(pwd)/$testcase" > /dev/null 2>&1 if [ $? -gt 0 ]; then - echo "FAILED: $testcase did not build" >> ./build/tests/pass-fail.log + echo "FAILED: $testcase did not build" | tee -a ./build/tests/pass-fail.log exit 1 -else - ./build/$testcase/zephyr/zmk.exe | sed -e "s/.*> //" | tee build/$testcase/keycode_events_full.log | 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 - if [ -f $testcase/pending ]; then - echo "PENDING: $testcase" >> ./build/tests/pass-fail.log - exit 0 - else - echo "FAILED: $testcase" >> ./build/tests/pass-fail.log - exit 1 - fi - else - echo "PASS: $testcase" >> ./build/tests/pass-fail.log +fi + +./build/$testcase/zephyr/zmk.exe | sed -e "s/.*> //" | tee build/$testcase/keycode_events_full.log | 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 + if [ -f $testcase/pending ]; then + echo "PENDING: $testcase" | tee -a ./build/tests/pass-fail.log exit 0 fi + echo "FAILED: $testcase" | tee -a ./build/tests/pass-fail.log + exit 1 fi + +echo "PASS: $testcase" | tee -a ./build/tests/pass-fail.log +exit 0