Scroll to navigation

JTREG(1) User Commands JTREG(1)

NAME

jtreg - Regression Test Harness

DESCRIPTION

Usage:

jtreg options... tests...

Tests can be given as files or folders containing test files, or by means of test groups. Long lists of options and tests may be encapsulated in "at-files".

Verbose Options

These options control the amount of output written to the console while running tests
Increase the amount of output written to the console. A value, or selected combinations of values separated by commas, may be given to select the type of output desired.
Three lines of output per test: start, end, status
One line of output per test: status, test name
Selected contents of JTR file for all tests (includes stdout/stderr)
Selected contents of JTR file for passed tests
Selected contents of JTR file for failed tests
Selected contents of JTR file for errored tests
Suppress output for tests that passed
Elapsed time per action
Updates for each testsuite when tests from more than one are being executed.
Short for -verbose:summary
Short for -verbose:all
Short for -verbose:error
Short for -verbose:fail
Short for -verbose:pass
Short for -verbose:time

Documentation Options

Options for additional documentation
Command line help. Give words to see help info containing those or use "-help all" to see all available help.
Release notes
Tag specification supported by this implementation
Give information about the version of jtreg in use.

General Options

Allow agentVM tests to set a security manager. Default is "yes" if option not given or no value given for option.
Allow agentVM tests to set a security manager
Do not allow agentVM tests to set a security manager
Allow agentVM tests to set a security manager
Do not allow agentVM tests to set a security manager
Allow agentVM tests to set a security manager
Do not allow agentVM tests to set a security manager
Verify correctness of test descriptions. Does NOT run tests.
concurrency factor
(Windows only) Use Cygwin to run shell tests
Specify a base directory for test files and directories
Specify additional environment variables to be passed to each test. If a value is not given for a name, the current value of the environment variable will be used. Standard environment variables, like DISPLAY, LANG, windir, SystemRoot, etc, will automatically be given to each test, if they are set in the current environment.
Access regression extensions via the standard JavaTest harness gui
Specify how to handle tests containing an @ignore tag.
Completely ignore such tests.
(Default.) Execute the actions up to the @ignore tag, then give an "Error" result.
Run the test, as though the @ignore tag were not present.
List the tests that would be executed instead of executing them.
Lock file to use for tests in "exclusive access" directories when running tests in multiple concurrent instances of jtreg.
Path to location of native libraries and programs needed by the tests.
suppress the effect of any @ignore tags, allowing the test to proceed as if the @ignore tags were not present. Deprecated: see the -ignore option.
Do not generate a final report.
Specifies the class to observe the progress of a test suite; the class must implement a specific interface; contact a developer for details. For example, -o:SampleRegressionObserver
Specifies the pathname of a directory or .jar file in which the observer class is located. The given pathname is simply appended to the CLASSPATH used for the tests, thus care should be taken when naming an observer not to collide with the names of classes internal to the JavaTest harness or the JRE. For example, put the observer class in its own named package.
All report files placed here; "./JTreport" is default
Configure the report generated after tests are run.
Do not generate a report; equivalent to -noreport.
Include tests executed in the latest run
Include all tests specified by groups and paths on the command line, ignoring filters like status, exclude lists, and keywords.
all-executed
Include all tests that have been executed in current work directory
Include all tests that are present in the test suite, whether they have been executed
Specify files to be retained after each test completes executing. If -retain is not specified or is specified with lastRun, only the files from the last test executed will be retained, in the test's scratch directory. For all other uses of -retain, files will be retained in a test-specific directory in the work-directory. If -retain is specified with no argument, all files will be retained. Otherwise, the files may be described by one or more of the following values:
Do not retain any of the files generated by each test
Retain files generated by the last test that was run (default)
Retain files generated by tests that pass
Retain files generated by tests that fail
Retain files generated by tests that caused an error
Retain all files generated by each test
Retain files that match a specific filename. The name may contain '*' to match any sequence of characters. For example, result.* or *.err.
Generate report for previously executed tests. This does not re-run any tests. A work directory containing the results of the executed tests must be provided. The default location is "./JTwork". To specify an alternate directory, use -workDir.
Show the contents of a stream in a specific section or in all sections of the results file for a test. The content is shown as originally written to the stream: that is, without the escape encoding used in the .jtr file. If no section name is given, the output for the named stream in all sections is shown. For example, -show:rerun -show:main/System.out
Show the expansion (to files and directories) of the groups given on the command line. To see the expansion of all the groups in a test suite, specify the name of the test suite.
Start the http server to view test results
Specifies the class to create thread factory for test execution. The class should implement the java.util.concurrent.ThreadFactory interface.
Specifies classspath for custom test thread factory implementation. The classes from this classpath are loaded by tested JDK only using URLClassLoader.
Location for .class files, .jtr files, etc. "./JTwork" is default
(Windows only) Use the Windows Subsystem for Linux (WSL) to run shell tests
Create ant/junit xml files into the workDir. Optionally verify if the file is well-formed.

Timeout Options

These options control the behavior when tests run longer than their specified timeout value.
Specifies the class to handle timeouts. The class must extend com.sun.javatest.regtest.TimeoutHandler. For example, -th:MyHandler
Specifies the pathname of a directory or .jar file in which the timeout handler class is located. The given pathname is simply appended to the CLASSPATH used for the tests, thus care should be taken when naming a timeout handler not to collide with the names of classes internal to the JavaTest harness or the JRE. For example, put the timeout handler class in its own named package.
Specifies execution time limitation for the timeout handler. If the timeout handler does not finish its actions within the specified period of time, it will be interrupted. Non-positive values mean no limitation. The default value is 5 minutes (300 seconds).
A scaling factor to extend the default timeout of all tests. Typically used when running tests on slow systems or systems with slow file systems.
Do not run tests which specify a timeout longer than a given value. The comparison is done against any values specified in the test, before any timeout factor is applied.

Agent Pool Options

Options to configure the size of the pool of VMs used to execute tests in agent mode.
The maximum number of VMs to keep available in the agent pool. The default is either 2x the concurrency.
The time, in seconds, before an idle VM in the pool is automatically closed.

Test Selection Options

These options can be used to refine the set of tests to be executed.
Any test with /manual will not be run
Run only those tests which apply to the given bugid.
Provide a file specifying tests that should not be run
A keyword boolean expression for test selection. The expression can contain keyword names, combined with & (and), | (or), ! (not) and parentheses.
Only tests with /manual will be run
Provide a file specifying tests that can be run (inverse of -exclude)
Any tests which contain shell actions will not be run
Only tests which contain shell actions will be run
Select tests according to their result in an earlier run. The value can be one or more of the following values, separated by commas.
Tests that passed
Tests that failed
Tests that have not been run
Tests that could not be run because of errors, or tests that were ignored

Test Mode Options

Each test consists of a series of steps, called actions. The jtreg harness provides different modes, which determine the JVM to use to execute each action. The default is to run each action in a new JVM.
Execute each action using a pool of reusable JVMs, except when an action specifies otherwise. It provides good performance, and reasonable isolation between actions: if a JVM can be reset to a standard state after it has been used, it will be returned to the pool for reuse; otherwise, it will be discarded and replaced if and when necessary. This mode is generally recommended for all use. The JDK to use can be specified with -testjdk or -jdk, except for @compile actions, which use -compilejdk or -jdk. If values are not provided, the environment variable JAVA_HOME is used.
Execute every action in a new JVM. This is the default. It provides the maximum isolation between actions, at a significant cost in performance. The JDK to use can be specified with -testjdk or -jdk, except for @compile actions, which use -compilejdk or -jdk. If values are not provided, the environment variable JAVA_HOME is used.

JDK-related Options

By default, tests will be run using the default JVM in the test JDK. You can pass all applicable JVM options via using -vmoption; in addition, many common JVM options are also supported directly. For full details of any option, consult the documentation for that version of the JDK, or try using "java -help" or "java -X". If an option is not applicable to a particular platform or JDK release, it will be rejected.
root modules to resolve in addition to the initial module
Load native agent library
Load native agent library by full pathname
VM Options
Compile all tests using specified JDK. If not specified, tests are compiled with the JDK used to run the tests. See also -jdk. For example, -jdk:/usr/local/java/jdk1.5/solaris-sparc
Append the provided classPath to the CLASSPATH of every test. This is designed to be used primarily for tests which require non-core JDK functionality. For example, to test Swing, which is not part of core JDK1.1, the following addition to the CLASSPATH would be necessary: -cpa:/usr/local/java/swing-1.0.3/swingall.jar
Define a system property
Use this to specify VM options to attach a debugger to a VM running a test. It is similar to -vmoptions except that it is not used when starting VMs used to query the properties of that VM. Any timeout for a test is automatically disabled when this option is used. See also -javaoptions and -vmoptions.

-enableassertions | --enableassertions:* | -ea | --ea:* | -disableassertions

| --disableassertions:* | -da | --da:*
Enable or disable assertions
Enable or disable system assertions
Load Java programming language agent
Additional compiler option. You can give this option multiple times. Any embedded filenames must be given with absolute paths.
Additional compiler options. You can give this option multiple times, or give many values together, separated by spaces. If you give multiple values, you may need to enclose them in quotes, depending on the shell you use. Any embedded filenames must be given with absolute paths. Warning: do not use this form if any of the options has an argument such as a filename that might contain spaces. In that case, use one or more -javacoption options instead.
Additional java option for running test classes. You can give this option multiple times. Any embedded filenames must be given with absolute paths. See also -vmoption.
Additional java options for running test classes. You can give this option multiple times, or give many values together, separated by spaces. If you give multiple values, you may need to enclose them in quotes, depending on the shell you use. Any embedded filenames must be given with absolute paths. Warning: do not use this form if any of the options has an argument such as a filename that might contain spaces. In that case, use one or more -javaoption options instead. See also -vmoptions.
Run all tests using specified JDK. For example, -jdk:/usr/local/java/jdk1.5/solaris-sparc
Enable the JIT for the tests. The JIT is turned on by default.
limit the universe of observable modules
Disable the JIT for the tests.
Specify classes to override module classes
Any other VM option. You can give this option multiple times. Any embedded filenames must be given with absolute paths. This option will be used when compiling and running classes. See also -javaoption.
Any other VM options. You can give this option multiple times, or give many values together, separated by spaces. If you give multiple values, you may need to enclose them in quotes, depending on the shell you use. Any embedded filenames must be given with absolute paths. Warning: do not use this form if any of the options has an argument such as a filename that might contain spaces. In that case, use one or more -vmption options instead. This option will be used when compiling and running classes. See also -javaoptions.
Non-standard VM Options.
Set search path for bootstrap classes and resources
Append to end of bootstrap class path
Prepend in front of bootstrap class path
Non-standard VM Options
Non-standard VM Options

Tests Specifying collections of tests.

Specifying collections of tests.
Long lists of options and tests may be encapsulated in "at-files". Place the options and/or tests in a file and specify the name of the file on the command line with @file. Options or tests that include white space should be enclosed within either single or double quote characters. Comments may be included in the file by prefixing them with '#'. To specify an option beginning with '@' on the command line, use "@@" to avoid @file expansion.
Specifying collections of tests.
A test suite may define named groups of tests. To specify the name of a group of tests on the command line, use test-suite-dir:group-name, where test-suite-dir is a path to the root directory of the test suite (that is, the directory containing the TEST.ROOT file), and where group-name is the name of the group of tests defined in the test suite. If test-suite-dir is omitted it defaults to the value of the -dir option, if given, or to the current directory otherwise. (Note: on Windows, to avoid confusion with absolute path names including a drive specifier, the test-suite-dir must not be specified with a relative path consisting of a single letter.)
Groups are defined in a test suite using one or more
Java properties files. The names of these files must be listed in the "groups" entry in TEST.ROOT. If the filename is enclosed in square brackets, no error message will be given if the file cannot be found. Within the property files, each entry specifies items to be included or excluded from the group. To include a test or directory of tests, simply specify the name of the test or directory. To exclude a test or directory of tests, use '-' followed by the name of the test or directory. To include the contents of another group, use ':' followed by the name of the group. There must be no spaces between the "-" or ":" and the name that follows.
The following kinds of arguments can be used to specify tests to be executed.In these examples, square brackets are used to indicate optional parts.
All tests found in and under the given directory.
Either all tests in the given file if no id is given, or the specified test if an id is given. A file contains multiple tests if there are multiple test descriptions, in separate comment blocks. If '?string' is specified, the string will be passed to the test so that it may filter the parts of the test to be executed. The string will typically be the name of a method to be executed. If conflicting values for the string are given for a specific test, the last one given will be used.
[path]:group-name
A group of tests, as defined in the TEST.groups file in the testsuite root directory. If given, path specifies the testsuite root directory. If not given, it defaults to the one enclosing the current directory.
@file
A file containing values to be treated as if on the command-line.

COPYRIGHT

Copyright © 1999, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.

Installed in /build/reproducible-path/jtreg7-7.3.1+1+ds1/build/images/jtreg/lib/jtreg.jar Running on platform version 17.0.11 from /usr/lib/jvm/java-17-openjdk-amd64. Built with Java(TM) 2 SDK, Version 17.0.11+9-Debian-1 on Thu, 09 May 2024 08:52:53 +1200.
Copyright © 1999, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. JT Harness, version 6.0 ea b24 (January 25, 1970) Java Assembler Tools, version 7.0 ea b09 (February 06, 2023) TestNG: testng.jar, guice.jar, jcommander.jar, slf4j-simple.jar, slf4j-api.jar TestNG (testng.jar): version 7.5 TestNG (guice.jar): version 4.2.3 TestNG (jcommander.jar): version unknown TestNG (slf4j-simple.jar): version 1.7.32 TestNG (slf4j-api.jar): version 1.7.32 JUnit: junit-platform-console-standalone.jar JUnit: version unknown

SEE ALSO

The full documentation for jtreg is maintained as a Texinfo manual. If the info and jtreg programs are properly installed at your site, the command

info jtreg

should give you access to the complete manual.

May 2024 jtreg 7.3.1-src+1