Count pass/fail stats for compare parse script.

This commit is contained in:
Tom Alexander 2023-04-17 19:54:33 -04:00
parent 89040c51a6
commit 8b811bec95
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -13,15 +13,24 @@ test_files=$(find $org_dir -type f -name '*.org' | sort)
cargo build --bin org_compare
pass=0
fail=0
while read test_file; do
print_path=$(realpath --relative-to="$org_dir" "$test_file")
set +e
diff_results=$("$compare_bin" "$test_file")
diff_status=$?
set -e
if [ $diff_status -eq 0 ]; then
echo "GOOD $test_file"
echo "GOOD $print_path"
pass=$((pass + 1))
else
echo "BAD $test_file"
echo "BAD $print_path"
fail=$((fail + 1))
fi
done<<<"$test_files"
total=$((pass + fail))
(>&2 echo "Tests passed: $pass/$total")