Permalink
Browse files

Minor fixes

  • Loading branch information...
steve-s committed Oct 10, 2018
1 parent 0f6eb4e commit 26091dac6b7a1a728eaec2a27b1ad26fe1efa240
Showing with 112 additions and 4 deletions.
  1. +1 −1 ci.hocon
  2. +1 −1 fastr_javaui/test.sh
  3. +1 −1 fastr_node/test.sh
  4. +36 −0 r_java_bench/test.R
  5. +25 −0 r_java_bench/test.sh
  6. +21 −0 r_java_embedding/expected.out
  7. +23 −0 r_java_embedding/test.sh
  8. +3 −0 test_all.sh
  9. +1 −1 weather_predictor/test.sh
@@ -1 +1 @@
overlay: "0690397ad2a4a16a4d9a181ee64f7975179be547"
overlay: "483917f28f40cbdfdc4fb5a9998d4388fa260a5a"
@@ -2,8 +2,8 @@
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# This file is made available under version 3 of the GNU General Public License.
set -e
set -o xtrace
# Resolve the location of this script
source="${BASH_SOURCE[0]}"
@@ -2,8 +2,8 @@
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# This file is made available under version 3 of the GNU General Public License.
set -e
set -o xtrace
# Resolve the location of this script
source="${BASH_SOURCE[0]}"
@@ -0,0 +1,36 @@
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# This file is made available under version 3 of the GNU General Public License.
# Tests the examples
# Compile the Java class that we will use in the benchmark
# Note: you need to have $JAVA_HOME variable defined in the environment
source("java.R")
# rJava
library(rJava)
.jinit()
.jaddClassPath(getwd())
obj <- .jnew("RJavaBench")
obj2 <- obj$objectFunction(obj)
obj$intField <- as.integer(obj2$doubleField)
for (i in 1:10) {
result <- obj$intFunction(i, obj$intField)
}
stopifnot(result == 10)
# Interop
obj <- new("RJavaBench")
obj2 <- obj$objectFunction(obj)
obj$intField <- as.integer(obj2$doubleField)
for (i in 1:10) {
result <- obj$intFunction(i, obj$intField)
}
stopifnot(result == 10)
# cleanup
unlink("RJavaBench.java")
unlink("RJavaBench.class")
@@ -0,0 +1,25 @@
#!/bin/bash
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# This file is made available under version 3 of the GNU General Public License.
set -e
set -o xtrace
# Resolve the location of this script
source="${BASH_SOURCE[0]}"
while [ -h "$source" ] ; do
prev_source="$source"
source="$(readlink "$source")";
if [[ "$source" != /* ]]; then
# if the link was relative, it was relative to where it came from
dir="$( cd -P "$( dirname "$prev_source" )" && pwd )"
source="$dir/$source"
fi
done
dir="$( cd -P "$( dirname "$source" )" && pwd )"
: ${GRAALVM_DIR?"GRAALVM_DIR must point to a GraalVM image"}
cd ${dir}
${GRAALVM_DIR}/bin/Rscript test.R
cd -
@@ -0,0 +1,21 @@
The whole data frame printed in R:
id name language
1 1 Florian Python
2 2 Lukas R
3 3 Mila Java
4 4 Paley Coq
5 5 Stepan C#
6 6 Tomas Java
7 7 Zbynek Scala
---------
Filter out users with ID>2:
id name language
3 3 Mila Java
4 4 Paley Coq
5 5 Stepan C#
6 6 Tomas Java
7 7 Zbynek Scala
---------
How many users like Java: 2
@@ -0,0 +1,23 @@
#!/bin/bash
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# This file is made available under version 3 of the GNU General Public License.
set -e
set -o xtrace
# Resolve the location of this script
source="${BASH_SOURCE[0]}"
while [ -h "$source" ] ; do
prev_source="$source"
source="$(readlink "$source")";
if [[ "$source" != /* ]]; then
# if the link was relative, it was relative to where it came from
dir="$( cd -P "$( dirname "$prev_source" )" && pwd )"
source="$dir/$source"
fi
done
dir="$( cd -P "$( dirname "$source" )" && pwd )"
: ${GRAALVM_DIR?"GRAALVM_DIR must point to a GraalVM image"}
diff <(${GRAALVM_DIR}/bin/java -cp ${dir}/bin com.oracle.truffle.r.fastrembedding.FastREmbeddingDemo) ${dir}/expected.out
@@ -3,6 +3,7 @@
# This file is made available under version 3 of the GNU General Public License.
set -e
set -o xtrace
# Resolve the location of this script
source="${BASH_SOURCE[0]}"
@@ -21,3 +22,5 @@ ${dir}/weather_predictor/test.sh
${dir}/fastr_javaui/test.sh
${dir}/fastr_node/test.sh
${dir}/fastr_scalar/run.sh
${dir}/r_java_embedding/test.sh
${dir}/r_java_bench/test.sh
@@ -2,8 +2,8 @@
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# This file is made available under version 3 of the GNU General Public License.
set -e
set -o xtrace
# Resolve the location of this script
source="${BASH_SOURCE[0]}"

0 comments on commit 26091da

Please sign in to comment.