Add tests for element -> pseudo-value mapping

This commit is contained in:
Alexey Sedunov
2014-05-19 18:32:03 +04:00
parent d2c055e9da
commit 4a5d2e6728
78 changed files with 3105 additions and 1 deletions
@@ -0,0 +1,70 @@
/*
* Copyright 2010-2014 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.jet.cfg
import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValue
import org.jetbrains.jet.lang.cfg.pseudocode.PseudocodeImpl
import org.jetbrains.jet.lang.psi.JetElement
import org.jetbrains.jet.lang.psi.JetTreeVisitorVoid
import org.jetbrains.jet.lang.resolve.BindingContext
import java.util.*
public abstract class AbstractPseudoValueTest : AbstractPseudocodeTest() {
override fun dumpInstructions(pseudocode: PseudocodeImpl, out: StringBuilder, bindingContext: BindingContext) {
fun getElementToValueMap(pseudocode: PseudocodeImpl): Map<JetElement, PseudoValue> {
val elementToValues = LinkedHashMap<JetElement, PseudoValue>()
pseudocode.getCorrespondingElement().accept(object : JetTreeVisitorVoid() {
override fun visitJetElement(element: JetElement) {
super.visitJetElement(element)
val value = pseudocode.getElementValue(element)
if (value != null) {
elementToValues.put(element, value)
}
}
})
return elementToValues
}
fun maxLength(strings: Iterable<String>): Int = strings.map { it.length }.max() ?: 0
fun elementText(element: JetElement): String = element.getText()!!.replaceAll("\\s+", " ")
fun valueDescription(element: JetElement, value: PseudoValue): String {
return if (value.element != element) "COPY" else "NEW${value.createdAt.getInputValues().makeString(", ", "(", ")")}"
}
val elementToValues = getElementToValueMap(pseudocode)
if (elementToValues.isEmpty()) return
val elementColumnWidth = elementToValues.keySet().map { elementText(it).length() }.max()!!
val valueColumnWidth = elementToValues.values().map { it.debugName.length() }.max()!!
val valueDescColumnWidth = elementToValues.entrySet().map { valueDescription(it.key, it.value).length }.max()!!
for ((element, value) in elementToValues.entrySet()) {
out
.append("%1$-${elementColumnWidth}s".format(elementText(element)))
.append(" ")
.append("%1$-${valueColumnWidth}s".format(value.debugName))
.append(" ")
.append("%1$-${valueDescColumnWidth}s".format(valueDescription(element, value)))
.append("\n")
}
}
override fun getDataFileExtension(): String? = "values"
}
@@ -119,10 +119,14 @@ public abstract class AbstractPseudocodeTest extends KotlinTestWithEnvironment {
checkPseudocode((PseudocodeImpl) pseudocode);
}
File expectedInstructionsFile = JetTestUtils.replaceExtension(file, "instructions");
File expectedInstructionsFile = JetTestUtils.replaceExtension(file, getDataFileExtension());
JetTestUtils.assertEqualsToFile(expectedInstructionsFile, instructionDump.toString());
}
protected String getDataFileExtension() {
return "instructions";
}
protected void checkPseudocode(PseudocodeImpl pseudocode) {
}
@@ -0,0 +1,607 @@
/*
* Copyright 2010-2014 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.jet.cfg;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.io.File;
import java.util.regex.Pattern;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import org.jetbrains.jet.cfg.AbstractPseudoValueTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@InnerTestClasses({PseudoValueTestGenerated.Cfg.class, PseudoValueTestGenerated.Cfg_variables.class})
public class PseudoValueTestGenerated extends AbstractPseudoValueTest {
@TestMetadata("compiler/testData/cfg")
@InnerTestClasses({Cfg.Arrays.class, Cfg.Basic.class, Cfg.Bugs.class, Cfg.ControlStructures.class, Cfg.Conventions.class, Cfg.DeadCode.class, Cfg.Declarations.class, Cfg.Expressions.class, Cfg.TailCalls.class})
public static class Cfg extends AbstractPseudoValueTest {
public void testAllFilesPresentInCfg() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/testData/cfg/arrays")
public static class Arrays extends AbstractPseudoValueTest {
public void testAllFilesPresentInArrays() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/arrays"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("ArrayAccess.kt")
public void testArrayAccess() throws Exception {
doTest("compiler/testData/cfg/arrays/ArrayAccess.kt");
}
@TestMetadata("arrayAccessExpression.kt")
public void testArrayAccessExpression() throws Exception {
doTest("compiler/testData/cfg/arrays/arrayAccessExpression.kt");
}
@TestMetadata("arrayInc.kt")
public void testArrayInc() throws Exception {
doTest("compiler/testData/cfg/arrays/arrayInc.kt");
}
@TestMetadata("ArrayOfFunctions.kt")
public void testArrayOfFunctions() throws Exception {
doTest("compiler/testData/cfg/arrays/ArrayOfFunctions.kt");
}
@TestMetadata("arraySet.kt")
public void testArraySet() throws Exception {
doTest("compiler/testData/cfg/arrays/arraySet.kt");
}
@TestMetadata("arraySetPlusAssign.kt")
public void testArraySetPlusAssign() throws Exception {
doTest("compiler/testData/cfg/arrays/arraySetPlusAssign.kt");
}
}
@TestMetadata("compiler/testData/cfg/basic")
public static class Basic extends AbstractPseudoValueTest {
public void testAllFilesPresentInBasic() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/basic"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("Basic.kt")
public void testBasic() throws Exception {
doTest("compiler/testData/cfg/basic/Basic.kt");
}
@TestMetadata("EmptyFunction.kt")
public void testEmptyFunction() throws Exception {
doTest("compiler/testData/cfg/basic/EmptyFunction.kt");
}
@TestMetadata("ShortFunction.kt")
public void testShortFunction() throws Exception {
doTest("compiler/testData/cfg/basic/ShortFunction.kt");
}
}
@TestMetadata("compiler/testData/cfg/bugs")
public static class Bugs extends AbstractPseudoValueTest {
public void testAllFilesPresentInBugs() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/bugs"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("jumpToOuterScope.kt")
public void testJumpToOuterScope() throws Exception {
doTest("compiler/testData/cfg/bugs/jumpToOuterScope.kt");
}
}
@TestMetadata("compiler/testData/cfg/controlStructures")
public static class ControlStructures extends AbstractPseudoValueTest {
public void testAllFilesPresentInControlStructures() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/controlStructures"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("Finally.kt")
public void testFinally() throws Exception {
doTest("compiler/testData/cfg/controlStructures/Finally.kt");
}
@TestMetadata("FinallyTestCopy.kt")
public void testFinallyTestCopy() throws Exception {
doTest("compiler/testData/cfg/controlStructures/FinallyTestCopy.kt");
}
@TestMetadata("For.kt")
public void testFor() throws Exception {
doTest("compiler/testData/cfg/controlStructures/For.kt");
}
@TestMetadata("If.kt")
public void testIf() throws Exception {
doTest("compiler/testData/cfg/controlStructures/If.kt");
}
@TestMetadata("OnlyWhileInFunctionBody.kt")
public void testOnlyWhileInFunctionBody() throws Exception {
doTest("compiler/testData/cfg/controlStructures/OnlyWhileInFunctionBody.kt");
}
@TestMetadata("returnsInWhen.kt")
public void testReturnsInWhen() throws Exception {
doTest("compiler/testData/cfg/controlStructures/returnsInWhen.kt");
}
}
@TestMetadata("compiler/testData/cfg/conventions")
public static class Conventions extends AbstractPseudoValueTest {
public void testAllFilesPresentInConventions() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/conventions"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("equals.kt")
public void testEquals() throws Exception {
doTest("compiler/testData/cfg/conventions/equals.kt");
}
@TestMetadata("incrementAtTheEnd.kt")
public void testIncrementAtTheEnd() throws Exception {
doTest("compiler/testData/cfg/conventions/incrementAtTheEnd.kt");
}
@TestMetadata("invoke.kt")
public void testInvoke() throws Exception {
doTest("compiler/testData/cfg/conventions/invoke.kt");
}
@TestMetadata("notEqual.kt")
public void testNotEqual() throws Exception {
doTest("compiler/testData/cfg/conventions/notEqual.kt");
}
}
@TestMetadata("compiler/testData/cfg/deadCode")
public static class DeadCode extends AbstractPseudoValueTest {
public void testAllFilesPresentInDeadCode() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/deadCode"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("DeadCode.kt")
public void testDeadCode() throws Exception {
doTest("compiler/testData/cfg/deadCode/DeadCode.kt");
}
@TestMetadata("returnInElvis.kt")
public void testReturnInElvis() throws Exception {
doTest("compiler/testData/cfg/deadCode/returnInElvis.kt");
}
@TestMetadata("stringTemplate.kt")
public void testStringTemplate() throws Exception {
doTest("compiler/testData/cfg/deadCode/stringTemplate.kt");
}
}
@TestMetadata("compiler/testData/cfg/declarations")
@InnerTestClasses({Declarations.ClassesAndObjects.class, Declarations.FunctionLiterals.class, Declarations.Functions.class, Declarations.Local.class, Declarations.MultiDeclaration.class, Declarations.Properties.class})
public static class Declarations extends AbstractPseudoValueTest {
public void testAllFilesPresentInDeclarations() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/declarations"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/testData/cfg/declarations/classesAndObjects")
public static class ClassesAndObjects extends AbstractPseudoValueTest {
public void testAllFilesPresentInClassesAndObjects() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/declarations/classesAndObjects"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("AnonymousInitializers.kt")
public void testAnonymousInitializers() throws Exception {
doTest("compiler/testData/cfg/declarations/classesAndObjects/AnonymousInitializers.kt");
}
}
@TestMetadata("compiler/testData/cfg/declarations/functionLiterals")
public static class FunctionLiterals extends AbstractPseudoValueTest {
public void testAllFilesPresentInFunctionLiterals() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/declarations/functionLiterals"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("unusedFunctionLiteral.kt")
public void testUnusedFunctionLiteral() throws Exception {
doTest("compiler/testData/cfg/declarations/functionLiterals/unusedFunctionLiteral.kt");
}
}
@TestMetadata("compiler/testData/cfg/declarations/functions")
public static class Functions extends AbstractPseudoValueTest {
public void testAllFilesPresentInFunctions() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/declarations/functions"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("FailFunction.kt")
public void testFailFunction() throws Exception {
doTest("compiler/testData/cfg/declarations/functions/FailFunction.kt");
}
@TestMetadata("typeParameter.kt")
public void testTypeParameter() throws Exception {
doTest("compiler/testData/cfg/declarations/functions/typeParameter.kt");
}
}
@TestMetadata("compiler/testData/cfg/declarations/local")
public static class Local extends AbstractPseudoValueTest {
public void testAllFilesPresentInLocal() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/declarations/local"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("localClass.kt")
public void testLocalClass() throws Exception {
doTest("compiler/testData/cfg/declarations/local/localClass.kt");
}
@TestMetadata("LocalDeclarations.kt")
public void testLocalDeclarations() throws Exception {
doTest("compiler/testData/cfg/declarations/local/LocalDeclarations.kt");
}
@TestMetadata("localProperty.kt")
public void testLocalProperty() throws Exception {
doTest("compiler/testData/cfg/declarations/local/localProperty.kt");
}
@TestMetadata("ObjectExpression.kt")
public void testObjectExpression() throws Exception {
doTest("compiler/testData/cfg/declarations/local/ObjectExpression.kt");
}
}
@TestMetadata("compiler/testData/cfg/declarations/multiDeclaration")
public static class MultiDeclaration extends AbstractPseudoValueTest {
public void testAllFilesPresentInMultiDeclaration() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/declarations/multiDeclaration"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("MultiDecl.kt")
public void testMultiDecl() throws Exception {
doTest("compiler/testData/cfg/declarations/multiDeclaration/MultiDecl.kt");
}
@TestMetadata("multiDeclarationWithError.kt")
public void testMultiDeclarationWithError() throws Exception {
doTest("compiler/testData/cfg/declarations/multiDeclaration/multiDeclarationWithError.kt");
}
}
@TestMetadata("compiler/testData/cfg/declarations/properties")
public static class Properties extends AbstractPseudoValueTest {
public void testAllFilesPresentInProperties() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/declarations/properties"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("backingFieldAccess.kt")
public void testBackingFieldAccess() throws Exception {
doTest("compiler/testData/cfg/declarations/properties/backingFieldAccess.kt");
}
@TestMetadata("backingFieldQualifiedWithThis.kt")
public void testBackingFieldQualifiedWithThis() throws Exception {
doTest("compiler/testData/cfg/declarations/properties/backingFieldQualifiedWithThis.kt");
}
@TestMetadata("DelegatedProperty.kt")
public void testDelegatedProperty() throws Exception {
doTest("compiler/testData/cfg/declarations/properties/DelegatedProperty.kt");
}
}
public static Test innerSuite() {
TestSuite suite = new TestSuite("Declarations");
suite.addTestSuite(Declarations.class);
suite.addTestSuite(ClassesAndObjects.class);
suite.addTestSuite(FunctionLiterals.class);
suite.addTestSuite(Functions.class);
suite.addTestSuite(Local.class);
suite.addTestSuite(MultiDeclaration.class);
suite.addTestSuite(Properties.class);
return suite;
}
}
@TestMetadata("compiler/testData/cfg/expressions")
public static class Expressions extends AbstractPseudoValueTest {
public void testAllFilesPresentInExpressions() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/expressions"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("assignmentToThis.kt")
public void testAssignmentToThis() throws Exception {
doTest("compiler/testData/cfg/expressions/assignmentToThis.kt");
}
@TestMetadata("Assignments.kt")
public void testAssignments() throws Exception {
doTest("compiler/testData/cfg/expressions/Assignments.kt");
}
@TestMetadata("chainedQualifiedExpression.kt")
public void testChainedQualifiedExpression() throws Exception {
doTest("compiler/testData/cfg/expressions/chainedQualifiedExpression.kt");
}
@TestMetadata("expressionAsFunction.kt")
public void testExpressionAsFunction() throws Exception {
doTest("compiler/testData/cfg/expressions/expressionAsFunction.kt");
}
@TestMetadata("LazyBooleans.kt")
public void testLazyBooleans() throws Exception {
doTest("compiler/testData/cfg/expressions/LazyBooleans.kt");
}
@TestMetadata("nothingExpr.kt")
public void testNothingExpr() throws Exception {
doTest("compiler/testData/cfg/expressions/nothingExpr.kt");
}
@TestMetadata("propertySafeCall.kt")
public void testPropertySafeCall() throws Exception {
doTest("compiler/testData/cfg/expressions/propertySafeCall.kt");
}
@TestMetadata("qualifiedExpressionWithoutSelector.kt")
public void testQualifiedExpressionWithoutSelector() throws Exception {
doTest("compiler/testData/cfg/expressions/qualifiedExpressionWithoutSelector.kt");
}
@TestMetadata("ReturnFromExpression.kt")
public void testReturnFromExpression() throws Exception {
doTest("compiler/testData/cfg/expressions/ReturnFromExpression.kt");
}
@TestMetadata("thisExpression.kt")
public void testThisExpression() throws Exception {
doTest("compiler/testData/cfg/expressions/thisExpression.kt");
}
@TestMetadata("unresolvedCall.kt")
public void testUnresolvedCall() throws Exception {
doTest("compiler/testData/cfg/expressions/unresolvedCall.kt");
}
@TestMetadata("unresolvedProperty.kt")
public void testUnresolvedProperty() throws Exception {
doTest("compiler/testData/cfg/expressions/unresolvedProperty.kt");
}
@TestMetadata("unusedExpressionSimpleName.kt")
public void testUnusedExpressionSimpleName() throws Exception {
doTest("compiler/testData/cfg/expressions/unusedExpressionSimpleName.kt");
}
}
@TestMetadata("compiler/testData/cfg/tailCalls")
public static class TailCalls extends AbstractPseudoValueTest {
public void testAllFilesPresentInTailCalls() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg/tailCalls"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("finally.kt")
public void testFinally() throws Exception {
doTest("compiler/testData/cfg/tailCalls/finally.kt");
}
@TestMetadata("finallyWithReturn.kt")
public void testFinallyWithReturn() throws Exception {
doTest("compiler/testData/cfg/tailCalls/finallyWithReturn.kt");
}
@TestMetadata("sum.kt")
public void testSum() throws Exception {
doTest("compiler/testData/cfg/tailCalls/sum.kt");
}
@TestMetadata("try.kt")
public void testTry() throws Exception {
doTest("compiler/testData/cfg/tailCalls/try.kt");
}
@TestMetadata("tryCatchFinally.kt")
public void testTryCatchFinally() throws Exception {
doTest("compiler/testData/cfg/tailCalls/tryCatchFinally.kt");
}
}
public static Test innerSuite() {
TestSuite suite = new TestSuite("Cfg");
suite.addTestSuite(Cfg.class);
suite.addTestSuite(Arrays.class);
suite.addTestSuite(Basic.class);
suite.addTestSuite(Bugs.class);
suite.addTestSuite(ControlStructures.class);
suite.addTestSuite(Conventions.class);
suite.addTestSuite(DeadCode.class);
suite.addTest(Declarations.innerSuite());
suite.addTestSuite(Expressions.class);
suite.addTestSuite(TailCalls.class);
return suite;
}
}
@TestMetadata("compiler/testData/cfg-variables")
@InnerTestClasses({Cfg_variables.Basic.class, Cfg_variables.Bugs.class, Cfg_variables.LexicalScopes.class})
public static class Cfg_variables extends AbstractPseudoValueTest {
public void testAllFilesPresentInCfg_variables() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg-variables"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/testData/cfg-variables/basic")
public static class Basic extends AbstractPseudoValueTest {
public void testAllFilesPresentInBasic() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg-variables/basic"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("IfWithUninitialized.kt")
public void testIfWithUninitialized() throws Exception {
doTest("compiler/testData/cfg-variables/basic/IfWithUninitialized.kt");
}
@TestMetadata("InitializedNotDeclared.kt")
public void testInitializedNotDeclared() throws Exception {
doTest("compiler/testData/cfg-variables/basic/InitializedNotDeclared.kt");
}
@TestMetadata("UsageInFunctionLiteral.kt")
public void testUsageInFunctionLiteral() throws Exception {
doTest("compiler/testData/cfg-variables/basic/UsageInFunctionLiteral.kt");
}
@TestMetadata("VariablesInitialization.kt")
public void testVariablesInitialization() throws Exception {
doTest("compiler/testData/cfg-variables/basic/VariablesInitialization.kt");
}
@TestMetadata("VariablesUsage.kt")
public void testVariablesUsage() throws Exception {
doTest("compiler/testData/cfg-variables/basic/VariablesUsage.kt");
}
}
@TestMetadata("compiler/testData/cfg-variables/bugs")
public static class Bugs extends AbstractPseudoValueTest {
public void testAllFilesPresentInBugs() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg-variables/bugs"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("referenceToPropertyInitializer.kt")
public void testReferenceToPropertyInitializer() throws Exception {
doTest("compiler/testData/cfg-variables/bugs/referenceToPropertyInitializer.kt");
}
@TestMetadata("varInitializationInIf.kt")
public void testVarInitializationInIf() throws Exception {
doTest("compiler/testData/cfg-variables/bugs/varInitializationInIf.kt");
}
@TestMetadata("varInitializationInIfInCycle.kt")
public void testVarInitializationInIfInCycle() throws Exception {
doTest("compiler/testData/cfg-variables/bugs/varInitializationInIfInCycle.kt");
}
}
@TestMetadata("compiler/testData/cfg-variables/lexicalScopes")
public static class LexicalScopes extends AbstractPseudoValueTest {
public void testAllFilesPresentInLexicalScopes() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cfg-variables/lexicalScopes"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("doWhileScope.kt")
public void testDoWhileScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/doWhileScope.kt");
}
@TestMetadata("forScope.kt")
public void testForScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/forScope.kt");
}
@TestMetadata("functionLiteralScope.kt")
public void testFunctionLiteralScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/functionLiteralScope.kt");
}
@TestMetadata("ifScope.kt")
public void testIfScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/ifScope.kt");
}
@TestMetadata("localClass.kt")
public void testLocalClass() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/localClass.kt");
}
@TestMetadata("localFunctionScope.kt")
public void testLocalFunctionScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/localFunctionScope.kt");
}
@TestMetadata("localFunctionScopeWithoutBody.kt")
public void testLocalFunctionScopeWithoutBody() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/localFunctionScopeWithoutBody.kt");
}
@TestMetadata("localObject.kt")
public void testLocalObject() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/localObject.kt");
}
@TestMetadata("objectLiteralScope.kt")
public void testObjectLiteralScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/objectLiteralScope.kt");
}
@TestMetadata("propertyAccessorScope.kt")
public void testPropertyAccessorScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/propertyAccessorScope.kt");
}
@TestMetadata("tryScope.kt")
public void testTryScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/tryScope.kt");
}
@TestMetadata("whileScope.kt")
public void testWhileScope() throws Exception {
doTest("compiler/testData/cfg-variables/lexicalScopes/whileScope.kt");
}
}
public static Test innerSuite() {
TestSuite suite = new TestSuite("Cfg_variables");
suite.addTestSuite(Cfg_variables.class);
suite.addTestSuite(Basic.class);
suite.addTestSuite(Bugs.class);
suite.addTestSuite(LexicalScopes.class);
return suite;
}
}
public static Test suite() {
TestSuite suite = new TestSuite("PseudoValueTestGenerated");
suite.addTest(Cfg.innerSuite());
suite.addTest(Cfg_variables.innerSuite());
return suite;
}
}