summaryrefslogtreecommitdiff
path: root/app-text/jabref/files/jabref-2.10-test-jvm-props-args.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-text/jabref/files/jabref-2.10-test-jvm-props-args.patch')
-rw-r--r--app-text/jabref/files/jabref-2.10-test-jvm-props-args.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/app-text/jabref/files/jabref-2.10-test-jvm-props-args.patch b/app-text/jabref/files/jabref-2.10-test-jvm-props-args.patch
new file mode 100644
index 000000000000..d3e413e9b0fd
--- /dev/null
+++ b/app-text/jabref/files/jabref-2.10-test-jvm-props-args.patch
@@ -0,0 +1,49 @@
+From f24492bff17f728bcf2b5a50069669ae08b8b372 Mon Sep 17 00:00:00 2001
+From: Yuan Liao <liaoyuan@gmail.com>
+Date: Sat, 19 Feb 2022 10:21:04 -0800
+Subject: [PATCH] Add JVM system properties and argument for tests
+
+The changes to system properties ensure that all paths the application
+may write to during the tests are not protected by the Portage sandbox.
+
+The extra argument added is required on Java 17+, but it should also be
+compatible with all Java versions that support the Java Platform Module
+System (JPMS), namely Java 9+. On older Java versions, it is optional.
+On Java 8, however, including it in JVM arguments would cause an error.
+
+Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
+---
+ build.xml | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/build.xml b/build.xml
+index d13a9f3..788a4d1 100644
+--- a/build.xml
++++ b/build.xml
+@@ -28,7 +28,7 @@
+
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
+
+-<project name="JabRef" default="jars" basedir=".">
++<project name="JabRef" default="jars" basedir="." xmlns:if="ant:if">
+
+ <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ PROPERTY SETUP
+@@ -596,7 +596,14 @@ version=${jabref.version}</echo>
+ </target>
+
+ <target name="test" depends="buildtest" description="Runs all unit tests">
++ <condition property="shouldAddOpens">
++ <javaversion atleast="9" />
++ </condition>
+ <java fork="yes" classname="junit.textui.TestRunner" failonerror="true">
++ <sysproperty key="java.io.tmpdir" value="${java.io.tmpdir}" />
++ <sysproperty key="user.home" value="${user.home}" />
++ <jvmarg if:set="shouldAddOpens"
++ value="--add-opens=java.desktop/java.awt=ALL-UNNAMED" />
+ <arg value="tests.net.sf.jabref.AllTests" />
+ <classpath refid="classpathTest" />
+ </java>
+--
+2.34.1
+