public void executeSource(String filename, String sourceCode) {
ctx.evaluateString(scope, sourceCode, filename, 0, null);
}
public static void main(final String[] args) throws Exception {
Configuration c = new Configuration();
String fileout = c.getJsonOutputFile();
FileWriter fw = new FileWriter(fileout);
c.setGenerator(new CombinedGenerator(new JsonGenerator(fw), new HtmlGenerator(c)));
Runner r = new Runner(c);
for(String file : args) {
r.executeReader(file, new FileReader(file));
}
CoverageData data = r.done();
if(c.isJsonOutputMerge() && new File(fileout).exists()) {
FileReader fr = new FileReader(fileout);
CoverageData moreData = new JsonIngester().ingest(fr);
fr.close();
data = moreData.plus(data);
}
c.getGenerator().generate(data);
fw.close();
}