edmonds-matching-algorithm/run_tests.sh

27 lines
471 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:10 +01:00
line=($(./build/main-g $GRAPHS/$instance | grep edge))
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[@]}"