[JS] Source map to IR

This commit is contained in:
Ilya Goncharov
2023-06-12 20:35:55 +02:00
committed by Space Team
parent 5783693039
commit 1465abcfed
3 changed files with 18 additions and 17 deletions
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.js.test.converters.ClassicJsBackendFacade
import org.jetbrains.kotlin.js.test.converters.incremental.RecompileModuleJsBackendFacade
import org.jetbrains.kotlin.js.test.handlers.*
import org.jetbrains.kotlin.js.test.ir.AbstractJsBlackBoxCodegenTestBase
import org.jetbrains.kotlin.js.test.ir.AbstractJsIrTest
import org.jetbrains.kotlin.js.test.utils.JsIncrementalEnvironmentConfigurator
import org.jetbrains.kotlin.test.Constructor
import org.jetbrains.kotlin.test.TargetBackend
@@ -72,21 +73,6 @@ open class AbstractBoxJsTest : AbstractJsTest(pathToTestDir = "${JsEnvironmentCo
}
}
open class AbstractSourceMapGenerationSmokeTest : AbstractJsTest(
pathToTestDir = "${JsEnvironmentConfigurator.TEST_DATA_DIR_PATH}/sourcemap/",
testGroupOutputDirPrefix = "sourcemap/"
) {
override fun configure(builder: TestConfigurationBuilder) {
super.configure(builder)
with(builder) {
defaultDirectives {
+JsEnvironmentConfigurationDirectives.GENERATE_SOURCE_MAP
-JsEnvironmentConfigurationDirectives.GENERATE_NODE_JS_RUNNER
}
}
}
}
open class AbstractOutputPrefixPostfixTest : AbstractJsTest(
pathToTestDir = "${JsEnvironmentConfigurator.TEST_DATA_DIR_PATH}/outputPrefixPostfix/",
testGroupOutputDirPrefix = "outputPrefixPostfix/"
@@ -132,6 +132,21 @@ open class AbstractJsIrLineNumberTest : AbstractJsIrTest(
}
}
open class AbstractSourceMapGenerationSmokeTest : AbstractJsIrTest(
pathToTestDir = "${JsEnvironmentConfigurator.TEST_DATA_DIR_PATH}/sourcemap/",
testGroupOutputDirPrefix = "sourcemap/"
) {
override fun configure(builder: TestConfigurationBuilder) {
super.configure(builder)
with(builder) {
defaultDirectives {
+JsEnvironmentConfigurationDirectives.GENERATE_SOURCE_MAP
-JsEnvironmentConfigurationDirectives.GENERATE_NODE_JS_RUNNER
}
}
}
}
private fun configureJsIrLineNumberTest(builder: TestConfigurationBuilder) {
with(builder) {
defaultDirectives {
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.js.test;
package org.jetbrains.kotlin.js.test.ir;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
@@ -22,7 +22,7 @@ import java.util.regex.Pattern;
public class SourceMapGenerationSmokeTestGenerated extends AbstractSourceMapGenerationSmokeTest {
@Test
public void testAllFilesPresentInSourcemap() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/sourcemap"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/sourcemap"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test