Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2026, 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 @@ -95,7 +95,9 @@ List<String> filterJavaOpts(List<String> args) {
int i = 0, n = args.size();
while (i < n) {
String arg = args.get(i);
if (arg.startsWith("-D")) {
if (arg.equals("--enable-preview")) {
results.add(arg);
} else if (arg.startsWith("-D")) {
results.add(arg);
} else if (i < n - 1) {
switch (arg) {
Expand Down
6 changes: 4 additions & 2 deletions src/share/doc/javatest/regtest/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -1850,9 +1850,11 @@ such as file manipulation, executing commands in sub-processes when necessary,
and analyzing the results of those commands.

jtreg provides a variant of `@run main` that can be useful in such situations:
`@run driver`. This is the same as `@run main` with the exception that any VM
`@run driver`. This is the same as `@run main` with the exception that most of VM
options specified on the command line will not be used when running the specified class.
Such code can start processes using the standard `java.util.ProcessBuilder` API.
The only exception are certain VM options required to be compatible with driver class
compilation setting. Like module access options or preview mode.
Driver code can start processes using the standard `java.util.ProcessBuilder` API.
To build up the command line to be invoked, the code may want to reference details
about the test (such as the class path) or values that were given on the jtreg
command line (such as the JDK being tested, or the set of any VM options that
Expand Down
5 changes: 3 additions & 2 deletions src/share/doc/javatest/regtest/tag-spec.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML>
<!--
Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2006, 2026, 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 @@ -52,7 +52,7 @@ <h1>The JDK Test Framework: Tag Language Specification</h1>
<p>Comments and questions to:
<a href="mailto:jtreg-use@openjdk.org">jtreg-use@openjdk.org</a>.
<br>
1.47, 7 July, 2020
1.48, 20 February, 2026
</div>

<p>This is a specification document, not a tutorial. For more basic information
Expand Down Expand Up @@ -639,6 +639,7 @@ <h3 id="ACTION_TYPES">ACTION TYPES</h3>
Although superficially similar to <code>@run main</code>, this is for use when
it is desirable to perform additional setup or configuration before running
the class containing the actual test code, possibly in a child VM.
The driver execution VM options are aligned with the compilation settings.

<p>The named <var>&lt;class&gt;</var> will be compiled on demand, just as though an "<code>@run</code> build
<var>&lt;class&gt;</var>" action had been inserted before this action. If this action requires
Expand Down