Skip to content

Commit

Permalink
Not compiling @ExpectLoadError annotation all the time.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Gerashchenko authored and Evgeny Gerashchenko committed Feb 19, 2013
1 parent 70030b2 commit 50bc94b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Expand Up @@ -46,7 +46,7 @@ public void doTest(@NotNull String javaFileName) throws Exception {
File txtFile = new File(javaFile.getPath().replaceFirst("\\.java$", ".txt"));
NamespaceDescriptor kotlinNamespace = analyzeKotlinAndLoadTestNamespace(ktFile, myTestRootDisposable, ConfigurationKind.JDK_AND_ANNOTATIONS);
Pair<NamespaceDescriptor, BindingContext> javaNamespaceAndContext = compileJavaAndLoadTestNamespaceAndBindingContextFromBinary(
Arrays.asList(javaFile, ExpectedLoadErrorsUtil.ANNOTATION_SOURCE_FILE),
Arrays.asList(javaFile),
tmpdir, myTestRootDisposable, ConfigurationKind.JDK_AND_ANNOTATIONS);
checkLoadedNamespaces(txtFile, kotlinNamespace, javaNamespaceAndContext);
}
Expand Down
Expand Up @@ -36,7 +36,6 @@

public class ExpectedLoadErrorsUtil {
public static final String ANNOTATION_CLASS_NAME = ExpectLoadError.class.getName();
public static final File ANNOTATION_SOURCE_FILE = new File("compiler/tests/" + ANNOTATION_CLASS_NAME.replace('.', '/') + ".java");

public static void checkForLoadErrors(
@NotNull NamespaceDescriptor namespaceFromJava,
Expand Down
Expand Up @@ -94,8 +94,11 @@ public static Pair<NamespaceDescriptor, BindingContext> loadTestNamespaceAndBind
Disposer.dispose(disposable);

CompilerConfiguration configuration = JetTestUtils.compilerConfigurationForTests(
configurationKind, TestJdkKind.MOCK_JDK, JetTestUtils.getAnnotationsJar(), outDir,
ForTestCompileRuntime.runtimeJarForTests());
configurationKind, TestJdkKind.MOCK_JDK, JetTestUtils.getAnnotationsJar(),
outDir,
ForTestCompileRuntime.runtimeJarForTests(),
new File("compiler/tests") // for @ExpectLoadError annotation
);
JetCoreEnvironment jetCoreEnvironment = new JetCoreEnvironment(disposable, configuration);
InjectorForJavaSemanticServices injector = new InjectorForJavaSemanticServices(jetCoreEnvironment.getProject());
JavaDescriptorResolver javaDescriptorResolver = injector.getJavaDescriptorResolver();
Expand All @@ -121,6 +124,7 @@ private static void compileJavaWithAnnotationsJar(@NotNull Collection<File> java
String classPath = "out/production/runtime" + File.pathSeparator + JetTestUtils.getAnnotationsJar().getPath();
JetTestUtils.compileJavaFiles(javaFiles, Arrays.asList(
"-classpath", classPath,
"-sourcepath", "compiler/tests", // for @ExpectLoadError annotation
"-d", outDir.getPath()
));
}
Expand Down
Expand Up @@ -71,7 +71,6 @@ public File fun(String s) {
return new File(s);
}
});
files.add(ExpectedLoadErrorsUtil.ANNOTATION_SOURCE_FILE);
File expectedFile = new File(expectedFileName);
File tmpDir = JetTestUtils.tmpDir(expectedFile.getName());

Expand Down

0 comments on commit 50bc94b

Please sign in to comment.