Fail per file check on first exception

This commit is contained in:
Simon Ogorodnik
2018-04-04 13:18:05 +03:00
parent c8fbf2d3ac
commit 1a015402c8
@@ -82,21 +82,21 @@ class AllKotlinInspectionTest : DaemonAnalyzerTestCase() {
val errors = mutableListOf<Throwable>()
profileTools.forEach {
val localInspectionTool = it.tool.tool as? LocalInspectionTool ?: return@forEach
if (it.tool.language !in setOf(null, "kotlin", "UAST")) return@forEach
for (it in profileTools) {
val localInspectionTool = it.tool.tool as? LocalInspectionTool ?: continue
if (it.tool.language !in setOf(null, "kotlin", "UAST")) continue
val result = measureNanoTime {
try {
localInspectionTool.analyze(psiFile)
} catch (t: Throwable) {
val myEx = ExceptionWhileInspection(it.tool.id, t)
myEx.printStackTrace()
errors += myEx
}
}
results[it.tool.id] = result
totalNs += result
if (errors.isNotEmpty()) break
}
return PerFileTestResult(results, totalNs, errors)