diff --git a/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala b/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala index cc53447cd64b..f5a9559dffc9 100644 --- a/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala +++ b/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala @@ -7,7 +7,6 @@ import scala.language.unsafeNulls import java.nio.file.Files, java.nio.charset.StandardCharsets.UTF_8 import org.junit.{ After, Test } import org.junit.Assert.assertEquals -import org.junit.Assume.assumeFalse import org.junit.experimental.categories.Category import ScriptTestEnv.* @@ -20,7 +19,6 @@ class BashExitCodeTests: /** Verify the exit code of running `cmd args*`. */ def verifyExit(cmd: String, args: String*)(expectedExitCode: Int): Unit = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val (validTest, exitCode, stdout, stderr) = bashCommand((cmd +: args).mkString(" ")) if verifyValid(validTest) then assertEquals({ diff --git a/compiler/test/dotty/tools/scripting/BashScriptsTests.scala b/compiler/test/dotty/tools/scripting/BashScriptsTests.scala index f3f364754e20..f6d17edf7d14 100644 --- a/compiler/test/dotty/tools/scripting/BashScriptsTests.scala +++ b/compiler/test/dotty/tools/scripting/BashScriptsTests.scala @@ -85,35 +85,30 @@ class BashScriptsTests: /* verify that `dist/bin/scala` correctly passes args to the jvm via -J-D for script envtest.sc */ @Test def verifyScJProperty = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val tag = "World1" val stdout = callScript(tag, envtestSc, s"-J-Dkey") assertEquals( s"Hello $tag", stdout) /* verify that `dist/bin/scala` correctly passes args to the jvm via -J-D for script envtest.scala */ @Test def verifyScalaJProperty = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val tag = "World2" val stdout = callScript(tag, envtestScala, s"-J-Dkey") assertEquals(s"Hello $tag", stdout) /* verify that `dist/bin/scala` can set system properties via -D for envtest.sc */ @Test def verifyScDProperty = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val tag = "World3" val stdout = callScript(tag, envtestSc, s"-Dkey") assertEquals(s"Hello $tag", stdout) /* verify that `dist/bin/scala` can set system properties via -D for envtest.scala */ @Test def verifyScalaDProperty = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val tag = "World4" val stdout = callScript(tag, envtestScala, s"-Dkey") assertEquals(s"Hello $tag", stdout) /* verify that `dist/bin/scala` can set system properties via -D when executing compiled script via -jar envtest.jar */ @Test def saveAndRunWithDProperty = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val commandline = Seq("SCALA_OPTS= ", scalaPath.relpath, "-save", envtestScala.relpath).mkString(" ") val (_, _, _, _) = bashCommand(commandline) // compile jar, discard output val testJar = testFile("envtest.jar") // jar is created by the previous bashCommand() @@ -131,7 +126,6 @@ class BashScriptsTests: /* verify `dist/bin/scalac` non-interference with command line args following script name */ @Test def verifyScalacArgs = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val commandline = (Seq("SCALA_OPTS= ", scalacPath, "-script", showArgsScript) ++ testScriptArgs).mkString(" ") val (validTest, exitCode, stdout, stderr) = bashCommand(commandline) if verifyValid(validTest) then @@ -147,7 +141,6 @@ class BashScriptsTests: /* verify `dist/bin/scala` non-interference with command line args following script name */ @Test def verifyScalaArgs = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val commandline = (Seq("SCALA_OPTS= ", scalaPath, showArgsScript) ++ testScriptArgs).mkString(" ") val (validTest, exitCode, stdout, stderr) = bashCommand(commandline) if verifyValid(validTest) then @@ -167,7 +160,7 @@ class BashScriptsTests: */ @Category(Array(classOf[BootstrappedOnlyTests])) @Test def verifyScriptPathProperty = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) + assumeFalse("Scripts do not yet support fully Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val scriptFile = testFiles.find(_.getName == "scriptPath.sc").get val expected = s"${scriptFile.getName}" printf("===> verify valid system property script.path is reported by script [%s]\n", scriptFile.getName) @@ -184,7 +177,7 @@ class BashScriptsTests: * verify SCALA_OPTS can specify an @argsfile when launching a scala script in `dist/bin/scala`. */ @Test def verifyScalaOpts = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) + assumeFalse("Scripts do not yet support fully Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val scriptFile = testFiles.find(_.getName == "classpathReport.sc").get printf("===> verify SCALA_OPTS='@argsfile' is properly handled by `dist/bin/scala`\n") val envPairs = List(("SCALA_OPTS", s"@$argsfile")) @@ -207,7 +200,7 @@ class BashScriptsTests: * verify that individual scripts can override -save with -nosave (needed to address #13760). */ @Test def sqlDateTest = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) + assumeFalse("Scripts do not yet support fully Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val scriptBase = "sqlDateError" val scriptFile = testFiles.find(_.getName == s"$scriptBase.sc").get val testJar = testFile(s"$scriptBase.jar") // jar should not be created when scriptFile runs @@ -232,7 +225,6 @@ class BashScriptsTests: * verify -e println("yo!") works. */ @Test def verifyCommandLineExpression = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) printf("===> verify -e is properly handled by `dist/bin/scala`\n") val expected = "9" val expression = s"println(3*3)" diff --git a/compiler/test/dotty/tools/scripting/ClasspathTests.scala b/compiler/test/dotty/tools/scripting/ClasspathTests.scala index 4fd1211698f6..1cf39214f5a0 100755 --- a/compiler/test/dotty/tools/scripting/ClasspathTests.scala +++ b/compiler/test/dotty/tools/scripting/ClasspathTests.scala @@ -8,6 +8,7 @@ import java.io.File import java.nio.file.Path import org.junit.{Test, Ignore, AfterClass} +import org.junit.Assume.assumeFalse import vulpix.TestConfiguration import ScriptTestEnv.* @@ -78,6 +79,7 @@ class ClasspathTests: * verify classpath is unglobbed by MainGenericRunner. */ @Test def unglobClasspathVerifyTest = { + assumeFalse("Scripts do not yet support fully Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val testScriptName = "unglobClasspath.sc" val testScript = scripts("/scripting").find { _.name.matches(testScriptName) } match case None => sys.error(s"test script not found: ${testScriptName}") diff --git a/compiler/test/dotty/tools/scripting/ExpressionTest.scala b/compiler/test/dotty/tools/scripting/ExpressionTest.scala index 6b5248e67f08..88772ff3aa7d 100755 --- a/compiler/test/dotty/tools/scripting/ExpressionTest.scala +++ b/compiler/test/dotty/tools/scripting/ExpressionTest.scala @@ -23,7 +23,7 @@ class ExpressionTest: * verify -e works. */ @Test def verifyCommandLineExpression = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) + assumeFalse("Scripts do not yet support fully Scala 2 library TASTy", Properties.usingScalaLibraryTasty) printf("===> verify -e is properly handled by `dist/bin/scala`\n") val expected = "9" val expression = s"println(3*3)" @@ -31,7 +31,7 @@ class ExpressionTest: assert(result.contains(expected), s"expression [$expression] did not send [$expected] to stdout. It send [$result].") @Test def verifyImports: Unit = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) + assumeFalse("Scripts do not yet support fully Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val expressionLines = List( "import java.nio.file.Paths", "import scala.util.Properties.userDir", diff --git a/compiler/test/dotty/tools/scripting/ScriptingTests.scala b/compiler/test/dotty/tools/scripting/ScriptingTests.scala index 5ec417090504..16eeb48f0b2a 100644 --- a/compiler/test/dotty/tools/scripting/ScriptingTests.scala +++ b/compiler/test/dotty/tools/scripting/ScriptingTests.scala @@ -12,8 +12,6 @@ import org.junit.Test import vulpix.TestConfiguration import ScriptTestEnv.* -import org.junit.Assume.assumeFalse - /** Runs all tests contained in `compiler/test-resources/scripting/` */ class ScriptingTests: // classpath tests managed by scripting.ClasspathTests.scala @@ -23,7 +21,6 @@ class ScriptingTests: * Call .scala scripts without -save option, verify no jar created */ @Test def scriptingDriverTests = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) for (scriptFile, scriptArgs) <- scalaFilesWithArgs(".scala") do showScriptUnderTest(scriptFile) val unexpectedJar = script2jar(scriptFile) @@ -46,7 +43,6 @@ class ScriptingTests: * Call .sc scripts without -save option, verify no jar created */ @Test def scriptingMainTests = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) for (scriptFile, scriptArgs) <- scalaFilesWithArgs(".sc") do showScriptUnderTest(scriptFile) val unexpectedJar = script2jar(scriptFile) @@ -65,7 +61,6 @@ class ScriptingTests: * Call .sc scripts with -save option, verify jar is created. */ @Test def scriptingJarTest = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) for (scriptFile, scriptArgs) <- scalaFilesWithArgs(".sc") do showScriptUnderTest(scriptFile) val expectedJar = script2jar(scriptFile) @@ -90,7 +85,6 @@ class ScriptingTests: * Verify that when ScriptingDriver callback returns false, main is not called. */ @Test def scriptCompileOnlyTests = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val scriptFile = touchFileScript showScriptUnderTest(scriptFile) @@ -129,7 +123,6 @@ class ScriptingTests: * Compile touchFile.sc to create executable jar, verify jar execution succeeds. */ @Test def scriptingNoCompileJar: Unit = - assumeFalse("Scripts do not yet support Scala 2 library TASTy", Properties.usingScalaLibraryTasty) val scriptFile = touchFileScript showScriptUnderTest(scriptFile) val expectedJar = script2jar(scriptFile)