-
Notifications
You must be signed in to change notification settings - Fork 6
/
.test.sh
executable file
·74 lines (62 loc) · 2.01 KB
/
.test.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
#!/bin/bash -x
set -e
if ! [ -e $1/bin/java ]; then
echo Usage: $0 "<path_to_graalvm>"
exit 1
fi
GRAALBIN=$1/bin
function ginstall() {
if [ -e $GRAALBIN/gu ]; then
if $GRAALBIN/gu list | grep "^$1 "; then
echo $1 is installed
else
$GRAALBIN/gu install $1
REBUILD=true
fi
fi
}
echo -en 'travis_fold:start:c\\r'
make -C c
./c/sieve 25
(cd c; clang -c -emit-llvm *.c)
$GRAALBIN/lli --lib c/natural.bc --lib c/filter.bc --lib c/primes.bc c/main.bc 25
echo -en 'travis_fold:end:c\\r'
echo -en 'travis_fold:start:java\\r'
mvn -q -f java/pom.xml clean install
mvn -q -f java/algorithm/pom.xml exec:java -Drepeat=25
JAVA_HOME=$1 mvn -q -f java/algorithm/pom.xml exec:java -Drepeat=25
if [ "x" != "x$DISPLAY" ]; then
mvn -q -f java/client/pom.xml exec:exec -Drepeat=5
fi
echo -en 'travis_fold:end:java\\r'
echo -en 'travis_fold:start:R\\r'
ginstall R
$GRAALBIN/polyglot --jvm --eval "js:count=25" --file R+js/sieve.R --file R+js/sieve.js
echo -en 'travis_fold:end:R\\r'
echo -en 'travis_fold:start:ruby\\r'
ginstall ruby
JAVA_HOME=$1 mvn -q clean package exec:exec -f ruby+js/fromjava/pom.xml -Drepeat=25
$GRAALBIN/ruby ruby/sieve.rb 25
echo -en 'travis_fold:end:ruby\\r'
echo -en 'travis_fold:start:js\\r'
if ! [ -f $GRAALBIN/node ]; then
ginstall nodejs
fi
$GRAALBIN/node js/sieve.js 15
mvn -q -f js/fromjava/pom.xml package exec:exec -Drepeat=15
JAVA_HOME=$1 mvn -q -f js/fromjava/pom.xml package exec:exec -Drepeat=15
echo -en 'travis_fold:end:js\\r'
echo -en 'travis_fold:start:python\\r'
ginstall python
$GRAALBIN/graalpython python/sieve.py 15
echo -en 'travis_fold:end:python\\r'
echo -en 'travis_fold:start:polyglot\\r'
$GRAALBIN/polyglot --jvm --file ruby+js/sieve.rb --eval js:count=15 --file ruby+js/sieve.js
if [ -n "$REBUILD" ]; then
ginstall native-image
$GRAALBIN/gu rebuild-images polyglot
fi
if $GRAALBIN/polyglot --version:graalvm | grep -i Ruby; then
$GRAALBIN/polyglot --file ruby+js/sieve.rb --eval js:count=15 --file ruby+js/sieve.js
fi
echo -en 'travis_fold:end:polyglot\\r'