-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestDijkstra.sh
More file actions
29 lines (29 loc) · 958 Bytes
/
testDijkstra.sh
File metadata and controls
29 lines (29 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
n=`ls graphs/*in | grep -o '[0-9][0-9]*' | sort | tail -n1`
make || exit
if [ $# -eq 1 ]; then
i=$1
./testDijkstra graphs/$i.in > output/Dijkstra$i.out
r=`diff dijkstraPaths/Dijkstra$i.out output/Dijkstra$i.out`
if [[ "$r" == "" ]]; then
echo -e "====== ${GREEN}[$i] Output Matches${NC} ======"
else
echo -e "=========== ${RED}[$i] Output Mismatch${NC} ============"
diff dijkstraPaths/Dijkstra$i.out output/Dijkstra$i.out
fi
rm output/Dijkstra$i.out
exit
fi
for i in `seq 1 $n`; do
./testDijkstra graphs/$i.in > output/Dijkstra$i.out
r=`diff dijkstraPaths/Dijkstra$i.out output/Dijkstra$i.out`
if [[ "$r" == "" ]]; then
echo -e "====== ${GREEN}[$i] Output Matches${NC} ======"
else
echo -e "=========== ${RED}[$i] Output Mismatch${NC} ============"
diff dijkstraPaths/Dijkstra$i.out output/Dijkstra$i.out
fi
rm output/Dijkstra$i.out
done