-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun-all.sh
executable file
·118 lines (96 loc) · 2.29 KB
/
run-all.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
#!/bin/sh
PASS=1
REPEAT=100
usage() {
echo "Usage: run-all.sh [-repeat N] [-pass num]"
exit 2
}
while test $# -ne 0; do
case $1 in
-repeat)
shift
test $# -eq 0 && usage
REPEAT=$1
;;
-pass)
shift
test $# -eq 0 && usage
PASS=$1
;;
*)
usage
;;
esac
shift
done
LANGUAGES="ado java python"
DATABASES="sqlite mysql postgresql"
# Check SQL benchmark programs are built.
for L in $LANGUAGES; do
case $L in
ado)
if test ! -f ado/bin/sqlbench; then
echo "Please, build Ada SQL benchmark by running:"
echo "cd ado && ./configure && make"
exit 2
fi
;;
java)
if test ! -f java/target/sql-benchmark-1.0.jar; then
echo "Please, build Java SQL benchmark by running:"
echo "cd java && mvn compile assembly:single"
exit 2
fi
;;
python)
;;
*)
echo "Invalid language $L"
exit 2;
;;
esac
done
if test ! -f tools/bin/tool-main; then
echo "Please, build the SQL benchmark aggrgation tool:"
echo "cd tools && ./configure && make"
exit 2
fi
mkdir -p results
DIR=`pwd`
FAIL=0
FILES=""
for D in $DATABASES; do
for L in $LANGUAGES; do
echo "Running SQL benchmark on $D for $L"
case $L in
ado)
cd $DIR/ado && bin/sqlbench -$D -repeat $REPEAT -o ../results/$L-$D-$PASS.xml
if test $? -ne 0; then
echo "Execution of SQL benchmark on $D for $L failed"
FAIL=1
fi
FILES="$FILES results/$L-$D-$PASS.xml"
;;
java)
cd $DIR/java && java -jar target/sql-benchmark-1.0.jar -$D -repeat $REPEAT -o ../results/$L-$D-$PASS.xml
if test $? -ne 0; then
echo "Execution of SQL benchmark on $D for $L failed"
FAIL=1
fi
FILES="$FILES results/$L-$D-$PASS.xml"
;;
python)
cd $DIR/python && python3 src -$D -repeat $REPEAT -o ../results/$L-$D-$PASS.xml
if test $? -ne 0; then
echo "Execution of SQL benchmark on $D for $L failed"
FAIL=1
fi
FILES="$FILES results/$L-$D-$PASS.xml"
;;
*)
;;
esac
done
done
echo "Building the results"
cd $DIR && tools/bin/tool-main $FILES