File tree 2 files changed +10
-2
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ import org.utbot.intellij.plugin.ui.utils.addSourceRootIfAbsent
130
130
import org.utbot.intellij.plugin.ui.utils.allLibraries
131
131
import org.utbot.intellij.plugin.ui.utils.findFrameworkLibrary
132
132
import org.utbot.intellij.plugin.ui.utils.getOrCreateTestResourcesPath
133
+ import org.utbot.intellij.plugin.ui.utils.isGradle
133
134
import org.utbot.intellij.plugin.ui.utils.kotlinTargetPlatform
134
135
import org.utbot.intellij.plugin.ui.utils.parseVersion
135
136
import org.utbot.intellij.plugin.ui.utils.testResourceRootTypes
@@ -435,7 +436,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
435
436
val testRoot = getTestRoot()
436
437
? : return ValidationInfo (" Test source root is not configured" , testSourceFolderField.childComponent)
437
438
438
- if (findReadOnlyContentEntry(testRoot) == null ) {
439
+ if (! model.project.isGradle() && findReadOnlyContentEntry(testRoot) == null ) {
439
440
return ValidationInfo (" Test source root is located out of content entry" , testSourceFolderField.childComponent)
440
441
}
441
442
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import com.intellij.util.ArrayUtil
13
13
import java.io.File
14
14
import javax.swing.DefaultComboBoxModel
15
15
import javax.swing.JList
16
+ import org.jetbrains.kotlin.idea.util.projectStructure.allModules
16
17
import org.utbot.common.PathUtil
17
18
import org.utbot.intellij.plugin.models.GenerateTestsModel
18
19
import org.utbot.intellij.plugin.ui.utils.addDedicatedTestRoot
@@ -50,7 +51,13 @@ class TestFolderComboWithBrowseButton(private val model: GenerateTestsModel) : C
50
51
}
51
52
}
52
53
53
- val testRoots = model.potentialTestModules.flatMap { it.suitableTestSourceRoots().toMutableList() }.toMutableList()
54
+ val testRoots = if (model.project.isGradle()) {
55
+ val allRoots = mutableSetOf<VirtualFile >()
56
+ model.project.allModules().map { it.suitableTestSourceRoots() }.forEach(allRoots::addAll)
57
+ allRoots.toMutableList()
58
+ } else {
59
+ model.potentialTestModules.flatMap { it.suitableTestSourceRoots().toMutableList() }.toMutableList()
60
+ }
54
61
55
62
// this method is blocked for Gradle, where multiple test modules can exist
56
63
model.testModule.addDedicatedTestRoot(testRoots)
You can’t perform that action at this time.
0 commit comments