diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 7ef47f29280..9f93a1b74c9 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -834,6 +834,10 @@ fun main(args: Array) { testClass(javaClass()) { model("jsCode/cases") } + + testClass(javaClass()) { + model("inlineSizeReduction/cases") + } } testGroup("js/js.tests/test", "compiler/testData") { diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractInlineSizeReductionTest.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractInlineSizeReductionTest.java new file mode 100644 index 00000000000..a94689cc16f --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/AbstractInlineSizeReductionTest.java @@ -0,0 +1,25 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.js.test.semantics; + +import org.jetbrains.kotlin.js.test.AbstractSingleFileTranslationWithDirectivesTest; + +public abstract class AbstractInlineSizeReductionTest extends AbstractSingleFileTranslationWithDirectivesTest { + public AbstractInlineSizeReductionTest() { + super("inlineSizeReduction/"); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineJsTestGenerated.java index b4f4ba465f4..3c6b8216c95 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineJsTestGenerated.java @@ -281,12 +281,6 @@ public class InlineJsTestGenerated extends AbstractInlineJsTest { doTest(fileName); } - @TestMetadata("noAdditionalVarsCreated.kt") - public void testNoAdditionalVarsCreated() throws Exception { - String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/noAdditionalVarsCreated.kt"); - doTest(fileName); - } - @TestMetadata("noInlineLambda.kt") public void testNoInlineLambda() throws Exception { String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inline/cases/noInlineLambda.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineNoAdditionalVarsCreatedTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineNoAdditionalVarsCreatedTestGenerated.java new file mode 100644 index 00000000000..12ec285b073 --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineNoAdditionalVarsCreatedTestGenerated.java @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.js.test.semantics; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.JetTestUtils; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("js/js.translator/testData/inlineNoAdditionalVarsCreated/cases") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class InlineNoAdditionalVarsCreatedTestGenerated extends AbstractInlineNoAdditionalVarsCreatedTest { + public void testAllFilesPresentInCases() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/inlineNoAdditionalVarsCreated/cases"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("simpleReturnFunction.kt") + public void testSimpleReturnFunction() throws Exception { + String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/inlineNoAdditionalVarsCreated/cases/simpleReturnFunction.kt"); + doTest(fileName); + } +} diff --git a/js/js.translator/testData/inline/cases/noAdditionalVarsCreated.kt b/js/js.translator/testData/inlineSizeReduction/cases/simpleReturnFunction.kt similarity index 90% rename from js/js.translator/testData/inline/cases/noAdditionalVarsCreated.kt rename to js/js.translator/testData/inlineSizeReduction/cases/simpleReturnFunction.kt index c2f00bceed5..6addcd524bd 100644 --- a/js/js.translator/testData/inline/cases/noAdditionalVarsCreated.kt +++ b/js/js.translator/testData/inlineSizeReduction/cases/simpleReturnFunction.kt @@ -1,7 +1,7 @@ package foo // CHECK_CONTAINS_NO_CALLS: test -// COUNT_VARS: function=test count=0 +// CHECK_VARS_COUNT: function=test count=0 // A copy of stdlib run function. // Copied to not to depend on run implementation.