-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_runner.sh
151 lines (132 loc) · 3.36 KB
/
test_runner.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/bash
#set -x
generate_strings=$1
bottom_up=$2
top_down=$3
naive=$4
error_correction=$5
linear=$6
nr_runs=$6
if [ $generate_strings = "t" ]
then
generate_strings.sh
else
echo "Skipping generating strings"
fi
WBP_names=(
"RLR"
"LR"
"LL"
"LRL");
SG_names=(
"SG");
EC_names=(
"RL"
"LR"
)
linear_names=(
"AA_B_CC"
"ABAB_B_CC"
"ABAB_CC"
)
#########################
## Bottom up
#########################
if [ $bottom_up = "t" ]
then
# Run BU tests on WBP
echo "Running bottom up tests on WBP grammar"
for file in ${WBP_names[@]}
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing.jar well_balanced_parenthesis.txt "strings/${file}" BU $nr_runs > "BU_$file.csv"
done
# Run BU tests on SG
echo "Running bottom up tests on stupid grammar"
for file in $SG_names
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing.jar stupid.txt "strings/${file}" BU $nr_runs > "BU_$file.csv"
done
else
echo "Skipping bottom up"
fi
#########################
## Top down
#########################
if [ $top_down = "t" ]
then
# Run top down tests on WBP
echo "Running top down tests on WBPgrammar"
for file in ${WBP_names[@]}
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing.jar well_balanced_parenthesis.txt "strings/${file}" TD $nr_runs > "TD_$file.csv"
done
# Run top down tests on SG
echo "Running top down tests on stupid grammar"
for file in $SG_names
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing.jar stupid.txt "strings/${file}" TD $nr_runs > "TD_$file.csv"
done
else
echo "Skipping bottom up"
fi
#########################
## Naive
#########################
if [ $naive = "t" ]
then
# Run naive tests on WBP
echo "Running naive tests on WBP grammar"
for file in ${WBP_names[@]}
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing.jar well_balanced_parenthesis.txt "strings/${file}"_N N $nr_runs > "N_$file.csv"
done
# Run naive tests on SG
echo "Running naive tests on stupid grammar"
for file in $SG_names
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing.jar stupid.txt "strings/${file}"_N N $nr_runs > "N_$file.csv"
done
else
echo "Skipping naive"
fi
##########################
## Error Correction
##########################
if [$error_correction = "t"]
then
# Run BU_EC tests on WBP grammar
echo "Running BU_EC tests on WBP grammar"
for file in ${EC_names[@]}
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing.jar well_balanced_parenthesis.txt "strings/${file}" BU_EC_S $nr_runs > "BU_EC_S$file.csv"
done
else
echo "skipping error correction"
fi
#########################
## Linear
#########################
if [ $linear = "t" ]
then
# Run naive tests on WBP
echo "Running linear tests on linear grammar"
for file in ${linear_names[@]}
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing_l.jar linear_grammar.txt "strings/${file}" TD_L $nr_runs > "TD_L_$file.csv"
done
for file in ${linear_names[@]}
do
echo $file
java -jar -XX:CompileThreshold=1 cykparsing_l.jar linear_grammar.txt "strings/${file}" TD_C $nr_runs > "TD_C_$file.csv"
done
else
echo "Skipping naive"
fi