[K/JS] Add ability to exclude declarations from export by a new annotation @JsExport.Ignore.

This commit is contained in:
Artem Kobzar
2022-10-03 11:07:25 +00:00
committed by Space Team
parent 917c8606f5
commit eb2326eabb
49 changed files with 970 additions and 42 deletions
-1
View File
@@ -156,7 +156,6 @@ val unzipJsShell by task<Copy> {
val testDataDir = project(":js:js.translator").projectDir.resolve("testData")
val typescriptTestsDir = testDataDir.resolve("typescript-export")
val installTsDependencies = task<NpmTask>("installTsDependencies") {
workingDir.set(testDataDir)
args.set(listOf("install"))
@@ -2118,6 +2118,24 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/export/defaultInlineClassConstructorParamInExportedFile.kt");
}
@Test
@TestMetadata("excludeMembersFromExport.kt")
public void testExcludeMembersFromExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeMembersFromExport.kt");
}
@Test
@TestMetadata("excludeTopLevelFromExport.kt")
public void testExcludeTopLevelFromExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeTopLevelFromExport.kt");
}
@Test
@TestMetadata("excludeTopLevelFromExportWithoutFileJsExport.kt")
public void testExcludeTopLevelFromExportWithoutFileJsExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeTopLevelFromExportWithoutFileJsExport.kt");
}
@Test
@TestMetadata("exportAllFile.kt")
public void testExportAllFile() throws Exception {
@@ -2590,6 +2590,24 @@ public class FirJsTestGenerated extends AbstractFirJsTest {
runTest("js/js.translator/testData/box/export/defaultInlineClassConstructorParamInExportedFile.kt");
}
@Test
@TestMetadata("excludeMembersFromExport.kt")
public void testExcludeMembersFromExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeMembersFromExport.kt");
}
@Test
@TestMetadata("excludeTopLevelFromExport.kt")
public void testExcludeTopLevelFromExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeTopLevelFromExport.kt");
}
@Test
@TestMetadata("excludeTopLevelFromExportWithoutFileJsExport.kt")
public void testExcludeTopLevelFromExportWithoutFileJsExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeTopLevelFromExportWithoutFileJsExport.kt");
}
@Test
@TestMetadata("exportAllFile.kt")
public void testExportAllFile() throws Exception {
@@ -2590,6 +2590,24 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/export/defaultInlineClassConstructorParamInExportedFile.kt");
}
@Test
@TestMetadata("excludeMembersFromExport.kt")
public void testExcludeMembersFromExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeMembersFromExport.kt");
}
@Test
@TestMetadata("excludeTopLevelFromExport.kt")
public void testExcludeTopLevelFromExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeTopLevelFromExport.kt");
}
@Test
@TestMetadata("excludeTopLevelFromExportWithoutFileJsExport.kt")
public void testExcludeTopLevelFromExportWithoutFileJsExport() throws Exception {
runTest("js/js.translator/testData/box/export/excludeTopLevelFromExportWithoutFileJsExport.kt");
}
@Test
@TestMetadata("exportAllFile.kt")
public void testExportAllFile() throws Exception {
@@ -185,6 +185,38 @@ public class IrJsTypeScriptExportTestGenerated extends AbstractIrJsTypeScriptExp
}
}
@Nested
@TestMetadata("js/js.translator/testData/typescript-export/excluded-exported-declarations")
@TestDataPath("$PROJECT_ROOT")
public class Excluded_exported_declarations {
@Test
public void testAllFilesPresentInExcluded_exported_declarations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/excluded-exported-declarations"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("excluded-exported-declarations.kt")
public void testExcluded_exported_declarations() throws Exception {
runTest("js/js.translator/testData/typescript-export/excluded-exported-declarations/excluded-exported-declarations.kt");
}
}
@Nested
@TestMetadata("js/js.translator/testData/typescript-export/excluded-exported-declarations-in-exported-file")
@TestDataPath("$PROJECT_ROOT")
public class Excluded_exported_declarations_in_exported_file {
@Test
public void testAllFilesPresentInExcluded_exported_declarations_in_exported_file() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/excluded-exported-declarations-in-exported-file"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("excluded-exported-declarations.kt")
public void testExcluded_exported_declarations() throws Exception {
runTest("js/js.translator/testData/typescript-export/excluded-exported-declarations-in-exported-file/excluded-exported-declarations.kt");
}
}
@Nested
@TestMetadata("js/js.translator/testData/typescript-export/functions")
@TestDataPath("$PROJECT_ROOT")
@@ -497,6 +529,38 @@ public class IrJsTypeScriptExportTestGenerated extends AbstractIrJsTypeScriptExp
}
}
@Nested
@TestMetadata("js/js.translator/testData/typescript-export/not-exported-declarations")
@TestDataPath("$PROJECT_ROOT")
public class Not_exported_declarations {
@Test
public void testAllFilesPresentInNot_exported_declarations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/not-exported-declarations"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("not-exported-declarations.kt")
public void testNot_exported_declarations() throws Exception {
runTest("js/js.translator/testData/typescript-export/not-exported-declarations/not-exported-declarations.kt");
}
}
@Nested
@TestMetadata("js/js.translator/testData/typescript-export/not-exported-declarations-in-exported-file")
@TestDataPath("$PROJECT_ROOT")
public class Not_exported_declarations_in_exported_file {
@Test
public void testAllFilesPresentInNot_exported_declarations_in_exported_file() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/not-exported-declarations-in-exported-file"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("not-exported-declarations.kt")
public void testNot_exported_declarations() throws Exception {
runTest("js/js.translator/testData/typescript-export/not-exported-declarations-in-exported-file/not-exported-declarations.kt");
}
}
@Nested
@TestMetadata("js/js.translator/testData/typescript-export/objects")
@TestDataPath("$PROJECT_ROOT")