Search in sources :

Example 1 with CoverageSuite

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()]);
}
Also used : CoverageSuite(com.intellij.coverage.CoverageSuite) File(java.io.File) CoverageSuitesBundle(com.intellij.coverage.CoverageSuitesBundle) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CoverageSuite (com.intellij.coverage.CoverageSuite)1 CoverageSuitesBundle (com.intellij.coverage.CoverageSuitesBundle)1 File (java.io.File)1 Nullable (org.jetbrains.annotations.Nullable)1