;dev: cli: ledger tests: summary, failures

This commit is contained in:
Simon Michael 2022-12-18 00:16:44 -10:00
parent 1b56687708
commit 470e906e97
3 changed files with 10 additions and 4 deletions

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
grep -v ': ok$' log

View File

@ -12,8 +12,6 @@ for f in $FILES ; do
# printf "." 1>&2
done 2>&1 | tee log
echo
cp log log."$(date +%Y%m%d)"
printf "test files: %4d\n" "$(rg -c '^:' log || echo 0)"
printf "success: %4d\n" "$(rg -c ': ok$' log || echo 0)"
printf "failure: %4d\n" "$(rg -c '(^|: )fail$' log || echo 0)"
echo "tested on $(date +%Y-%m-%d) with $(hledger --version)"
cp log log."$(date +%Y%m%d)"
./summary

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Summarise the results of the last test run
set -e
printf "test files: %4d\n" "$(rg -c '^:' log || echo 0)"
printf "success: %4d\n" "$(rg -c ': ok$' log || echo 0)"
printf "failure: %4d\n" "$(rg -c '(^|: )fail$' log || echo 0)"