Skip to content

Commit 0256284

Browse files
ddolovovSpace Team
authored andcommitted
[JS, Wasm] Move stdlib/kotlin-test version tests to the test source set
These tests happen to exist in a 'fixture' source set. As a result, they were not executed at the CI server. Now, they are moved to the actual 'test' source set, which would make them run at the CI server. ^KT-82208
1 parent f796aa1 commit 0256284

File tree

3 files changed

+80
-59
lines changed

3 files changed

+80
-59
lines changed

js/js.tests/testFixtures/org/jetbrains/kotlin/js/testOld/klib/LibrarySpecialCompatibilityChecksTest.kt

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -282,62 +282,3 @@ private fun zipDirectory(directory: File, zipFile: File) {
282282
KFile(directory.toPath()).zipDirAs(KFile(zipFile.toPath()))
283283
}
284284

285-
class JsWasmStdlibSpecialCompatibilityChecksTest : LibrarySpecialCompatibilityChecksTest() {
286-
override val originalLibraryPath: String
287-
get() = System.getProperty("kotlin.js.full.stdlib.path")
288-
289-
override fun MessageCollectorImpl.hasJsOldLibraryError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
290-
val stdlibMessagePart = "Kotlin/JS standard library has an older version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
291-
val compilerMessagePart = "than the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
292-
293-
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
294-
}
295-
296-
override fun MessageCollectorImpl.hasJsTooNewLibraryError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
297-
val stdlibMessagePart =
298-
"The Kotlin/JS standard library has a more recent version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
299-
val compilerMessagePart = "The compiler version is " + specificVersions?.second?.toString().orEmpty()
300-
301-
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
302-
}
303-
304-
override fun MessageCollectorImpl.hasWasmError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
305-
val stdlibMessagePart = "The version of the Kotlin/Wasm standard library" + specificVersions?.first?.let { " ($it)" }.orEmpty()
306-
val compilerMessagePart = "differs from the version of the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
307-
308-
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
309-
}
310-
}
311-
312-
class JsWasmTestLibSpecialCompatibilityChecksTest : LibrarySpecialCompatibilityChecksTest() {
313-
override val originalLibraryPath: String
314-
get() = System.getProperty("kotlin.js.full.test.path")
315-
316-
override fun additionalLibraries(isWasm: Boolean): List<String> =
317-
if (!isWasm) listOf(System.getProperty("kotlin.js.full.stdlib.path")) else listOf(System.getProperty("kotlin.wasm.full.stdlib.path"))
318-
319-
override fun MessageCollectorImpl.hasJsOldLibraryError(
320-
specificVersions: Pair<TestVersion, TestVersion>?,
321-
): Boolean {
322-
val stdlibMessagePart = "Kotlin/JS kotlin-test library has an older version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
323-
val compilerMessagePart = "than the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
324-
325-
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
326-
}
327-
328-
override fun MessageCollectorImpl.hasJsTooNewLibraryError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
329-
val stdlibMessagePart =
330-
"The Kotlin/JS kotlin-test library has a more recent version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
331-
val compilerMessagePart = "The compiler version is " + specificVersions?.second?.toString().orEmpty()
332-
333-
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
334-
}
335-
336-
override fun MessageCollectorImpl.hasWasmError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
337-
val stdlibMessagePart =
338-
"The version of the Kotlin/Wasm kotlin-test library" + specificVersions?.first?.let { " ($it)" }.orEmpty()
339-
val compilerMessagePart = "differs from the version of the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
340-
341-
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
342-
}
343-
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
4+
*/
5+
6+
package org.jetbrains.kotlin.js.testOld.klib
7+
8+
import org.jetbrains.kotlin.cli.common.messages.MessageCollectorImpl
9+
import kotlin.collections.any
10+
11+
@Suppress("JUnitTestCaseWithNoTests")
12+
class JsWasmStdlibSpecialCompatibilityChecksTest : LibrarySpecialCompatibilityChecksTest() {
13+
override val originalLibraryPath: String
14+
get() = System.getProperty("kotlin.js.full.stdlib.path")
15+
16+
override fun MessageCollectorImpl.hasJsOldLibraryError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
17+
val stdlibMessagePart = "Kotlin/JS standard library has an older version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
18+
val compilerMessagePart = "than the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
19+
20+
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
21+
}
22+
23+
override fun MessageCollectorImpl.hasJsTooNewLibraryError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
24+
val stdlibMessagePart =
25+
"The Kotlin/JS standard library has a more recent version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
26+
val compilerMessagePart = "The compiler version is " + specificVersions?.second?.toString().orEmpty()
27+
28+
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
29+
}
30+
31+
override fun MessageCollectorImpl.hasWasmError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
32+
val stdlibMessagePart = "The version of the Kotlin/Wasm standard library" + specificVersions?.first?.let { " ($it)" }.orEmpty()
33+
val compilerMessagePart = "differs from the version of the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
34+
35+
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
36+
}
37+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
4+
*/
5+
6+
package org.jetbrains.kotlin.js.testOld.klib
7+
8+
import org.jetbrains.kotlin.cli.common.messages.MessageCollectorImpl
9+
import kotlin.collections.any
10+
11+
@Suppress("JUnitTestCaseWithNoTests")
12+
class JsWasmTestLibSpecialCompatibilityChecksTest : LibrarySpecialCompatibilityChecksTest() {
13+
override val originalLibraryPath: String
14+
get() = System.getProperty("kotlin.js.full.test.path")
15+
16+
override fun additionalLibraries(isWasm: Boolean): List<String> =
17+
if (!isWasm) listOf(System.getProperty("kotlin.js.full.stdlib.path")) else listOf(System.getProperty("kotlin.wasm.full.stdlib.path"))
18+
19+
override fun MessageCollectorImpl.hasJsOldLibraryError(
20+
specificVersions: Pair<TestVersion, TestVersion>?,
21+
): Boolean {
22+
val stdlibMessagePart = "Kotlin/JS kotlin-test library has an older version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
23+
val compilerMessagePart = "than the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
24+
25+
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
26+
}
27+
28+
override fun MessageCollectorImpl.hasJsTooNewLibraryError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
29+
val stdlibMessagePart =
30+
"The Kotlin/JS kotlin-test library has a more recent version" + specificVersions?.first?.let { " ($it)" }.orEmpty()
31+
val compilerMessagePart = "The compiler version is " + specificVersions?.second?.toString().orEmpty()
32+
33+
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
34+
}
35+
36+
override fun MessageCollectorImpl.hasWasmError(specificVersions: Pair<TestVersion, TestVersion>?): Boolean {
37+
val stdlibMessagePart =
38+
"The version of the Kotlin/Wasm kotlin-test library" + specificVersions?.first?.let { " ($it)" }.orEmpty()
39+
val compilerMessagePart = "differs from the version of the compiler" + specificVersions?.second?.let { " ($it)" }.orEmpty()
40+
41+
return messages.any { stdlibMessagePart in it.message && compilerMessagePart in it.message }
42+
}
43+
}

0 commit comments

Comments
 (0)