use of org.erlide.cover.api.IConfiguration in project erlide_eclipse by erlang.
the class CoverEventHandler method addModuleToTree.
// adds module to the statistics tree
private void addModuleToTree(final ModuleStats moduleStats) {
ICoverageObject root = StatsTreeModel.getInstance().getRoot();
final IConfiguration config = CoveragePerformer.getPerformer().getConfig();
final String ppath = ErlangEngine.getInstance().getModelUtilService().getProject(config.getProject()).getWorkspaceProject().getLocation().toString();
String mpath = config.getModule(moduleStats.getLabel()).getFilePath();
mpath = mpath.substring(ppath.length());
log.info(ppath);
log.info(mpath);
final String[] parts = mpath.split("/");
root.setLiniesCount(root.getLinesCount() + moduleStats.getLinesCount());
root.setCoverCount(root.getCoverCount() + moduleStats.getCoverCount());
for (int i = 1; i < parts.length - 1; i++) {
ICoverageObject tmp = root.findChild(parts[i]);
if (tmp == null) {
tmp = new StatsTreeObject(ObjectType.FOLDER);
tmp.setLabel(parts[i]);
}
tmp.setLiniesCount(tmp.getLinesCount() + moduleStats.getLinesCount());
tmp.setCoverCount(tmp.getCoverCount() + moduleStats.getCoverCount());
root.addChild(parts[i], tmp);
root = tmp;
}
root.addChild(moduleStats.getLabel(), moduleStats);
}
use of org.erlide.cover.api.IConfiguration in project erlide_eclipse by erlang.
the class CoverRunner method run.
@Override
public void run() {
final CoverBackend backend = CoverBackend.getInstance();
try {
CoverRunner.semaphore.acquireUninterruptibly();
final IConfiguration config = backend.getSettings().getConfig();
CoverageAnalysis.prepareAnalysis(config);
runTests(config);
CoverageAnalysis.performAnalysis();
} catch (final Exception e) {
ErlLogger.error(e);
backend.handleError("Exception while running cover: " + e);
} finally {
CoverRunner.semaphore.release();
}
}
Aggregations