Skip to content

Commit f1dd713

Browse files
committed
Show error window if no test source root were found (#657)
1 parent c447c0b commit f1dd713

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import org.utbot.common.filterWhen
5454
import org.utbot.engine.util.mockListeners.ForceStaticMockListener
5555
import org.utbot.framework.plugin.api.testFlow
5656
import org.utbot.intellij.plugin.settings.Settings
57+
import org.utbot.intellij.plugin.ui.utils.suitableTestSourceRoots
5758
import org.utbot.intellij.plugin.util.isAbstract
5859
import kotlin.reflect.KClass
5960
import kotlin.reflect.full.functions
@@ -89,6 +90,15 @@ object UtTestsDialogProcessor {
8990
return null
9091
}
9192

93+
if (testModule.suitableTestSourceRoots().isEmpty()) {
94+
val errorMessage = """
95+
No test source roots found in the project.
96+
Please, create or configure at least one test source root.
97+
""".trimIndent()
98+
showErrorDialogLater(project, errorMessage, "Test source roots not found")
99+
return null
100+
}
101+
92102
return GenerateTestsDialogWindow(
93103
GenerateTestsModel(
94104
project,

0 commit comments

Comments
 (0)