Skip to content
Snippets Groups Projects
Commit 4c89a63a authored by Goetz Lindenmaier's avatar Goetz Lindenmaier
Browse files

8334057: JLinkReproducibleTest.java support receive test.tool.vm.opts

Backport-of: 8feabc849ba2f617c8c6dbb2ec5074297beb6437
parent ead94467
No related branches found
No related tags found
No related merge requests found
/* /*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -37,6 +37,9 @@ import jdk.test.lib.process.ProcessTools; ...@@ -37,6 +37,9 @@ import jdk.test.lib.process.ProcessTools;
* @run driver JLinkReproducibleTest * @run driver JLinkReproducibleTest
*/ */
public class JLinkReproducibleTest { public class JLinkReproducibleTest {
private static final String TOOL_VM_OPTIONS = System.getProperty("test.tool.vm.opts", "");
private static void run(List<String> cmd) throws Exception { private static void run(List<String> cmd) throws Exception {
var pb = new ProcessBuilder(cmd.toArray(new String[0])); var pb = new ProcessBuilder(cmd.toArray(new String[0]));
var res = ProcessTools.executeProcess(pb); var res = ProcessTools.executeProcess(pb);
...@@ -46,6 +49,9 @@ public class JLinkReproducibleTest { ...@@ -46,6 +49,9 @@ public class JLinkReproducibleTest {
private static void jlink(Path image, boolean with_default_trace_file) throws Exception { private static void jlink(Path image, boolean with_default_trace_file) throws Exception {
var cmd = new ArrayList<String>(); var cmd = new ArrayList<String>();
cmd.add(JDKToolFinder.getJDKTool("jlink")); cmd.add(JDKToolFinder.getJDKTool("jlink"));
if (!TOOL_VM_OPTIONS.isEmpty()) {
cmd.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1)));
}
cmd.addAll(List.of( cmd.addAll(List.of(
"--module-path", JMODS_DIR.toString() + File.pathSeparator + CLASS_DIR.toString(), "--module-path", JMODS_DIR.toString() + File.pathSeparator + CLASS_DIR.toString(),
"--add-modules", "main", "--add-modules", "main",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment