From 8b811bec95e77080dc80b79fc5e7c677f595d570 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 17 Apr 2023 19:54:33 -0400 Subject: [PATCH] Count pass/fail stats for compare parse script. --- scripts/compare_parse_all.bash | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/compare_parse_all.bash b/scripts/compare_parse_all.bash index 2970b3e..fc8a841 100755 --- a/scripts/compare_parse_all.bash +++ b/scripts/compare_parse_all.bash @@ -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")