diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ResourceHandlerFactory.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ResourceHandlerFactory.java index a7f2336b164e2b6ddc45890727e81496b39e8277..0fddff7ddb5511d204ab70cce66397c540d59db1 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ResourceHandlerFactory.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ResourceHandlerFactory.java @@ -34,7 +34,7 @@ public abstract class ResourceHandlerFactory { public interface Handler { /** * See {@link java.lang.Class#getResource(String)}. - * + * * @return The path component of the {@link java.net URL} returned by * {@link java.lang.Class#getResource(String)} */ @@ -58,7 +58,7 @@ public abstract class ResourceHandlerFactory { private static ResourceHandlerFactory theInstance; - private static ResourceHandlerFactory getInstance() { + public static ResourceHandlerFactory getInstance() { return theInstance; } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java index 189d8ab31ee6be1b3561b5f67e0565bb191f590f..330c561581403e18243bdca131d5d6a97ee88c65 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java @@ -234,6 +234,12 @@ public class TestBase { } } + @SuppressWarnings("unchecked") + public <T> T doBeforeTest() { + beforeTest(); + return (T) this; + } + private static class ExpectedTestOutputManager extends TestOutputManager { private final boolean generate; diff --git a/mx.fastr/mx_fastr_dists.py b/mx.fastr/mx_fastr_dists.py index 061ee72316b4806f94af87a8d2c6b4f84bd5c3d4..8333b27cd8bc184ed1a03633548b73c53313fc5d 100644 --- a/mx.fastr/mx_fastr_dists.py +++ b/mx.fastr/mx_fastr_dists.py @@ -54,12 +54,26 @@ class DelFastRNativeProject(FastRProjectAdapter): def getBuildTask(self, args): return mx.NativeBuildTask(args, self) + def _get_gnur_files(self, gnur_dir, files, results): + for f in files: + results.append(join(self.dir, gnur_dir, f)) + def getResults(self): + ''' + Capture all the files from the com.oracle.truffle.r.native project that are needed + in an alternative implementation of the R FFI. This includes some files from GNU R. + This code has to be kept in sync with the FFI implementation. + ''' + # plain files + results = [join(self.dir, "platform.mk")] gnur = join('gnur', mx_fastr.r_version()) gnur_appl = join(gnur, 'src', 'appl') - # plain files - results = [join(self.dir, result) for result in ["platform.mk", join(gnur_appl, 'pretty.c'), join(gnur_appl, 'interv.c')]] - + self._get_gnur_files(gnur_appl, ['pretty.c', 'interv.c'], results) + gnur_main = join(gnur, 'src', 'main') + self._get_gnur_files(gnur_main, ['colors.c', 'devices.c', 'engine.c', 'format.c', 'graphics.c', + 'plot.c', 'plot3d.c', 'plotmath.c', 'rlocale.c', 'sort.c'], results) + # these files are not compiled, just "included" + self._get_gnur_files(gnur_main, ['xspline.c', 'rlocale_data.h'], results) # directories for d in ["fficall/src/common", "fficall/src/include", "fficall/src/variable_defs"]: self._get_files(d, results) diff --git a/mx.fastr/suite.py b/mx.fastr/suite.py index 910a973d906d0ad684a9e2ff2bcce49816ba24d1..3e663d5297acb185d34402b1a8e4617c562aba61 100644 --- a/mx.fastr/suite.py +++ b/mx.fastr/suite.py @@ -434,6 +434,20 @@ suite = { ], }, + "FASTR_UNIT_TESTS" : { + "description" : "unit tests", + "dependencies" : ["com.oracle.truffle.r.test"], + "exclude": ["mx:HAMCREST", "mx:JUNIT", "mx:JMH"], + "distDependencies" : [ + "FASTR", + "truffle:TRUFFLE_API", + "truffle:TRUFFLE_DEBUG", + "TRUFFLE_R_PARSER_PROCESSOR", + "truffle:TRUFFLE_TCK", + ], + + }, + "FASTR_NATIVE_DEV": { "description" : "support for overriding the native project implementation in a separate suite", "dependencies" : ["com.oracle.truffle.r.native"],