return;
}
reporter.startFunction("root");
Session session = createSession(sourceFile.getParentFile());
// Examples assume that the package is already on the search path
if(sourceFile.getName().endsWith(".Rd")) {
loadLibrary(session, namespaceUnderTest);
}
UnsupportedTerminal term = new UnsupportedTerminal();
InputStream in = new ByteArrayInputStream(sourceText.getBytes(Charsets.UTF_8));
ConsoleReader consoleReader = new ConsoleReader(in, reporter.getStdOut(), term);
JlineRepl repl = new JlineRepl(session, consoleReader);
repl.setEcho(true);
repl.setStopOnError(true);
try {
repl.run();
reporter.functionSucceeded();
} catch(Throwable e) {
reporter.functionThrew(e);
return;
}
// look for "junit-style" test functions.
// This is renjin's own convention, but it's nice to be
// able to see the results of many tests rather than
// topping at the first error
for(Symbol name : session.getGlobalEnvironment().getSymbolNames()) {
if(name.getPrintName().startsWith("test.")) {
SEXP value = session.getGlobalEnvironment().getVariable(name);
if(isZeroArgFunction(value)) {
executeTestFunction(session.getTopLevelContext(), name);
}
}
}
}