[Tests] Introduce runTest with transformer to old testing framework
This commit is contained in:
@@ -55,11 +55,12 @@ abstract class BasicWasmBoxTest(
|
||||
TODO("TestWithCoroutinesPackageReplacement are not supported")
|
||||
}
|
||||
|
||||
fun doTest(filePath: String) {
|
||||
fun doTest(filePath: String) = doTestWithTransformer(filePath) { it }
|
||||
fun doTestWithTransformer(filePath: String, transformer: java.util.function.Function<String, String>) {
|
||||
val file = File(filePath)
|
||||
|
||||
val outputDir = getOutputDir(file)
|
||||
val fileContent = KtTestUtil.doLoadFile(file)
|
||||
val fileContent = transformer.apply(KtTestUtil.doLoadFile(file))
|
||||
|
||||
TestFileFactoryImpl().use { testFactory ->
|
||||
val inputFiles: MutableList<TestFile> = TestFiles.createTestFiles(file.name, fileContent, testFactory, true)
|
||||
|
||||
+1
-1
@@ -12423,7 +12423,7 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
}
|
||||
|
||||
private void runTest(String testDataFilePath, java.util.function.Function<String, String> transformer) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath, transformer);
|
||||
KotlinTestUtils.runTest0(path -> doTestWithTransformer(path, transformer), TargetBackend.WASM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInlineClasses() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user