Skip to content

Commit

Permalink
feat(tests): Add ability to auto-accept test diff.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Dec 2, 2023
1 parent d7a6122 commit ed295be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions app/run-ble-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,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
Expand Down
11 changes: 9 additions & 2 deletions app/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed295be

Please sign in to comment.