forked from williamkapke/node-compat-table
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrhinoall.sh
executable file
·70 lines (58 loc) · 2.44 KB
/
rhinoall.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
#!/usr/bin/env bash
# This runs the test for many versions. See "rhinotest.sh" to run just one
curl https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-es6.js > data-es6.js
curl https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-es2016plus.js > data-es2016plus.js
curl https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-esnext.js > data-esnext.js
echo
echo 'extracting testers...'
node extract.js ./data-es6.js > ./testers-es6.json
node extract.js ./data-es2016plus.js > ./testers-es2016plus.json
node extract.js ./data-esnext.js > ./testers-esnext.json
node testers.js > testers.json
if [ ! -d ./jars ]
then
mkdir ./jars
fi
runTests() {
version=$1
supportVersion=$2
jar=$3
echo "Testing ${version}"
if [ ${supportVersion} -gt 13 ]
then
echo "supportVersion=${supportVersion}; load('rhinotest.js');" > tmptest.$$
else
echo "supportVersion=${supportVersion}; load('obsoleterhinotest.js');" > tmptest.$$
fi
java -jar ${jar} tmptest.$$ > rhino-results/${version}.json
if [ ${supportVersion} -gt 5 -a ${supportVersion} -lt 20 ]
then
echo "Testing ${version} -version 200"
java -jar ${jar} -version 200 tmptest.$$ > rhino-results/${version}-es6.json
fi
}
fetchAndRunUrl() {
version=$1
rhinoVersion=$2
url=$3
fn=rhino-${version}.jar
if [ ! -f ./jars/${fn} ]
then
echo "Fetching ${version}"...
(cd jars; wget ${url})
fi
runTests ${version} ${rhinoVersion} ./jars/${fn}
}
fetchAndRunUrl 1.7R4 4 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7R4/rhino-1.7R4.jar
fetchAndRunUrl 1.7R5 5 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7R5/rhino-1.7R5.jar
fetchAndRunUrl 1.7.7.2 7 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7.7.2/rhino-1.7.7.2.jar
fetchAndRunUrl 1.7.10 10 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7.10/rhino-1.7.10.jar
fetchAndRunUrl 1.7.11 11 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7.11/rhino-1.7.11.jar
fetchAndRunUrl 1.7.12 12 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7.12/rhino-1.7.12.jar
fetchAndRunUrl 1.7.13 13 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7.13/rhino-1.7.13.jar
fetchAndRunUrl 1.7.14 14 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7.14/rhino-1.7.14.jar
fetchAndRunUrl 1.7.15 15 https://repo1.maven.org/maven2/org/mozilla/rhino/1.7.15/rhino-1.7.15.jar
runTests 1.8.0 20 ~/src/rhino/rhino-all/build/libs/rhino-all-1.8.0.jar
rm -f tmptest.$$
echo 'Building HTML'
node buildrhino.js