-
Notifications
You must be signed in to change notification settings - Fork 0
/
script
45 lines (41 loc) · 912 Bytes
/
script
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
GREEN='\033[0;32m'
RED='\033[0;31m'
PURPLE='\033[0;35m'
NC='\033[0m'
echo 'Do you want to test valid or invalid maps?'
read map
if [ $map = 'invalid' ]
then
echo -e "${GREEN}testing $map maps${NC}"
files=./invalid_maps/*
touch ./error
for file in $files
do
./lem-in < "$file" > ./error 2>&1
output=$(< ./error wc -l)
if [ $output -le 1 ]
then
printf "${PURPLE}%-30s${NC} ${GREEN}[passed]${NC}\n" $(basename $file)
else
printf "${PURPLE}%-30s${NC} ${RED}[failed]${NC}\n" $(basename $file)
fi
done
rm ./error
elif [ $map = 'valid' ]
then
echo "do you want to test lem-in with: flow-one, flow-ten, flow-thousand, big, big-super or all?"
read answer
if [ $answer = 'all' ]
then
sh ./make_maps 'flow-one'
sh ./make_maps 'flow-ten'
sh ./make_maps 'flow-thousand'
sh ./make_maps 'big'
sh ./make_maps 'big-super'
else
sh ./make_maps $answer
fi
else
kill %%
fi