use of com.intellij.coverage.CoverageSuite in project intellij-community by JetBrains.
the class ShowCoveringTestsAction method getTraceFiles.
@Nullable
private static File[] getTraceFiles(Project project) {
final CoverageSuitesBundle currentSuite = CoverageDataManager.getInstance(project).getCurrentSuitesBundle();
if (currentSuite == null)
return null;
final List<File> files = new ArrayList<>();
for (CoverageSuite coverageSuite : currentSuite.getSuites()) {
final String filePath = coverageSuite.getCoverageDataFileName();
final String dirName = FileUtil.getNameWithoutExtension(new File(filePath).getName());
final File parentDir = new File(filePath).getParentFile();
final File tracesDir = new File(parentDir, dirName);
final File[] suiteFiles = tracesDir.listFiles();
if (suiteFiles != null) {
Collections.addAll(files, suiteFiles);
}
}
return files.isEmpty() ? null : files.toArray(new File[files.size()]);
}
Aggregations