diff --git a/backend.native/tests/framework/gh3343/uselib.swift b/backend.native/tests/framework/gh3343/uselib.swift index 4acf47e9965..fc22748eec1 100644 --- a/backend.native/tests/framework/gh3343/uselib.swift +++ b/backend.native/tests/framework/gh3343/uselib.swift @@ -11,7 +11,7 @@ func testGh3343() throws { // -------- Execution of the test -------- -class Gh3343Tests : TestProvider { +class UselibTests : TestProvider { var tests: [TestCase] = [] init() { diff --git a/backend.native/tests/framework/main.swift b/backend.native/tests/framework/main.swift index 27cdbc4de1e..0c817fac1b7 100644 --- a/backend.native/tests/framework/main.swift +++ b/backend.native/tests/framework/main.swift @@ -132,12 +132,15 @@ private func execute(tests: [TestCase]) { * Entry point of the test */ private func main() { - // Generated method that instantiates TestProvider - registerProvider() + // Generated method that instantiates test providers. + registerProviders() let stats = Statistics.getInstance() for pr in providers { + let name = String(describing: type(of: pr)) + print("-- \(name) started") execute(tests: pr.tests) + print("-- \(name) finished") } print(stats) diff --git a/backend.native/tests/framework/multiple/multiple.swift b/backend.native/tests/framework/multiple/multiple.swift index e5604cd7cad..cf0b0e0dae3 100644 --- a/backend.native/tests/framework/multiple/multiple.swift +++ b/backend.native/tests/framework/multiple/multiple.swift @@ -50,7 +50,7 @@ func testIsolation3() throws { #endif } -class MultipleFrameworksTests : TestProvider { +class MultipleTests : TestProvider { var tests: [TestCase] = [] init() { diff --git a/backend.native/tests/framework/values_generics/values.swift b/backend.native/tests/framework/values_generics/values.swift index 0a4f67029ac..66f84f203a5 100644 --- a/backend.native/tests/framework/values_generics/values.swift +++ b/backend.native/tests/framework/values_generics/values.swift @@ -275,7 +275,7 @@ func testGenericExtensions() throws { // -------- Execution of the test -------- -class ValuesGenericsTests : TestProvider { +class ValuesTests : TestProvider { var tests: [TestCase] = [] init() { diff --git a/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt b/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt index e87ed5ed606..b1a250430df 100644 --- a/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt +++ b/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt @@ -80,13 +80,16 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { // create a test provider and get main entry point val provider = Paths.get(testOutput, testName, "provider.swift") - FileWriter(provider.toFile()).use { - it.write(""" + FileWriter(provider.toFile()).use { writer -> + val providers = swiftSources + .map { Paths.get(it).fileName.toString().removeSuffix(".swift").capitalize() } + .map { "${it}Tests" } + + writer.write(""" |// THIS IS AUTOGENERATED FILE |// This method is invoked by the main routine to get a list of tests - |func registerProvider() { - | // TODO: assuming this naming for now - | ${testName}Tests() + |func registerProviders() { + | ${providers.joinToString("\n ") { "$it()" }} |} """.trimMargin()) }