-
Notifications
You must be signed in to change notification settings - Fork 2
/
benchmark.sh
executable file
·48 lines (42 loc) · 1.02 KB
/
benchmark.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
#!/bin/sh
# Syntax: "./benchmark.sh {language}
#
LANGUAGE="$1";
if [ "$LANGUAGE" == '' ];
then
echo 'Bad syntax: "./benchmark.sh {language}"'
echo '(language = "html" | "xml" | "javascript" | "json" | "csv" | "java")'
exit 1;
fi
BENCHMARK_CLASS=""
if [ "$LANGUAGE" == 'html' ];
then
BENCHMARK_CLASS="org.unbescape.html.HtmlBenchmark";
fi
if [ "$LANGUAGE" == 'xml' ];
then
BENCHMARK_CLASS="org.unbescape.xml.XmlBenchmark";
fi
if [ "$LANGUAGE" == 'javascript' ];
then
BENCHMARK_CLASS="org.unbescape.javascript.JavaScriptBenchmark";
fi
if [ "$LANGUAGE" == 'json' ];
then
BENCHMARK_CLASS="org.unbescape.json.JsonBenchmark";
fi
if [ "$LANGUAGE" == 'csv' ];
then
BENCHMARK_CLASS="org.unbescape.csv.CsvBenchmark";
fi
if [ "$LANGUAGE" == 'java' ];
then
BENCHMARK_CLASS="org.unbescape.java.JavaBenchmark";
fi
if [ "$BENCHMARK_CLASS" == '' ];
then
echo 'Bad syntax: "./benchmark.sh {language}"'
echo '(language = "html" | "xml" | "javascript" | "json")'
exit 1;
fi
mvn clean compile exec:java -Dexec.mainClass=$BENCHMARK_CLASS