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() {
|
||||
val messageCollector = TestMessageCollector()
|
||||
val (code, outputs) = compileLocally(messageCollector, File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
|
||||
"-d", tmpdir.absolutePath, "-Xreport-output-files", "-Xallow-any-scripts-in-source-roots")
|
||||
val (code, outputs) = compileLocally(
|
||||
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.assertTrue(outputs.isNotEmpty())
|
||||
Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath)
|
||||
@@ -172,9 +174,9 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
|
||||
inheritMemoryLimits = false, inheritOtherJvmOptions = false, inheritAdditionalProperties = false)
|
||||
try {
|
||||
val (code, outputs) = compileOnDaemon(
|
||||
flagFile, compilerId, daemonJVMOptions, daemonOptions, TestMessageCollector(),
|
||||
File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
|
||||
"-Xreport-output-files", "-Xallow-any-scripts-in-source-roots", "-d", tmpdir.absolutePath
|
||||
flagFile, compilerId, daemonJVMOptions, daemonOptions, TestMessageCollector(),
|
||||
File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
|
||||
"-Xreport-output-files", "-Xuse-fir-lt=false", "-Xallow-any-scripts-in-source-roots", "-d", tmpdir.absolutePath
|
||||
)
|
||||
Assert.assertEquals(0, code)
|
||||
Assert.assertTrue(outputs.isNotEmpty())
|
||||
|
||||
@@ -119,7 +119,7 @@ public class CompilerSmokeTest extends CompilerSmokeTestBase {
|
||||
public void testCompileScript() throws Exception {
|
||||
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 {
|
||||
|
||||
+2
-1
@@ -201,7 +201,8 @@ class ScriptingCompilerPluginTest : TestCase() {
|
||||
val cp = (runtimeClasspath + scriptingClasspath + defsOut).joinToString(File.pathSeparator)
|
||||
val exitCode = K2JVMCompiler().exec(
|
||||
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)
|
||||
|
||||
+1
@@ -251,6 +251,7 @@ class ScriptingWithCliCompilerTest {
|
||||
arrayOf(
|
||||
"-P", "plugin:kotlin.scripting:disable-script-definitions-autoloading=true",
|
||||
"-cp", getMainKtsClassPath().joinToString(File.pathSeparator), "-d", tmpdir.path,
|
||||
"-Xuse-fir-lt=false",
|
||||
"-Xallow-any-scripts-in-source-roots", "-verbose", fileArg
|
||||
)
|
||||
)
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ class CompilerClientIT {
|
||||
fun testSimpleScript() {
|
||||
val (out, code) = runCompiler(
|
||||
"-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)
|
||||
assertEquals(0, code, "compilation failed:\n" + out + "\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user