Test: Use --illegal-access=warn for tests (#28437)
This commit conditionally adds the --illegal-access=warn flag when tests are run with java 9. Currently, testing on java 9 triggers a warning about illegal access from mockito. While that should be fixed (by updating to a newer mockito base for securemock), the stderr warning we get is only the first one. Thankfully that is the only one, but this change will enable finding all such illegal accesses in the future.
This commit is contained in:
parent
3b6af15a60
commit
139deb535a
|
@ -567,6 +567,9 @@ class BuildPlugin implements Plugin<Project> {
|
|||
File heapdumpDir = new File(project.buildDir, 'heapdump')
|
||||
heapdumpDir.mkdirs()
|
||||
jvmArg '-XX:HeapDumpPath=' + heapdumpDir
|
||||
if (project.runtimeJavaVersion >= JavaVersion.VERSION_1_9) {
|
||||
jvmArg '--illegal-access=warn'
|
||||
}
|
||||
argLine System.getProperty('tests.jvm.argline')
|
||||
|
||||
// we use './temp' since this is per JVM and tests are forbidden from writing to CWD
|
||||
|
|
Loading…
Reference in New Issue