import org.simantics.scl.compiler.commands.CommandSession;
import org.simantics.scl.compiler.commands.TestScriptExecutor;
+import org.simantics.scl.compiler.elaboration.java.Builtins;
+import org.simantics.scl.compiler.elaboration.java.JavaModule;
import org.simantics.scl.compiler.module.coverage.CombinedCoverage;
-import org.simantics.scl.compiler.module.options.ModuleCompilationOptions;
-import org.simantics.scl.compiler.module.options.ModuleCompilationOptionsAdvisor;
import org.simantics.scl.compiler.module.repository.ModuleRepository;
import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.Types;
public class ModelledSTSTest {
private final String name;
+ private final String parentName;
private final String code;
private final int priority;
private final boolean ignored;
private CombinedCoverage coverage;
private Map<String, String> variables;
- ModelledSTSTest(String name, String code, int priority, boolean ignored, Set<String> dependencies, Map<String, String> variables) {
+ ModelledSTSTest(String name, String parentName, String code, int priority, boolean ignored, Set<String> dependencies, Map<String, String> variables) {
this.name = name;
+ this.parentName = parentName;
this.code = code;
this.priority = priority;
this.ignored = ignored;
return name;
}
+ public String getParentName() {
+ return parentName;
+ }
+
public String getCode() {
return code;
}
}
public List<CommandSessionVariable> run(List<CommandSessionVariable> vars) throws IOException {
- ModuleRepository repo = new ModuleRepository(SCLOsgi.SOURCE_REPOSITORY);
+// ModuleRepository repo = new ModuleRepository(SCLOsgi.SOURCE_REPOSITORY);
+ ModuleRepository repo = SCLOsgi.MODULE_REPOSITORY;
+ CommandSession session = null;
try {
- repo.setAdvisor(new ModuleCompilationOptionsAdvisor() {
-
- @Override
- public ModuleCompilationOptions getOptions(String moduleName) {
- // TODO: default to false
- boolean coverage = true;
- // TODO: add moduleName filters back
- // for (Pattern p : getModuleNameFilterPatterns()) {
- // if (p.matcher(moduleName.toLowerCase()).find()) {
- // coverage = true;
- // break;
- // }
- // }
- return new ModuleCompilationOptions(coverage);
- }
- });
+// repo.setAdvisor(new ModuleCompilationOptionsAdvisor() {
+//
+// @Override
+// public ModuleCompilationOptions getOptions(String moduleName) {
+// // TODO: default to false
+// boolean coverage = true;
+// // TODO: add moduleName filters back
+// // for (Pattern p : getModuleNameFilterPatterns()) {
+// // if (p.matcher(moduleName.toLowerCase()).find()) {
+// // coverage = true;
+// // break;
+// // }
+// // }
+// return new ModuleCompilationOptions(coverage);
+// }
+// });
SCLReportingHandler handler = (SCLReportingHandler) SCLContext.getCurrent().get(SCLReportingHandler.REPORTING_HANDLER);
- CommandSession session = new CommandSession(repo, handler);
+ session = new CommandSession(repo, handler);
for (CommandSessionVariable var : vars)
session.setVariable(var.getName(), var.getType(), var.getValue());
return result;
} finally {
// remember to flush this repository
- repo.flush();
+// repo.flush();
+ Builtins.flush();
+ JavaModule.flush();
}
}