Skip to content

Commit dac9ca5

Browse files
vsukharevSpace Team
authored andcommitted
[Tests][Wasm] Validate shortening of test output directory path
^KT-81106
1 parent 01917f4 commit dac9ca5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

wasm/wasm.tests/testFixtures/org/jetbrains/kotlin/wasm/test/handlers/AbstractWasmArtifactsCollector.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ fun TestServices.getWasmTestOutputDirectory(): File {
114114

115115
val testGroupOutputDir = File(File(pathToRootOutputDir, "out"), testGroupDirPrefix)
116116
val stopFile = File(pathToTestDir)
117-
return generateSequence(originalFile.parentFile) { it.parentFile }
118-
.takeWhile { it != stopFile }
117+
val fullPathSequence = generateSequence(originalFile.parentFile) { it.parentFile }.toList()
118+
val suffixPathSequence = fullPathSequence.takeWhile { it != stopFile }
119+
require(suffixPathSequence.size < fullPathSequence.size) {
120+
"Folder $stopFile (which is set by PATH_TO_TEST_DIR directive) must contain ${originalFile.parentFile.absoluteFile}"
121+
}
122+
return suffixPathSequence
119123
.map { it.name }
120124
.toList().asReversed()
121125
.fold(testGroupOutputDir, ::File)

0 commit comments

Comments
 (0)