@@ -9,8 +9,11 @@ import com.intellij.openapi.diagnostic.Logger
9
9
import com.intellij.openapi.editor.markup.GutterIconRenderer
10
10
import com.intellij.psi.PsiElement
11
11
import javax.swing.Icon
12
+ import kotlin.io.path.name
12
13
import org.utbot.cpp.clion.plugin.actions.generate.RunWithCoverageAction
14
+ import org.utbot.cpp.clion.plugin.settings.settings
13
15
import org.utbot.cpp.clion.plugin.ui.services.TestsResultsStorage
16
+ import org.utbot.cpp.clion.plugin.utils.localPath
14
17
import testsgen.Testgen
15
18
16
19
class UTBotTestRunLineMarkerProvider : LineMarkerProvider {
@@ -42,6 +45,7 @@ class UTBotTestRunLineMarkerProvider : LineMarkerProvider {
42
45
if (element.firstChild != null
43
46
|| ! elementRequiresIcon
44
47
|| element.containingFile.name.endsWith(" .h" )
48
+ || ! isElementInTestFileGeneratedByUTBot(element)
45
49
) {
46
50
return null
47
51
}
@@ -51,7 +55,13 @@ class UTBotTestRunLineMarkerProvider : LineMarkerProvider {
51
55
return UTBotRunWithCoverageLineMarkerInfo (element, message, getStatusIcon(element))
52
56
}
53
57
54
- private fun getStatusIcon (element : PsiElement ): Icon {
58
+ private fun isElementInTestFileGeneratedByUTBot (element : PsiElement ) =
59
+ element.containingFile.virtualFile.localPath.let {
60
+ it.toString().startsWith(element.project.settings.testsDirPath.toString()) &&
61
+ it.name.contains(" test" )
62
+ }
63
+
64
+ fun getStatusIcon (element : PsiElement ): Icon {
55
65
// return icon for Running All Tests
56
66
if (element.canPlaceAllTestsIcon()) {
57
67
return AllIcons .RunConfigurations .TestState .Run_run
0 commit comments