Add -Xuse-fir-lt=false to some scripting tests
make them compatible with K2
This commit is contained in:
committed by
Space Team
parent
6144ae7a6f
commit
f9c7a88175
@@ -152,8 +152,10 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
|
|||||||
|
|
||||||
fun testSimpleScriptLocal() {
|
fun testSimpleScriptLocal() {
|
||||||
val messageCollector = TestMessageCollector()
|
val messageCollector = TestMessageCollector()
|
||||||
val (code, outputs) = compileLocally(messageCollector, File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
|
val (code, outputs) = compileLocally(
|
||||||
"-d", tmpdir.absolutePath, "-Xreport-output-files", "-Xallow-any-scripts-in-source-roots")
|
messageCollector, File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
|
||||||
|
"-d", tmpdir.absolutePath, "-Xreport-output-files", "-Xuse-fir-lt=false", "-Xallow-any-scripts-in-source-roots"
|
||||||
|
)
|
||||||
Assert.assertEquals(0, code)
|
Assert.assertEquals(0, code)
|
||||||
Assert.assertTrue(outputs.isNotEmpty())
|
Assert.assertTrue(outputs.isNotEmpty())
|
||||||
Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath)
|
Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath)
|
||||||
@@ -172,9 +174,9 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
|
|||||||
inheritMemoryLimits = false, inheritOtherJvmOptions = false, inheritAdditionalProperties = false)
|
inheritMemoryLimits = false, inheritOtherJvmOptions = false, inheritAdditionalProperties = false)
|
||||||
try {
|
try {
|
||||||
val (code, outputs) = compileOnDaemon(
|
val (code, outputs) = compileOnDaemon(
|
||||||
flagFile, compilerId, daemonJVMOptions, daemonOptions, TestMessageCollector(),
|
flagFile, compilerId, daemonJVMOptions, daemonOptions, TestMessageCollector(),
|
||||||
File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
|
File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
|
||||||
"-Xreport-output-files", "-Xallow-any-scripts-in-source-roots", "-d", tmpdir.absolutePath
|
"-Xreport-output-files", "-Xuse-fir-lt=false", "-Xallow-any-scripts-in-source-roots", "-d", tmpdir.absolutePath
|
||||||
)
|
)
|
||||||
Assert.assertEquals(0, code)
|
Assert.assertEquals(0, code)
|
||||||
Assert.assertTrue(outputs.isNotEmpty())
|
Assert.assertTrue(outputs.isNotEmpty())
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public class CompilerSmokeTest extends CompilerSmokeTestBase {
|
|||||||
public void testCompileScript() throws Exception {
|
public void testCompileScript() throws Exception {
|
||||||
String jar = tmpdir.getAbsolutePath() + File.separator + "script.jar";
|
String jar = tmpdir.getAbsolutePath() + File.separator + "script.jar";
|
||||||
|
|
||||||
runCompiler("script", "-Xallow-any-scripts-in-source-roots", "script.kts", "-d", jar);
|
runCompiler("script", "-Xuse-fir-lt=false", "-Xallow-any-scripts-in-source-roots", "script.kts", "-d", jar);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInlineOnly() throws Exception {
|
public void testInlineOnly() throws Exception {
|
||||||
|
|||||||
+2
-1
@@ -201,7 +201,8 @@ class ScriptingCompilerPluginTest : TestCase() {
|
|||||||
val cp = (runtimeClasspath + scriptingClasspath + defsOut).joinToString(File.pathSeparator)
|
val cp = (runtimeClasspath + scriptingClasspath + defsOut).joinToString(File.pathSeparator)
|
||||||
val exitCode = K2JVMCompiler().exec(
|
val exitCode = K2JVMCompiler().exec(
|
||||||
System.err,
|
System.err,
|
||||||
"-cp", cp, *(scriptFiles.toTypedArray()), "-d", scriptsOut2.canonicalPath, "-Xallow-any-scripts-in-source-roots"
|
"-cp", cp, *(scriptFiles.toTypedArray()), "-d", scriptsOut2.canonicalPath, "-Xallow-any-scripts-in-source-roots",
|
||||||
|
"-Xuse-fir-lt=false"
|
||||||
)
|
)
|
||||||
|
|
||||||
Assert.assertEquals(ExitCode.OK, exitCode)
|
Assert.assertEquals(ExitCode.OK, exitCode)
|
||||||
|
|||||||
+1
@@ -251,6 +251,7 @@ class ScriptingWithCliCompilerTest {
|
|||||||
arrayOf(
|
arrayOf(
|
||||||
"-P", "plugin:kotlin.scripting:disable-script-definitions-autoloading=true",
|
"-P", "plugin:kotlin.scripting:disable-script-definitions-autoloading=true",
|
||||||
"-cp", getMainKtsClassPath().joinToString(File.pathSeparator), "-d", tmpdir.path,
|
"-cp", getMainKtsClassPath().joinToString(File.pathSeparator), "-d", tmpdir.path,
|
||||||
|
"-Xuse-fir-lt=false",
|
||||||
"-Xallow-any-scripts-in-source-roots", "-verbose", fileArg
|
"-Xallow-any-scripts-in-source-roots", "-verbose", fileArg
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ class CompilerClientIT {
|
|||||||
fun testSimpleScript() {
|
fun testSimpleScript() {
|
||||||
val (out, code) = runCompiler(
|
val (out, code) = runCompiler(
|
||||||
"-cp", compilationClasspath.joinToString(File.pathSeparator) { it.canonicalPath },
|
"-cp", compilationClasspath.joinToString(File.pathSeparator) { it.canonicalPath },
|
||||||
"-Xallow-any-scripts-in-source-roots",
|
"-Xuse-fir-lt=false", "-Xallow-any-scripts-in-source-roots",
|
||||||
File("testData/scripts/simpleHelloWorld.kts").canonicalPath)
|
File("testData/scripts/simpleHelloWorld.kts").canonicalPath)
|
||||||
assertEquals(0, code, "compilation failed:\n" + out + "\n")
|
assertEquals(0, code, "compilation failed:\n" + out + "\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user