Android: add special files compiled with external annotations

This commit is contained in:
Natalia.Ukhorskaya
2012-08-29 18:22:53 +04:00
parent 19221e3ba6
commit c8af013a5a
2 changed files with 17 additions and 2 deletions
@@ -55,6 +55,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
private final String generatorName = "CodegenTestsOnAndroidGenerator"; private final String generatorName = "CodegenTestsOnAndroidGenerator";
private JetCoreEnvironment environmentWithMockJdk = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY); private JetCoreEnvironment environmentWithMockJdk = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
private JetCoreEnvironment environmentWithMockJdkAndExternalAnnotations = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_AND_ANNOTATIONS);
private JetCoreEnvironment environmentWithFullJdk = JetTestUtils.createEnvironmentWithFullJdk(myTestRootDisposable); private JetCoreEnvironment environmentWithFullJdk = JetTestUtils.createEnvironmentWithFullJdk(myTestRootDisposable);
private JetCoreEnvironment environmentWithFullJdkAndJUnit; private JetCoreEnvironment environmentWithFullJdkAndJUnit;
@@ -135,6 +136,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
Set<String> excludedFiles = SpecialFiles.getExcludedFiles(); Set<String> excludedFiles = SpecialFiles.getExcludedFiles();
Set<String> filesCompiledWithoutStdLib = SpecialFiles.getFilesCompiledWithoutStdLib(); Set<String> filesCompiledWithoutStdLib = SpecialFiles.getFilesCompiledWithoutStdLib();
Set<String> filesCompiledWithJUnit = SpecialFiles.getFilesCompiledWithJUnit(); Set<String> filesCompiledWithJUnit = SpecialFiles.getFilesCompiledWithJUnit();
Set<String> filesCompiledWithExternalAnnotations = SpecialFiles.getFilesCompiledWithExternalAnnotations();
for (File file : files) { for (File file : files) {
if (excludedFiles.contains(file.getName())) { if (excludedFiles.contains(file.getName())) {
continue; continue;
@@ -156,6 +158,9 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
else if (filesCompiledWithJUnit.contains(file.getName())) { else if (filesCompiledWithJUnit.contains(file.getName())) {
factory = getFactoryFromText(file.getAbsolutePath(), text, environmentWithFullJdkAndJUnit); factory = getFactoryFromText(file.getAbsolutePath(), text, environmentWithFullJdkAndJUnit);
} }
else if (filesCompiledWithExternalAnnotations.contains(file.getName())) {
factory = getFactoryFromText(file.getAbsolutePath(), text, environmentWithMockJdkAndExternalAnnotations);
}
else { else {
factory = getFactoryFromText(file.getAbsolutePath(), text, environmentWithFullJdk); factory = getFactoryFromText(file.getAbsolutePath(), text, environmentWithFullJdk);
} }
@@ -31,11 +31,18 @@ public class SpecialFiles {
private static final Set<String> excludedFiles = Sets.newHashSet(); private static final Set<String> excludedFiles = Sets.newHashSet();
private static final Set<String> filesCompiledWithoutStdLib = Sets.newHashSet(); private static final Set<String> filesCompiledWithoutStdLib = Sets.newHashSet();
private static final Set<String> filesCompiledWithJUnit = Sets.newHashSet(); private static final Set<String> filesCompiledWithJUnit = Sets.newHashSet();
private static final Set<String> filesCompiledWithExternalAnnotations = Sets.newHashSet();
static { static {
fillExcludedFiles(); fillExcludedFiles();
fillFilesCompiledWithoutStdLib(); fillFilesCompiledWithoutStdLib();
fillFilesCompiledWithJUnit(); fillFilesCompiledWithJUnit();
fillFilesCompiledWithExternalAnnotations();
}
public static Set<String> getFilesCompiledWithExternalAnnotations() {
return filesCompiledWithExternalAnnotations;
} }
public static Set<String> getFilesCompiledWithJUnit() { public static Set<String> getFilesCompiledWithJUnit() {
@@ -49,15 +56,18 @@ public class SpecialFiles {
public static Set<String> getFilesCompiledWithoutStdLib() { public static Set<String> getFilesCompiledWithoutStdLib() {
return filesCompiledWithoutStdLib; return filesCompiledWithoutStdLib;
} }
private static void fillFilesCompiledWithJUnit() { private static void fillFilesCompiledWithJUnit() {
filesCompiledWithJUnit.add("kt2334.kt"); filesCompiledWithJUnit.add("kt2334.kt");
} }
private static void fillFilesCompiledWithExternalAnnotations() {
filesCompiledWithExternalAnnotations.add("kt1980.kt");
}
private static void fillFilesCompiledWithoutStdLib() { private static void fillFilesCompiledWithoutStdLib() {
filesCompiledWithoutStdLib.add("kt1953_class.kt"); // Exception in code filesCompiledWithoutStdLib.add("kt1953_class.kt"); // Exception in code
filesCompiledWithoutStdLib.add("basicmethodSuperClass.jet"); // Exception in code filesCompiledWithoutStdLib.add("basicmethodSuperClass.jet"); // Exception in code
filesCompiledWithoutStdLib.add("kt1980.kt"); // OVERLOAD_RESOLUTION_AMBIGUITY
filesCompiledWithoutStdLib.add("kt503.jet"); // OVERLOAD_RESOLUTION_AMBIGUITY filesCompiledWithoutStdLib.add("kt503.jet"); // OVERLOAD_RESOLUTION_AMBIGUITY
filesCompiledWithoutStdLib.add("kt504.jet"); // OVERLOAD_RESOLUTION_AMBIGUITY filesCompiledWithoutStdLib.add("kt504.jet"); // OVERLOAD_RESOLUTION_AMBIGUITY
filesCompiledWithoutStdLib.add("kt772.jet"); // OVERLOAD_RESOLUTION_AMBIGUITY filesCompiledWithoutStdLib.add("kt772.jet"); // OVERLOAD_RESOLUTION_AMBIGUITY