Skip to content

Commit c399785

Browse files
vsukharevSpace Team
authored andcommitted
[Tests][JS] Add splitting testrunners for stepping tests
^KT-78930
1 parent 3a3587f commit c399785

File tree

9 files changed

+1745
-15
lines changed

9 files changed

+1745
-15
lines changed

compiler/testData/debug/stepping/functionInAnotherFile.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// IGNORE_BACKEND_K2_MULTI_MODULE: ANY
22
// FILE: foo.kt
33
import bar
44
fun foo(x: Int): Int {

compiler/testData/debug/stepping/kt42208.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2-
1+
// IGNORE_BACKEND_K2_MULTI_MODULE: JS_IR
2+
// ^^^ KT-80626: Wrong source file for debuginfo in splitted stepping tests
33
// FILE: test.kt
44

55
fun box() {
@@ -21,7 +21,7 @@ inline fun foo() = {
2121

2222
// EXPECTATIONS JS_IR
2323
// test1.kt:10 box
24-
// test1.kt:8 box$lambda
24+
// test.kt:2 box$lambda
2525
// test.kt:7 box
2626

2727
// EXPECTATIONS WASM

compiler/testData/debug/stepping/kt42208b.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2-
1+
// IGNORE_BACKEND_K2_MULTI_MODULE: JS_IR
2+
// ^^^ KT-80626: Wrong source file for debuginfo in splitted stepping tests
33
// FILE: test.kt
44

55
fun box() {
@@ -24,7 +24,7 @@ inline fun foo() = {
2424
// EXPECTATIONS JS_IR
2525
// test1.kt:11 box
2626
// test.kt:7 box
27-
// test1.kt:9 box$lambda
27+
// test.kt:2 box$lambda
2828
// test.kt:8 box
2929

3030
// EXPECTATIONS WASM

compiler/testData/debug/stepping/kt42208c.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2-
1+
// IGNORE_BACKEND_K2_MULTI_MODULE: JS_IR
2+
// ^^^ KT-80626: Wrong source file for debuginfo in splitted stepping tests
33
// FILE: test.kt
44

55
fun box() {
@@ -40,12 +40,12 @@ fun baz(v:(() -> Unit)) {
4040
// test1.kt:12 box
4141
// test.kt:6 box
4242
// test3.kt:16 baz
43-
// test1.kt:10 box$lambda
43+
// test.kt:2 box$lambda
4444
// test3.kt:17 baz
4545
// test1.kt:12 box
4646
// test.kt:8 box
4747
// test3.kt:16 baz
48-
// test1.kt:10 box$lambda
48+
// test.kt:2 box$lambda
4949
// test3.kt:17 baz
5050
// test.kt:9 box
5151

compiler/testData/debug/stepping/nestedInline.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
1+
// IGNORE_BACKEND_K2_MULTI_MODULE: JS_IR
2+
// ^^^ KT-80626: Wrong source file for debuginfo in splitted stepping tests
23
// This is same as kotlin/compiler/testData/codegen/boxInline/smap/smap.kt
34
// FILE: test.kt
4-
55
import builders.*
66

77
inline fun test(): String {

js/js.tests/testFixtures/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,14 @@ fun main(args: Array<String>) {
260260
model("stepping")
261261
}
262262

263+
testClass<AbstractFirJsSteppingSplitTest> {
264+
model("stepping")
265+
}
266+
267+
testClass<AbstractFirJsSteppingSplitWithInlinedFunInKlibTest> {
268+
model("stepping")
269+
}
270+
263271
testClass<AbstractIrJsLocalVariableTest>(
264272
annotations = listOf(
265273
*legacyFrontend(),

js/js.tests/testFixtures/org/jetbrains/kotlin/js/test/fir/AbstractJsFirTest.kt

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,10 @@ open class AbstractFirJsSteppingTest(
300300
}
301301
}
302302

303-
open class AbstractFirJsSteppingWithInlinedFunInKlibTest : AbstractFirJsSteppingTest(
304-
testGroupOutputDirPrefix = "debug/firSteppingWithInlinedFunInKlib/"
303+
open class AbstractFirJsSteppingWithInlinedFunInKlibTest(
304+
testGroupOutputDirPrefix: String = "debug/firSteppingWithInlinedFunInKlib/"
305+
) : AbstractFirJsSteppingTest(
306+
testGroupOutputDirPrefix = testGroupOutputDirPrefix
305307
) {
306308
override fun configure(builder: TestConfigurationBuilder) {
307309
super.configure(builder)
@@ -316,6 +318,42 @@ open class AbstractFirJsSteppingWithInlinedFunInKlibTest : AbstractFirJsStepping
316318
}
317319
}
318320

321+
open class AbstractFirJsSteppingSplitTest : AbstractFirJsSteppingTest(
322+
testGroupOutputDirPrefix = "debug/firSteppingSplit/"
323+
) {
324+
override val additionalIgnoreDirectives: List<ValueDirective<TargetBackend>>?
325+
get() = listOf(IGNORE_BACKEND_K2_MULTI_MODULE)
326+
327+
override fun configure(builder: TestConfigurationBuilder) {
328+
super.configure(builder)
329+
with(builder) {
330+
@OptIn(TestInfrastructureInternals::class)
331+
useModuleStructureTransformers(
332+
::SplittingModuleTransformerForBoxTests
333+
)
334+
useMetaTestConfigurators(::SplittingTestConfigurator)
335+
}
336+
}
337+
}
338+
339+
open class AbstractFirJsSteppingSplitWithInlinedFunInKlibTest : AbstractFirJsSteppingWithInlinedFunInKlibTest(
340+
testGroupOutputDirPrefix = "debug/firSteppingSplit/"
341+
) {
342+
override val additionalIgnoreDirectives: List<ValueDirective<TargetBackend>>?
343+
get() = listOf(IGNORE_BACKEND_K2_MULTI_MODULE)
344+
345+
override fun configure(builder: TestConfigurationBuilder) {
346+
super.configure(builder)
347+
with(builder) {
348+
@OptIn(TestInfrastructureInternals::class)
349+
useModuleStructureTransformers(
350+
::SplittingModuleTransformerForBoxTests
351+
)
352+
useMetaTestConfigurators(::SplittingTestConfigurator)
353+
}
354+
}
355+
}
356+
319357
open class AbstractFirJsCodegenWasmJsInteropTest(
320358
testGroupOutputDirPrefix: String = "codegen/firWasmJsInteropJs/"
321359
) : AbstractFirJsTest(

0 commit comments

Comments
 (0)