edmonds-matching-algorithm/run_tests.sh
2023-11-06 22:24:44 +01:00

27 lines
487 B
Bash
Executable File

GRAPHS=graphs/
EXECUTABLE=build/main
SUCC=()
FAILED=()
while read -r instance opt; do
line=($(./cmake-build-release/matching $GRAPHS/$instance | grep edge))
result=${line[3]}
if [ "$result" -eq "$opt" ];
then
SUCC+=("$instance: $opt")
echo "$instance passed"
else
FAILED+=("$instance: $result/$opt")
echo "$instance failed: $result/$opt"
fi
done < tests.txt
echo
echo "Success:"
printf '%s\n' "${SUCC[@]}"
echo
echo "Failed:"
printf '%s\n' "${FAILED[@]}"