add test script
This commit is contained in:
parent
2cd6dc2c1d
commit
d8f8577fa5
2 changed files with 49 additions and 0 deletions
24
run_tests.sh
Executable file
24
run_tests.sh
Executable file
|
@ -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[@]}"
|
25
tests.txt
Normal file
25
tests.txt
Normal file
|
@ -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
|
Loading…
Reference in a new issue