From d8f8577fa50f835d275025eb7870c7d58360e25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 5 Nov 2023 12:50:19 +0100 Subject: [PATCH] add test script --- run_tests.sh | 24 ++++++++++++++++++++++++ tests.txt | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 run_tests.sh create mode 100644 tests.txt diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..e1bcece --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,24 @@ +GRAPHS=../graphs/ + +SUCC=() +FAILED=() + +while read -r instance opt; do + linecount=$(./build/main $GRAPHS/$instance | wc -l) + result=$(($linecount - 1)) + if [ "$result" -eq "$opt" ]; + then + SUCC+=("$instance: $opt") + else + FAILED+=("$instance: $result/$opt") + fi + echo "$instance $result/$opt" +done < tests.txt + +echo +echo "Success:" +printf '%s\n' "${SUCC[@]}" + +echo +echo "Failed:" +printf '%s\n' "${FAILED[@]}" diff --git a/tests.txt b/tests.txt new file mode 100644 index 0000000..02198ca --- /dev/null +++ b/tests.txt @@ -0,0 +1,25 @@ +ar9152.dmx 4349 +ch71009.dmx 35025 +ei8246.dmx 4123 +fixed.dmx 500 +gr9882.dmx 4931 +K2.dmx 1 +K3.dmx 1 +K4.dmx 2 +lu980.dmx 490 +P3.dmx 2 +pbd984.dmx 492 +peterson.dmx 5 +pma343.dmx 171 +queen10_10.dmx 50 +queen11_11.dmx 60 +queen16_16.dmx 128 +queen27_27.dmx 364 +queen4_4.dmx 8 +queen5_5.dmx 12 +queen6_6.dmx 18 +queen7_7.dmx 24 +queen8_8.dmx 32 +queen9_9.dmx 40 +simple.dmx 2 +xqf131.dmx 64