feat(tests): Add ability to auto-accept test diff.

This commit is contained in:
Peter Johanson 2023-12-02 16:16:49 +00:00 committed by Pete Johanson
parent c63d0791d5
commit 55aed8e89d
2 changed files with 17 additions and 4 deletions

View file

@ -93,8 +93,14 @@ if [ $? -gt 0 ]; 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
if [ -n "${ZMK_TESTS_AUTO_ACCEPT}" ]; then
echo "Auto-accepting failure for $testcase"
cp build/$testcase/filtered_output.log $testcase/snapshot.log
else
echo "FAILED: $testcase" | tee -a ./build/tests/pass-fail.log
exit 1
fi
fi
echo "PASS: $testcase" | tee -a ./build/tests/pass-fail.log

View file

@ -39,8 +39,15 @@ if [ $? -gt 0 ]; 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
if [ -n "${ZMK_TESTS_AUTO_ACCEPT}" ]; then
echo "Auto-accepting failure for $testcase"
cp build/$testcase/keycode_events.log $testcase/keycode_events.snapshot
else
echo "FAILED: $testcase" | tee -a ./build/tests/pass-fail.log
exit 1
fi
fi
echo "PASS: $testcase" | tee -a ./build/tests/pass-fail.log