Skip to content

Commit 60a5e43

Browse files
committed
Enable scripting tests
1 parent 79d9f5f commit 60a5e43

File tree

5 files changed

+6
-23
lines changed

5 files changed

+6
-23
lines changed

compiler/src/dotty/tools/MainGenericRunner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ object MainGenericRunner {
157157
process(tail, newSettings.withResidualArgs(arg))
158158

159159
def main(args: Array[String]): Unit =
160-
val scalaOpts = envOrNone("SCALA_OPTS").toArray.flatMap(_.split(" "))
160+
val scalaOpts = envOrNone("SCALA_OPTS").toArray.flatMap(_.split(" ")).filter(_.nonEmpty)
161161
val allArgs = scalaOpts ++ args
162162
val settings = process(allArgs.toList, Settings())
163163
if settings.exitCode != 0 then System.exit(settings.exitCode)

compiler/test-resources/scripting/classpathReport.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!dist/target/pack/bin/scala -classpath dist/target/pack/lib/*
1+
#!/usr/bin/env -S bin/scala -classpath 'dist/target/pack/lib/*'
22

33
import java.nio.file.Paths
44

compiler/test-resources/scripting/unglobClasspath.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!bin/scala -classpath 'dist/target/pack/lib/*'
1+
#!/usr/bin/env -S bin/scala -classpath 'dist/target/pack/lib/*'
22

33
// won't compile unless the hashbang line sets classpath
44
import org.jline.terminal.Terminal

compiler/test/dotty/tools/repl/EnvPropsTest.scala

Lines changed: 0 additions & 17 deletions
This file was deleted.

compiler/test/dotty/tools/scripting/ClasspathTests.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class ClasspathTests:
4141

4242
cmd.foreach { printf("[%s]\n", _) }
4343

44-
// test script reports the classpath it sees
44+
// test script reports the classpath it sees
4545
val scriptOutput = exec(cmd:_*)
4646
val scriptCwd = findTaggedLine("cwd", scriptOutput)
4747
printf("script ran in directory [%s]\n", scriptCwd)
4848
val scriptCp = findTaggedLine("classpath", scriptOutput)
4949

5050
val hashbangClasspathJars = scriptCp.split(psep).map { _.getName }.sorted.distinct
5151
val packlibJars = listJars(s"$scriptCwd/$packLibDir").sorted.distinct
52-
52+
5353
printf("%d jar files in dist/target/pack/lib\n", packlibJars.size)
5454
printf("%d test script jars in classpath\n", hashbangClasspathJars.size)
5555

@@ -78,7 +78,7 @@ class ClasspathTests:
7878

7979
cmd.foreach { printf("[%s]\n", _) }
8080

81-
// test script reports the classpath it sees
81+
// test script reports the classpath it sees
8282
val scriptOutput = exec(cmd:_*)
8383
val scriptCp = findTaggedLine("unglobbed classpath", scriptOutput)
8484
val classpathJars = scriptCp.split(psep).map { _.getName }.sorted.distinct

0 commit comments

Comments
 (0)