Skip to content

Commit 1684e7a

Browse files
committed
fix: share the test JVM arguments with the jni-check profile
The profile repeated the default argLine, so every module flag had to be added twice; it now prepends -Xcheck:jni to one property.
1 parent d4f05d0 commit 1684e7a

1 file changed

Lines changed: 20 additions & 25 deletions

File tree

‎webrtc/pom.xml‎

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@
1212

1313
<name>webrtc-java</name>
1414

15+
<properties>
16+
<!-- The JVM arguments of every test run, the jni-check profile's
17+
included. add-modules and add-reads: see the test compilation
18+
below. add-exports: dev.onvoid.webrtc.internal is not exported to
19+
applications, but the tests cover NativeApi, which native extension
20+
modules use to reach the native sources. -->
21+
<webrtc.test.argLine>
22+
--add-modules java.desktop
23+
--add-reads webrtc.java=java.desktop
24+
--add-exports webrtc.java/dev.onvoid.webrtc.internal=ALL-UNNAMED
25+
--add-opens webrtc.java/dev.onvoid.webrtc=ALL-UNNAMED
26+
--add-opens webrtc.java/dev.onvoid.webrtc.logging=ALL-UNNAMED
27+
--add-opens webrtc.java/dev.onvoid.webrtc.media=ALL-UNNAMED
28+
--add-opens webrtc.java/dev.onvoid.webrtc.media.audio=ALL-UNNAMED
29+
--add-opens webrtc.java/dev.onvoid.webrtc.media.video=ALL-UNNAMED
30+
</webrtc.test.argLine>
31+
</properties>
32+
1533
<build>
1634
<plugins>
1735
<!-- The module does not read java.desktop, but a desktop capture test
@@ -37,20 +55,7 @@
3755
<groupId>org.apache.maven.plugins</groupId>
3856
<artifactId>maven-surefire-plugin</artifactId>
3957
<configuration>
40-
<!-- add-exports: dev.onvoid.webrtc.internal is not exported to
41-
applications, but the tests cover NativeApi, which native
42-
extension modules use to reach the native sources.
43-
add-reads: see the test compilation above. -->
44-
<argLine>
45-
--add-modules java.desktop
46-
--add-reads webrtc.java=java.desktop
47-
--add-exports webrtc.java/dev.onvoid.webrtc.internal=ALL-UNNAMED
48-
--add-opens webrtc.java/dev.onvoid.webrtc=ALL-UNNAMED
49-
--add-opens webrtc.java/dev.onvoid.webrtc.logging=ALL-UNNAMED
50-
--add-opens webrtc.java/dev.onvoid.webrtc.media=ALL-UNNAMED
51-
--add-opens webrtc.java/dev.onvoid.webrtc.media.audio=ALL-UNNAMED
52-
--add-opens webrtc.java/dev.onvoid.webrtc.media.video=ALL-UNNAMED
53-
</argLine>
58+
<argLine>${webrtc.test.argLine}</argLine>
5459
</configuration>
5560
</plugin>
5661
</plugins>
@@ -93,17 +98,7 @@
9398
<artifactId>maven-surefire-plugin</artifactId>
9499
<configuration>
95100
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory" />
96-
<argLine>
97-
-Xcheck:jni
98-
--add-modules java.desktop
99-
--add-reads webrtc.java=java.desktop
100-
--add-exports webrtc.java/dev.onvoid.webrtc.internal=ALL-UNNAMED
101-
--add-opens webrtc.java/dev.onvoid.webrtc=ALL-UNNAMED
102-
--add-opens webrtc.java/dev.onvoid.webrtc.logging=ALL-UNNAMED
103-
--add-opens webrtc.java/dev.onvoid.webrtc.media=ALL-UNNAMED
104-
--add-opens webrtc.java/dev.onvoid.webrtc.media.audio=ALL-UNNAMED
105-
--add-opens webrtc.java/dev.onvoid.webrtc.media.video=ALL-UNNAMED
106-
</argLine>
101+
<argLine>-Xcheck:jni ${webrtc.test.argLine}</argLine>
107102
</configuration>
108103
</plugin>
109104
</plugins>

0 commit comments

Comments
 (0)