Expose helpers for testing GL versions. Add JVM args so that tests on

windows still work.
This commit is contained in:
Martin Pernollet 2022-03-21 18:23:19 +01:00
parent 7de96cc620
commit e8f3307ce0
5 changed files with 25 additions and 9 deletions

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@ -27,8 +29,4 @@
</dependencies>
<build>
<plugins>
</plugins>
</build>
</project>

View File

@ -38,7 +38,7 @@
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
</dependencies>
<build>
@ -48,9 +48,14 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- This is necessary for JOGL to properly retrieve the OPENGL version
information that we output in test to ease multiplatform debugging
https://forum.jogamp.org/Selecting-the-highest-possible-GL-profile-at-runtime-td4041302.html -->
information that we output in test to ease multiplatform debugging https://forum.jogamp.org/Selecting-the-highest-possible-GL-profile-at-runtime-td4041302.html -->
<argLine>-Djogl.disable.openglcore=true</argLine>
<!-- This is necessary on Windows to avoid an exception https://github.com/jzy3d/jogl/issues/4 -->
<argLine>--add-exports java.base/java.lang=ALL-UNNAMED
--add-exports java.desktop/sun.awt=ALL-UNNAMED
--add-exports java.desktop/sun.java2d=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>

View File

@ -52,6 +52,10 @@ public class Test_OpenGLVersion {
GLCapabilities caps = new GLCapabilities(glp);
caps.setOnscreen(false);
createGLContextAndPrintInfo(glp, caps);
}
public static void createGLContextAndPrintInfo(GLProfile glp, GLCapabilities caps) {
// ------------------------------------------------------
// Drawable to get a GL context

View File

@ -25,4 +25,5 @@
</dependency>
</dependencies>
</project>

10
pom.xml
View File

@ -302,7 +302,7 @@
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@ -378,6 +378,14 @@
<include>**/Test*.java</include>
<include>**/*Test.java</include>
</includes>
<!-- This is necessary on Windows to avoid an exception if a test opens
a chart https://github.com/jzy3d/jogl/issues/4 -->
<argLine>--add-exports java.base/java.lang=ALL-UNNAMED
--add-exports java.desktop/sun.awt=ALL-UNNAMED
--add-exports
java.desktop/sun.java2d=ALL-UNNAMED</argLine>
</configuration>
</plugin>