Moved current incremental compiler test data into subdirectory.

Tweaked test generator to avoid creating test methods for parent directory of tests.
This commit is contained in:
Evgeny Gerashchenko
2014-07-08 18:22:50 +04:00
parent 829c25bcf9
commit 479711e812
166 changed files with 224 additions and 181 deletions
@@ -597,7 +597,7 @@ fun main(args: Array<String>) {
testGroup("jps-plugin/test", "jps-plugin/testData") {
testClass(javaClass<AbstractIncrementalJpsTest>()) {
model("incremental", extension = null, recursive = false)
model("incremental", extension = null, excludeParentDirs = true)
}
}
}
@@ -628,6 +628,7 @@ private class TestGroup(val testsRoot: String, val testDataRoot: String) {
fun model(
relativeRootPath: String,
recursive: Boolean = true,
excludeParentDirs: Boolean = false,
extension: String? = "kt", // null string means dir (name without dot)
pattern: String = if (extension == null) """^([^\.]+)$""" else "^(.+)\\.$extension\$",
testMethod: String = "doTest",
@@ -640,7 +641,7 @@ private class TestGroup(val testsRoot: String, val testDataRoot: String) {
testModels.add(if (singleClass)
SingleClassTestModel(rootFile, compiledPattern, testMethod, className)
else
SimpleTestClassModel(rootFile, recursive, compiledPattern, testMethod, className))
SimpleTestClassModel(rootFile, recursive, excludeParentDirs, compiledPattern, testMethod, className))
}
}
@@ -40,6 +40,7 @@ public class SimpleTestClassModel implements TestClassModel {
};
private final File rootFile;
private final boolean recursive;
private final boolean excludeParentDirs;
private final Pattern filenamePattern;
private final String doTestMethodName;
private final String testClassName;
@@ -50,12 +51,14 @@ public class SimpleTestClassModel implements TestClassModel {
public SimpleTestClassModel(
@NotNull File rootFile,
boolean recursive,
boolean excludeParentDirs,
@NotNull Pattern filenamePattern,
@NotNull String doTestMethodName,
@NotNull String testClassName
) {
this.rootFile = rootFile;
this.recursive = recursive;
this.excludeParentDirs = excludeParentDirs;
this.filenamePattern = filenamePattern;
this.doTestMethodName = doTestMethodName;
this.testClassName = testClassName;
@@ -76,7 +79,7 @@ public class SimpleTestClassModel implements TestClassModel {
if (file.isDirectory()) {
if (dirHasFilesInside(file)) {
String innerTestClassName = TestGeneratorUtil.fileNameToJavaIdentifier(file);
children.add(new SimpleTestClassModel(file, true, filenamePattern, doTestMethodName, innerTestClassName));
children.add(new SimpleTestClassModel(file, true, excludeParentDirs, filenamePattern, doTestMethodName, innerTestClassName));
}
}
}
@@ -96,6 +99,19 @@ public class SimpleTestClassModel implements TestClassModel {
});
}
private static boolean dirHasSubDirs(@NotNull File dir) {
File[] listFiles = dir.listFiles();
if (listFiles == null) {
return false;
}
for (File file : listFiles) {
if (file.isDirectory()) {
return true;
}
}
return false;
}
@NotNull
@Override
public Collection<TestMethodModel> getTestMethods() {
@@ -112,6 +128,11 @@ public class SimpleTestClassModel implements TestClassModel {
if (listFiles != null) {
for (File file : listFiles) {
if (filenamePattern.matcher(file.getName()).matches()) {
if (file.isDirectory() && excludeParentDirs && dirHasSubDirs(file)) {
continue;
}
result.add(new SimpleTestMethodModel(rootFile, file, doTestMethodName, filenamePattern));
}
}
@@ -31,189 +31,210 @@ import org.jetbrains.jet.jps.build.AbstractIncrementalJpsTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("jps-plugin/testData/incremental")
@InnerTestClasses({IncrementalJpsTestGenerated.PureKotlin.class})
public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
@TestMetadata("accessingFunctionsViaPackagePart")
public void testAccessingFunctionsViaPackagePart() throws Exception {
doTest("jps-plugin/testData/incremental/accessingFunctionsViaPackagePart/");
}
@TestMetadata("accessingPropertiesViaField")
public void testAccessingPropertiesViaField() throws Exception {
doTest("jps-plugin/testData/incremental/accessingPropertiesViaField/");
}
@TestMetadata("allConstants")
public void testAllConstants() throws Exception {
doTest("jps-plugin/testData/incremental/allConstants/");
}
public void testAllFilesPresentInIncremental() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("jps-plugin/testData/incremental"), Pattern.compile("^([^\\.]+)$"), false);
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("jps-plugin/testData/incremental"), Pattern.compile("^([^\\.]+)$"), true);
}
@TestMetadata("annotations")
public void testAnnotations() throws Exception {
doTest("jps-plugin/testData/incremental/annotations/");
@TestMetadata("jps-plugin/testData/incremental/pureKotlin")
@InnerTestClasses({})
public static class PureKotlin extends AbstractIncrementalJpsTest {
@TestMetadata("accessingFunctionsViaPackagePart")
public void testAccessingFunctionsViaPackagePart() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/accessingFunctionsViaPackagePart/");
}
@TestMetadata("accessingPropertiesViaField")
public void testAccessingPropertiesViaField() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/accessingPropertiesViaField/");
}
@TestMetadata("allConstants")
public void testAllConstants() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/allConstants/");
}
public void testAllFilesPresentInPureKotlin() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), true);
}
@TestMetadata("annotations")
public void testAnnotations() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/annotations/");
}
@TestMetadata("classInlineFunctionChanged")
public void testClassInlineFunctionChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/classInlineFunctionChanged/");
}
@TestMetadata("classObjectConstantChanged")
public void testClassObjectConstantChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/classObjectConstantChanged/");
}
@TestMetadata("classRecreated")
public void testClassRecreated() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/classRecreated/");
}
@TestMetadata("classSignatureChanged")
public void testClassSignatureChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/classSignatureChanged/");
}
@TestMetadata("classSignatureUnchanged")
public void testClassSignatureUnchanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/classSignatureUnchanged/");
}
@TestMetadata("constantsUnchanged")
public void testConstantsUnchanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/constantsUnchanged/");
}
@TestMetadata("dependencyClassReferenced")
public void testDependencyClassReferenced() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/dependencyClassReferenced/");
}
@TestMetadata("filesExchangePackages")
public void testFilesExchangePackages() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/filesExchangePackages/");
}
@TestMetadata("independentClasses")
public void testIndependentClasses() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/independentClasses/");
}
@TestMetadata("inlineFunctionsCircularDependency")
public void testInlineFunctionsCircularDependency() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/inlineFunctionsCircularDependency/");
}
@TestMetadata("inlineFunctionsUnchanged")
public void testInlineFunctionsUnchanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/inlineFunctionsUnchanged/");
}
@TestMetadata("multiplePackagesModified")
public void testMultiplePackagesModified() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/multiplePackagesModified/");
}
@TestMetadata("objectValChanged")
public void testObjectValChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/objectValChanged/");
}
@TestMetadata("ourClassReferenced")
public void testOurClassReferenced() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/ourClassReferenced/");
}
@TestMetadata("packageConstantChanged")
public void testPackageConstantChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageConstantChanged/");
}
@TestMetadata("packageFileAdded")
public void testPackageFileAdded() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageFileAdded/");
}
@TestMetadata("packageFileChangedPackage")
public void testPackageFileChangedPackage() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageFileChangedPackage/");
}
@TestMetadata("packageFileChangedThenOtherRemoved")
public void testPackageFileChangedThenOtherRemoved() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageFileChangedThenOtherRemoved/");
}
@TestMetadata("packageFileRemoved")
public void testPackageFileRemoved() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageFileRemoved/");
}
@TestMetadata("packageFilesChangedInTurn")
public void testPackageFilesChangedInTurn() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageFilesChangedInTurn/");
}
@TestMetadata("packageInlineFunctionAccessingField")
public void testPackageInlineFunctionAccessingField() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageInlineFunctionAccessingField/");
}
@TestMetadata("packageInlineFunctionChanged")
public void testPackageInlineFunctionChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageInlineFunctionChanged/");
}
@TestMetadata("packageInlineFunctionFromOurPackage")
public void testPackageInlineFunctionFromOurPackage() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageInlineFunctionFromOurPackage/");
}
@TestMetadata("packageRecreated")
public void testPackageRecreated() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageRecreated/");
}
@TestMetadata("packageRecreatedAfterRenaming")
public void testPackageRecreatedAfterRenaming() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageRecreatedAfterRenaming/");
}
@TestMetadata("packageRemoved")
public void testPackageRemoved() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("returnTypeChanged")
public void testReturnTypeChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/returnTypeChanged/");
}
@TestMetadata("simpleClassDependency")
public void testSimpleClassDependency() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/simpleClassDependency/");
}
@TestMetadata("soleFileChangesPackage")
public void testSoleFileChangesPackage() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/soleFileChangesPackage/");
}
@TestMetadata("topLevelFunctionSameSignature")
public void testTopLevelFunctionSameSignature() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/topLevelFunctionSameSignature/");
}
@TestMetadata("topLevelMembersInTwoFiles")
public void testTopLevelMembersInTwoFiles() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/topLevelMembersInTwoFiles/");
}
@TestMetadata("traitClassObjectConstantChanged")
public void testTraitClassObjectConstantChanged() throws Exception {
doTest("jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/");
}
public static Test innerSuite() {
TestSuite suite = new TestSuite("PureKotlin");
suite.addTestSuite(PureKotlin.class);
return suite;
}
}
@TestMetadata("classInlineFunctionChanged")
public void testClassInlineFunctionChanged() throws Exception {
doTest("jps-plugin/testData/incremental/classInlineFunctionChanged/");
public static Test suite() {
TestSuite suite = new TestSuite("IncrementalJpsTestGenerated");
suite.addTestSuite(IncrementalJpsTestGenerated.class);
suite.addTest(PureKotlin.innerSuite());
return suite;
}
@TestMetadata("classObjectConstantChanged")
public void testClassObjectConstantChanged() throws Exception {
doTest("jps-plugin/testData/incremental/classObjectConstantChanged/");
}
@TestMetadata("classRecreated")
public void testClassRecreated() throws Exception {
doTest("jps-plugin/testData/incremental/classRecreated/");
}
@TestMetadata("classSignatureChanged")
public void testClassSignatureChanged() throws Exception {
doTest("jps-plugin/testData/incremental/classSignatureChanged/");
}
@TestMetadata("classSignatureUnchanged")
public void testClassSignatureUnchanged() throws Exception {
doTest("jps-plugin/testData/incremental/classSignatureUnchanged/");
}
@TestMetadata("constantsUnchanged")
public void testConstantsUnchanged() throws Exception {
doTest("jps-plugin/testData/incremental/constantsUnchanged/");
}
@TestMetadata("dependencyClassReferenced")
public void testDependencyClassReferenced() throws Exception {
doTest("jps-plugin/testData/incremental/dependencyClassReferenced/");
}
@TestMetadata("filesExchangePackages")
public void testFilesExchangePackages() throws Exception {
doTest("jps-plugin/testData/incremental/filesExchangePackages/");
}
@TestMetadata("independentClasses")
public void testIndependentClasses() throws Exception {
doTest("jps-plugin/testData/incremental/independentClasses/");
}
@TestMetadata("inlineFunctionsCircularDependency")
public void testInlineFunctionsCircularDependency() throws Exception {
doTest("jps-plugin/testData/incremental/inlineFunctionsCircularDependency/");
}
@TestMetadata("inlineFunctionsUnchanged")
public void testInlineFunctionsUnchanged() throws Exception {
doTest("jps-plugin/testData/incremental/inlineFunctionsUnchanged/");
}
@TestMetadata("multiplePackagesModified")
public void testMultiplePackagesModified() throws Exception {
doTest("jps-plugin/testData/incremental/multiplePackagesModified/");
}
@TestMetadata("objectValChanged")
public void testObjectValChanged() throws Exception {
doTest("jps-plugin/testData/incremental/objectValChanged/");
}
@TestMetadata("ourClassReferenced")
public void testOurClassReferenced() throws Exception {
doTest("jps-plugin/testData/incremental/ourClassReferenced/");
}
@TestMetadata("packageConstantChanged")
public void testPackageConstantChanged() throws Exception {
doTest("jps-plugin/testData/incremental/packageConstantChanged/");
}
@TestMetadata("packageFileAdded")
public void testPackageFileAdded() throws Exception {
doTest("jps-plugin/testData/incremental/packageFileAdded/");
}
@TestMetadata("packageFileChangedPackage")
public void testPackageFileChangedPackage() throws Exception {
doTest("jps-plugin/testData/incremental/packageFileChangedPackage/");
}
@TestMetadata("packageFileChangedThenOtherRemoved")
public void testPackageFileChangedThenOtherRemoved() throws Exception {
doTest("jps-plugin/testData/incremental/packageFileChangedThenOtherRemoved/");
}
@TestMetadata("packageFileRemoved")
public void testPackageFileRemoved() throws Exception {
doTest("jps-plugin/testData/incremental/packageFileRemoved/");
}
@TestMetadata("packageFilesChangedInTurn")
public void testPackageFilesChangedInTurn() throws Exception {
doTest("jps-plugin/testData/incremental/packageFilesChangedInTurn/");
}
@TestMetadata("packageInlineFunctionAccessingField")
public void testPackageInlineFunctionAccessingField() throws Exception {
doTest("jps-plugin/testData/incremental/packageInlineFunctionAccessingField/");
}
@TestMetadata("packageInlineFunctionChanged")
public void testPackageInlineFunctionChanged() throws Exception {
doTest("jps-plugin/testData/incremental/packageInlineFunctionChanged/");
}
@TestMetadata("packageInlineFunctionFromOurPackage")
public void testPackageInlineFunctionFromOurPackage() throws Exception {
doTest("jps-plugin/testData/incremental/packageInlineFunctionFromOurPackage/");
}
@TestMetadata("packageRecreated")
public void testPackageRecreated() throws Exception {
doTest("jps-plugin/testData/incremental/packageRecreated/");
}
@TestMetadata("packageRecreatedAfterRenaming")
public void testPackageRecreatedAfterRenaming() throws Exception {
doTest("jps-plugin/testData/incremental/packageRecreatedAfterRenaming/");
}
@TestMetadata("packageRemoved")
public void testPackageRemoved() throws Exception {
doTest("jps-plugin/testData/incremental/packageRemoved/");
}
@TestMetadata("returnTypeChanged")
public void testReturnTypeChanged() throws Exception {
doTest("jps-plugin/testData/incremental/returnTypeChanged/");
}
@TestMetadata("simpleClassDependency")
public void testSimpleClassDependency() throws Exception {
doTest("jps-plugin/testData/incremental/simpleClassDependency/");
}
@TestMetadata("soleFileChangesPackage")
public void testSoleFileChangesPackage() throws Exception {
doTest("jps-plugin/testData/incremental/soleFileChangesPackage/");
}
@TestMetadata("topLevelFunctionSameSignature")
public void testTopLevelFunctionSameSignature() throws Exception {
doTest("jps-plugin/testData/incremental/topLevelFunctionSameSignature/");
}
@TestMetadata("topLevelMembersInTwoFiles")
public void testTopLevelMembersInTwoFiles() throws Exception {
doTest("jps-plugin/testData/incremental/topLevelMembersInTwoFiles/");
}
@TestMetadata("traitClassObjectConstantChanged")
public void testTraitClassObjectConstantChanged() throws Exception {
doTest("jps-plugin/testData/incremental/traitClassObjectConstantChanged/");
}
}

Some files were not shown because too many files have changed in this diff Show More