diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RVersionNumber.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RVersionNumber.java
index 7bb6438454c37fd40d62e560d3320f731ab07846..55e87678b8123e6bc3c6f2576355db145c5ace1a 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RVersionNumber.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RVersionNumber.java
@@ -40,6 +40,7 @@ public class RVersionNumber {
     public static final String MAJOR_MINOR = MAJOR + "." + MINOR;
     public static final String MINOR_PATCH = MINOR + "." + PATCH;
     public static final String FULL = MAJOR + "." + MINOR + "." + PATCH;
+    public static final String R_HYPHEN_FULL = "R-" + FULL;
 
     public static final String RELEASE_YEAR = "2016";
     public static final String RELEASE_MONTH = "03";
diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/GnuROneShotRSession.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/GnuROneShotRSession.java
index f42d927c67cd9fd4c9dfd3717377c4aee57fccde..c23ac7cdceeec4527a5abf2f98d56cfc405451a6 100644
--- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/GnuROneShotRSession.java
+++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/GnuROneShotRSession.java
@@ -38,13 +38,14 @@ import com.oracle.truffle.r.test.TestBase;
  * currently some differences in behavior (TBD). Which R is used is controlled by the environment
  * variable {@code FASTR_TESTGEN_GNUR}. If unset, we take the default, which is currently the system
  * installed version (more precisely whatever "R" resolves to on the PATH). If
- * {@code FASTR_TESTGEN_GNUR} is set to {@code internal}, we use the internally built GnuR. Any
- * other value behaves as if it was unset. {@code PATH}.
+ * {@code FASTR_TESTGEN_GNUR} is set to {@code internal} or the empty string, we use the internally
+ * built GnuR. Any other value is treated as a path to a directory assumed to contain an R HOME, i.e
+ * the executable used is {@code $FASTR_TESTGEN_GNUR/bin/R}.
  */
 public class GnuROneShotRSession implements RSession {
 
     private static final String[] GNUR_COMMANDLINE = new String[]{"R", "--vanilla", "--slave", "--silent"};
-    private static final String SYSTEM_GNUR_ENV = "FASTR_TESTGEN_GNUR";
+    private static final String FASTR_TESTGEN_GNUR = "FASTR_TESTGEN_GNUR";
     private static final String NATIVE_PROJECT = "com.oracle.truffle.r.native";
 
     //@formatter:off
@@ -61,10 +62,15 @@ public class GnuROneShotRSession implements RSession {
     protected static byte[] QUIT = "q()\n".getBytes();
 
     protected Process createGnuR() throws IOException {
-        String testGenGnuR = System.getenv(SYSTEM_GNUR_ENV);
-        if (testGenGnuR != null && testGenGnuR.equals("internal")) {
-            Path gnuRPath = FileSystems.getDefault().getPath(REnvVars.rHome(), NATIVE_PROJECT, "gnur", "R-" + RVersionNumber.FULL, "bin", "R");
-            GNUR_COMMANDLINE[0] = gnuRPath.toString();
+        String testGenGnuR = System.getenv(FASTR_TESTGEN_GNUR);
+        if (testGenGnuR != null) {
+            if (testGenGnuR.length() == 0 || testGenGnuR.equals("internal")) {
+                Path gnuRPath = FileSystems.getDefault().getPath(REnvVars.rHome(), NATIVE_PROJECT, "gnur", RVersionNumber.R_HYPHEN_FULL, "bin", "R");
+                GNUR_COMMANDLINE[0] = gnuRPath.toString();
+            } else {
+                GNUR_COMMANDLINE[0] = FileSystems.getDefault().getPath(testGenGnuR, "bin", "R").toString();
+            }
+
         }
         ProcessBuilder pb = new ProcessBuilder(GNUR_COMMANDLINE);
         // fix time zone to "CET" (to create consistent expected output)
@@ -114,4 +120,9 @@ public class GnuROneShotRSession implements RSession {
     public String name() {
         return "GnuR one-shot";
     }
+
+    public static void main(String[] args) {
+        String testGenGnuR = System.getenv(FASTR_TESTGEN_GNUR);
+        System.out.printf("%s='%s'%n", FASTR_TESTGEN_GNUR, testGenGnuR);
+    }
 }
diff --git a/mx.fastr/mx_fastr.py b/mx.fastr/mx_fastr.py
index 88ca3bf219105ef5aeb48f926c2bf38a62a80f59..dd060c203f000a2308f12dde846e7d139b6b510c 100644
--- a/mx.fastr/mx_fastr.py
+++ b/mx.fastr/mx_fastr.py
@@ -436,14 +436,31 @@ def testgen(args):
     # check we are in the home directory
     if os.getcwd() != _fastr_suite.dir:
         mx.abort('must run rtestgen from FastR home directory')
-    # check the version of GnuR against FastR
-    try:
-        fastr_version = subprocess.check_output([mx.get_jdk().java, '-cp', mx.classpath('com.oracle.truffle.r.runtime'), 'com.oracle.truffle.r.runtime.RVersionNumber'])
-        gnur_version = subprocess.check_output(['R', '--version'])
-        if not gnur_version.startswith(fastr_version):
-            mx.abort('R version is incompatible with FastR, please update to ' + fastr_version)
-    except subprocess.CalledProcessError:
-        mx.abort('RVersionNumber.main failed')
+
+    def need_version_check():
+        vardef = os.environ.has_key('FASTR_TESTGEN_GNUR')
+        varval = os.environ['FASTR_TESTGEN_GNUR'] if vardef else None
+        version_check = not vardef or varval != 'internal'
+        if version_check:
+            if vardef and varval != 'internal':
+                rpath = join(varval, 'bin', 'R')
+            else:
+                rpath = 'R'
+        else:
+            rpath = None
+        return version_check, rpath
+
+    version_check, rpath = need_version_check()
+    if version_check:
+        # check the version of GnuR against FastR
+        try:
+            fastr_version = subprocess.check_output([mx.get_jdk().java, '-cp', mx.classpath('com.oracle.truffle.r.runtime'), 'com.oracle.truffle.r.runtime.RVersionNumber'])
+            gnur_version = subprocess.check_output([rpath, '--version'])
+            if not gnur_version.startswith(fastr_version):
+                mx.abort('R version is incompatible with FastR, please update to ' + fastr_version)
+        except subprocess.CalledProcessError:
+            mx.abort('RVersionNumber.main failed')
+
     # clean the test project to invoke the test analyzer AP
     testOnly = ['--projects', 'com.oracle.truffle.r.test']
     mx.clean(['--no-dist', ] + testOnly)