minor: avoid double reporting of scripting diagnostics

also fix arror reporting for scripts with location
This commit is contained in:
Ilya Chernikov
2022-05-31 14:56:15 +02:00
committed by teamcity
parent 855059b93c
commit f5950ac8f3
3 changed files with 22 additions and 12 deletions
@@ -245,9 +245,7 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
runProcess(
"kotlin", "-no-stdlib", "-e", "println(42)",
expectedExitCode = 1,
expectedStderr = """error: unresolved reference: println (script.kts:1:1)
error: no script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies. (script.kts:1:1)
script.kts:1:1: error: unresolved reference: println
expectedStderr = """script.kts:1:1: error: unresolved reference: println
println(42)
^
script.kts:1:1: error: no script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies.
@@ -300,8 +298,7 @@ println(42)
)
runProcess(
"kotlin", "-Xallow-any-scripts-in-source-roots", "-howtorun", ".kts", "$testDataDirectory/noInline.myscript",
expectedExitCode = 1, expectedStderr = """error: unresolved reference: CompilerOptions (noInline.myscript:1:7)
compiler/testData/launcher/noInline.myscript:1:7: error: unresolved reference: CompilerOptions
expectedExitCode = 1, expectedStderr = """compiler/testData/launcher/noInline.myscript:1:7: error: unresolved reference: CompilerOptions
@file:CompilerOptions("-Xno-inline")
^
"""