JBR-8255 pass WLToolkit-related settings to subprocesses launched by tests

This commit is contained in:
Vitaly Provodin
2025-02-13 03:32:04 +04:00
parent ac87d1549b
commit 6ea71cbbab
5 changed files with 10 additions and 6 deletions

View File

@@ -78,15 +78,17 @@ public class JEditorPaneFontFallback {
private static BufferedImage renderJEditorPaneInSubprocess(String fontFamilyName, boolean afterFontInfoCaching)
throws Exception {
String tmpFileName = "image.png";
Process process = Runtime.getRuntime().exec(new String[]{
String[] processCmd = new String[]{
System.getProperty("java.home") + File.separator + "bin" + File.separator + "java",
"-cp",
System.getProperty("test.classes", "."),
System.getProperty("test.java.opts", ""),
JEditorPaneRenderer.class.getName(),
fontFamilyName,
Boolean.toString(afterFontInfoCaching),
tmpFileName
});
tmpFileName};
System.out.println("===> Sub-process command: " + String.join(" ", processCmd));
Process process = Runtime.getRuntime().exec(processCmd);
int exitCode = process.waitFor();
try {
System.out.println("===> Sub-process stdout:");

View File

@@ -66,6 +66,7 @@ public class bug8081019 {
private static void runProcess() throws Exception {
String javaPath = System.getProperty("java.home", "");
String command = javaPath + File.separator + "bin" + File.separator + "java"
+ " " + System.getProperty("test.java.opts", "")
+ " " + bug8081019.class.getName() + " " + RUN_TEST;
Process process = Runtime.getRuntime().exec(command);

View File

@@ -57,7 +57,7 @@ then
exit 0
else
echo "There is GTK 3 library: we should use it"
strace -o strace.log -fe open,openat ${TESTJAVA}/bin/java -cp ${TESTCLASSPATH} -Djdk.gtk.version=3 ProvokeGTK
strace -o strace.log -fe open,openat ${TESTJAVA}/bin/java -cp ${TESTCLASSPATH} ${TESTJAVAOPTS} -Djdk.gtk.version=3 ProvokeGTK
EXECRES=$?
grep 'libgtk-3.*=\ *[0-9]*$' strace.log > logg
fi

View File

@@ -226,7 +226,7 @@ public final class UnninstallUIMemoryLeaks {
private static Process runProcess(LookAndFeelInfo laf) throws Exception {
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
"-Dswing.defaultlaf=" + laf.getClassName(), "-Xmx9m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+HeapDumpOnOutOfMemoryError", System.getProperty("test.java.opts", ""),
UnninstallUIMemoryLeaks.class.getSimpleName(), "mark");
return ProcessTools.startProcess(laf.getName(), pb);
}

View File

@@ -50,7 +50,8 @@ public class bug8234913 {
List<String> argsList = new ArrayList<>();
Collections.addAll(argsList, args);
Collections.addAll(argsList, "-Xmn8m");
Collections.addAll(argsList, "-Dtest.class.path=" + System.getProperty("test.class.path", "."));
Collections.addAll(argsList, "-Dtest.class.path=" + System.getProperty("test.class.path", ".")
+ " " + System.getProperty("test.java.opts", ""));
Collections.addAll(argsList, FontSizePercentTest.class.getName());
return ProcessTools.createLimitedTestJavaProcessBuilder(argsList.toArray(new String[argsList.size()]));
}