test: print test output immediately and decrease indenting

This commit is contained in:
okke 2021-12-11 20:55:56 +01:00 committed by Pete Johanson
parent d59797ba13
commit f692d64d05

View file

@ -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