Skip to content

Commit

Permalink
8334057: JLinkReproducibleTest.java support receive test.tool.vm.opts
Browse files Browse the repository at this point in the history
Backport-of: 8feabc8
  • Loading branch information
SendaoYan authored and shipilev committed Sep 25, 2024
1 parent c212fe6 commit 547a229
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/jdk/tools/jlink/JLinkReproducibleTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -37,6 +37,9 @@
* @run driver 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 {
var pb = new ProcessBuilder(cmd.toArray(new String[0]));
var res = ProcessTools.executeProcess(pb);
Expand All @@ -46,6 +49,9 @@ private static void run(List<String> cmd) throws Exception {
private static void jlink(Path image, boolean with_default_trace_file) throws Exception {
var cmd = new ArrayList<String>();
cmd.add(JDKToolFinder.getJDKTool("jlink"));
if (!TOOL_VM_OPTIONS.isEmpty()) {
cmd.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1)));
}
cmd.addAll(List.of(
"--module-path", JMODS_DIR.toString() + File.pathSeparator + CLASS_DIR.toString(),
"--add-modules", "main",
Expand Down

1 comment on commit 547a229

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.