edmonds-matching-algorithm/run_tests.sh

27 lines
487 B
Bash
Raw Normal View History

2023-11-05 12:52:59 +01:00
GRAPHS=graphs/
2023-11-06 22:22:10 +01:00
EXECUTABLE=build/main
2023-11-05 12:50:19 +01:00
SUCC=()
FAILED=()
while read -r instance opt; do
2023-11-06 22:22:28 +01:00
line=($(./cmake-build-release/matching $GRAPHS/$instance | grep edge))
2023-11-06 22:22:10 +01:00
result=${line[3]}
2023-11-05 12:50:19 +01:00
if [ "$result" -eq "$opt" ];
then
SUCC+=("$instance: $opt")
2023-11-05 12:58:45 +01:00
echo "$instance passed"
2023-11-05 12:50:19 +01:00
else
FAILED+=("$instance: $result/$opt")
2023-11-05 12:58:45 +01:00
echo "$instance failed: $result/$opt"
2023-11-05 12:50:19 +01:00
fi
done < tests.txt
echo
echo "Success:"
printf '%s\n' "${SUCC[@]}"
echo
echo "Failed:"
printf '%s\n' "${FAILED[@]}"