Skip to content

Commit fbf87e3

Browse files
Possible fix for incorrect location to create utbot-tests (#2526)
1 parent 716c974 commit fbf87e3

File tree

1 file changed

+4
-1
lines changed
  • utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin/ui/utils

1 file changed

+4
-1
lines changed

utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,11 @@ fun Module.addDedicatedTestRoot(testSourceRoots: MutableList<ITestSourceRoot>, l
184184
if (testSourceRoots.any { root -> root.dir?.name == dedicatedTestSourceRootName }) return null
185185

186186
val moduleInstance = ModuleRootManager.getInstance(this)
187-
val testFolder = moduleInstance.contentEntries.flatMap { it.sourceFolders.toList() }
187+
val testFolder = moduleInstance.contentEntries
188+
.flatMap { it.sourceFolders.toList() }
189+
.filterNot { it.isForGeneratedSources() }
188190
.firstOrNull { it.rootType in testSourceRootTypes }
191+
189192
(testFolder?.let { testFolder.file?.parent }
190193
?: testFolder?.contentEntry?.file ?: this.guessModuleDir())?.let {
191194
val file = FakeVirtualFile(it, dedicatedTestSourceRootName)

0 commit comments

Comments
 (0)