From 55aed8e89d3d256b3e758be5bc5dfbb23ea04ece Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Sat, 2 Dec 2023 16:16:49 +0000 Subject: [PATCH] feat(tests): Add ability to auto-accept test diff. --- app/run-ble-test.sh | 10 ++++++++-- app/run-test.sh | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/run-ble-test.sh b/app/run-ble-test.sh index f6e4f0cc048..9984caa14e2 100755 --- a/app/run-ble-test.sh +++ b/app/run-ble-test.sh @@ -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 diff --git a/app/run-test.sh b/app/run-test.sh index 6935f2c8b36..cfd376686c8 100755 --- a/app/run-test.sh +++ b/app/run-test.sh @@ -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