Fix support of directories as sources in build files (-Xbuild-file)
#KT-27775 Fixed
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.integration;
|
||||
|
||||
import org.jetbrains.kotlin.cli.AbstractCliTest;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CompilerSmokeTest extends CompilerSmokeTestBase {
|
||||
@@ -120,4 +122,13 @@ public class CompilerSmokeTest extends CompilerSmokeTestBase {
|
||||
public void testPrintVersion() throws Exception {
|
||||
runCompiler("test.compile", "-version");
|
||||
}
|
||||
|
||||
public void testBuildFile() throws Exception {
|
||||
File buildXml = new File(getTestDataDir(), "build.xml");
|
||||
runCompiler(
|
||||
"buildFile.compile",
|
||||
AbstractCliTest.replacePathsInBuildXml("-Xbuild-file=" + buildXml, getTestDataDir(), tmpdir.getPath())
|
||||
);
|
||||
run("buildFile.run", "-cp", tmpdir.getAbsolutePath(), "MainKt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.integration;
|
||||
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.utils.StringsKt;
|
||||
|
||||
@@ -27,8 +28,13 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public abstract class CompilerSmokeTestBase extends KotlinIntegrationTestBase {
|
||||
@NotNull
|
||||
protected String getTestDataDir() {
|
||||
return KotlinTestUtils.getTestDataPathBase() + "/integration/smoke/" + getTestName(true);
|
||||
}
|
||||
|
||||
protected int run(String logName, String... args) throws Exception {
|
||||
return runJava(KotlinTestUtils.getTestDataPathBase() + "/integration/smoke/" + getTestName(true), logName, args);
|
||||
return runJava(getTestDataDir(), logName, args);
|
||||
}
|
||||
|
||||
protected int runCompiler(String logName, String... arguments) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user