Minor, don't create empty tmpdir in codegen tests w/o Java

This commit is contained in:
Alexander Udalov
2016-03-03 14:49:51 +03:00
parent d011fa8dc6
commit 5488972b53
@@ -104,6 +104,8 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
myEnvironment.getProject(), myFiles.getPsiFiles(), new JvmPackagePartProvider(myEnvironment) myEnvironment.getProject(), myFiles.getPsiFiles(), new JvmPackagePartProvider(myEnvironment)
).getFactory(); ).getFactory();
if (javaSourceDir != null) {
// If there are Java files, they should be compiled against the class files produced by Kotlin, so we dump them to the disk
File kotlinOut; File kotlinOut;
try { try {
kotlinOut = KotlinTestUtils.tmpDir(toString()); kotlinOut = KotlinTestUtils.tmpDir(toString());
@@ -114,13 +116,13 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
OutputUtilsKt.writeAllTo(classFileFactory, kotlinOut); OutputUtilsKt.writeAllTo(classFileFactory, kotlinOut);
if (javaSourceDir != null) {
File output = CodegenTestUtil.compileJava( File output = CodegenTestUtil.compileJava(
findJavaSourcesInDirectory(javaSourceDir), Collections.singletonList(kotlinOut.getPath()), javacOptions findJavaSourcesInDirectory(javaSourceDir), Collections.singletonList(kotlinOut.getPath()), javacOptions
); );
// Add javac output to classpath so that the created class loader can find generated Java classes // Add javac output to classpath so that the created class loader can find generated Java classes
JvmContentRootsKt.addJvmClasspathRoot(configuration, output); JvmContentRootsKt.addJvmClasspathRoot(configuration, output);
} }
blackBox(); blackBox();
} }