@@ -845,7 +845,8 @@ lazy val testkit = configureAsSubproject(project)
845
845
// This is enforced by error (not just by warning) since JDK 16. In our tests we use reflective access
846
846
// from the unnamed package (the classpath) to JDK modules in testing utilities like `assertNotReachable`.
847
847
// `add-exports=jdk.jdeps/com.sun.tools.javap` is tests that use `:javap` in the REPL, see scala/bug#12378
848
- val addOpensForTesting = " -XX:+IgnoreUnrecognizedVMOptions" +: " --add-exports=jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED" +:
848
+ // Also --enable-native-access is needed for jvm/natives.scala
849
+ val addOpensForTesting = " -XX:+IgnoreUnrecognizedVMOptions" +: " --add-exports=jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED" +: " --enable-native-access=ALL-UNNAMED" +:
849
850
Seq (" java.util.concurrent.atomic" , " java.lang" , " java.lang.reflect" , " java.net" ).map(p => s " --add-opens=java.base/ $p=ALL-UNNAMED " )
850
851
851
852
lazy val junit = project.in(file(" test" ) / " junit" )
@@ -1091,7 +1092,6 @@ lazy val test = project
1091
1092
IntegrationTest / fork := true ,
1092
1093
Compile / scalacOptions += " -Yvalidate-pos:parser,typer" ,
1093
1094
IntegrationTest / javaOptions ++= List (" -Xmx2G" , " -Dpartest.exec.in.process=true" , " -Dfile.encoding=UTF-8" , " -Duser.language=en" , " -Duser.country=US" ) ++ addOpensForTesting,
1094
- IntegrationTest / javaOptions ++= { if (scala.util.Properties .isJavaAtLeast(" 18" )) List (" -Djava.security.manager=allow" ) else Nil },
1095
1095
IntegrationTest / testOptions += Tests .Argument (" -Dfile.encoding=UTF-8" , " -Duser.language=en" , " -Duser.country=US" ),
1096
1096
testFrameworks += new TestFramework (" scala.tools.partest.sbt.Framework" ),
1097
1097
IntegrationTest / testOptions += Tests .Argument (s " -Dpartest.java_opts=-Xmx1024M -Xms64M ${addOpensForTesting.mkString(" " )}" ),
0 commit comments