Skip to content

Commit 238f004

Browse files
vsukharevSpace Team
authored andcommitted
[Tests][Wasm] Adjust getWasmTestOutputDirectory for any combination of absolute and relative paths
^KT-81106
1 parent dff4f43 commit 238f004

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ fun TestServices.getWasmTestOutputDirectory(): File {
113113
val pathToTestDir = allDirectives[WasmEnvironmentConfigurationDirectives.PATH_TO_TEST_DIR].first()
114114

115115
val testGroupOutputDir = File(File(pathToRootOutputDir, "out"), testGroupDirPrefix)
116-
val stopFile = File(pathToTestDir)
117-
val fullPathSequence = generateSequence(originalFile.parentFile) { it.parentFile }.toList()
116+
val stopFile = File(pathToTestDir).absoluteFile
117+
val parentAbsoluteFile = originalFile.parentFile.absoluteFile
118+
val fullPathSequence = generateSequence(parentAbsoluteFile) { it.parentFile }.toList()
118119
val suffixPathSequence = fullPathSequence.takeWhile { it != stopFile }
119120
require(suffixPathSequence.size < fullPathSequence.size) {
120-
"Folder $stopFile (which is set by PATH_TO_TEST_DIR directive) must contain ${originalFile.parentFile.absoluteFile}"
121+
"Folder $stopFile (which is set by PATH_TO_TEST_DIR directive) must contain $parentAbsoluteFile"
121122
}
122123
return suffixPathSequence
123124
.map { it.name }

0 commit comments

Comments
 (0)