JTREG(1)
๐ JTREG(1) ๐
okay bestie, welcome to jtreg, aka the Regression Test Harness โ she lives in section 1 of the User Commands manual and she is THE girl for running tests. grab a boba, we're doing this ๐งโจ
๐ธ NAME ๐ธ
jtreg โ Regression Test Harness ๐
๐ฆ DESCRIPTION ๐ฆ
โจ Usage โจ
jtreg options... tests...
so the vibe is: you hand her tests... and she runs them. those tests can be given as files or folders containing test files, or you can roll up by means of test groups. ๐ซถ
and listen โ long lists of options and tests may be encapsulated in "at-files". yes bestie, at-files. iconic behaviour honestly.
๐ Verbose Options ๐
These options control the amount of output written to the console while running tests. basically: how much does she yap about it ๐ฃ๏ธ
-v|--v:<value>|-verbose|--verbose:<value>โ 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.defaultโ Three lines of output per test: start, end, statussummaryโ One line of output per test: status, test nameallโ Selected contents of JTR file for all tests (includes stdout/stderr)passโ Selected contents of JTR file for passed testsfailโ Selected contents of JTR file for failed testserrorโ Selected contents of JTR file for errored testsnopassโ Suppress output for tests that passedtimeโ Elapsed time per actionmultirunโ Updates for each testsuite when tests from more than one are being executed.
-v1โ Short for-verbose:summary-vaโ Short for-verbose:all-veโ Short for-verbose:error-vfโ Short for-verbose:fail-vpโ Short for-verbose:pass-vtโ Short for-verbose:time
๐ Documentation Options ๐
Options for additional documentation. when you just need to read about her instead of running her ๐
--help [words...]|-h [words...]|-help [words...]|-usage [words...]โ Command line help. Give words to see help info containing those or use"-help all"to see all available help.-n|-relnoteโ Release notes-t|-tagspecโ Tag specification supported by this implementation-versionโ Give information about the version of jtreg in use.
๐ General Options ๐
the main character section fr fr ๐
-allowSetSecurityManager|--allowSetSecurityManager:<boolean-value>โ Allow agentVM tests to set a security manager. Default is"yes"if option not given or no value given for option.yesโ Allow agentVM tests to set a security managernoโ Do not allow agentVM tests to set a security manageronโ Allow agentVM tests to set a security manageroffโ Do not allow agentVM tests to set a security managertrueโ Allow agentVM tests to set a security managerfalseโ Do not allow agentVM tests to set a security manager
-c|-checkโ Verify correctness of test descriptions. Does NOT run tests. ๐จ (she's just checking, bestie, not executing!)-conc:<factor>|-concurrency:<factor>โ concurrency factor-cygwinโ (Windows only) Use Cygwin to run shell tests-dir:<dir>โ Specify a base directory for test files and directories-e:name[=value][,name[=value]...]โ Specify additional environment variables to be passed to each test. If a value is not given for aname, the current value of the environment variable will be used. Standard environment variables, likeDISPLAY,LANG,windir,SystemRoot, etc, will automatically be given to each test, if they are set in the current environment. ๐ฑ-g|-guiโ Access regression extensions via the standard JavaTest harness gui-i|--verify-excludeโ Validate contents of exclude files-ignore:<value>โ Specify how to handle tests containing an@ignoretag.quietโ Completely ignore such tests.errorโ (Default.) Execute the actions up to the@ignoretag, then give an"Error"result.runโ Run the test, as though the@ignoretag were not present.
-l|-listtestsโ List the tests that would be executed instead of executing them.-lock:<file>โ Lock file to use for tests in"exclusive access"directories when running tests in multiple concurrent instances ofjtreg.-nativepath:<path>โ Path to location of native libraries and programs needed by the tests.-noignoreโ suppress the effect of any@ignoretags, allowing the test to proceed as if the@ignoretags were not present. Deprecated: see the-ignoreoption. ๐-nr|-noreportโ Do not generate a final report.-o:<classname>|-observer:<classname>โ 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-od:<path>|-observerDir:<path>|-op:<path>|-observerPath:<path>โ Specifies the pathname of a directory or.jarfile in which the observer class is located. The given pathname is simply appended to theCLASSPATHused 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. ๐ซถ-r:<directory>|-reportDir:<directory>โ All report files placed here;"./JTreport"is default-report:<value>โ Configure the report generated after tests are run.noneโ Do not generate a report; equivalent to-noreport.executedโ Include tests executed in the latest runfilesโ 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 directoryallโ Include all tests that are present in the test suite, whether they have been executed
-retain|--retain:<none,lastRun,pass,fail,error,all,file-pattern>,...โ Specify files to be retained after each test completes executing. If-retainis not specified or is specified withlastRun, 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-retainis specified with no argument, all files will be retained. Otherwise, the files may be described by one or more of the following values:noneโ Do not retain any of the files generated by each testlastRunโ Retain files generated by the last test that was run (default)passโ Retain files generated by tests that passfailโ Retain files generated by tests that failerrorโ Retain files generated by tests that caused an errorallโ Retain all files generated by each testfile-patternโ Retain files that match a specific filename. The name may contain'*'to match any sequence of characters. For example,result.*or*.err. ๐ฅ
-ro|-reportOnlyโ 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:[<section-name>/]<stream-name>โ 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.jtrfile. 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โจ-showGroupsโ 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.-startHttpdโ Start the http server to view test results-ttf:<classname>|-testThreadFactory:<classname>โ Specifies the class to create thread factory for test execution. The class should implement thejava.util.concurrent.ThreadFactoryinterface.-ttfp:<path>|-testThreadFactoryPath:<path>โ Specifies classspath for custom test thread factory implementation. The classes from this classpath are loaded by tested JDK only usingURLClassLoader.-w:<directory>|-workDir:<directory>โ Location for.classfiles,.jtrfiles, etc."./JTwork"is default-wslโ (Windows only) Use the Windows Subsystem for Linux (WSL) to run shell tests-xml|--xml:verifyโ 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. yes she will call time on them โณ
-th:<classname>|-timeoutHandler:<classname>โ Specifies the class to handle timeouts. The class must extendcom.sun.javatest.regtest.TimeoutHandler. For example,-th:MyHandler-thd:<path>|-timeoutHandlerDir:<path>โ Specifies the pathname of a directory or.jarfile in which the timeout handler class is located. The given pathname is simply appended to theCLASSPATHused 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.-thtimeout:<#seconds>|-timeoutHandlerTimeout:<#seconds>โ 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 is5minutes (300seconds).-timeout:<number>|-timeoutFactor:<number>โ 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. ๐ข-tl:<#seconds>|-timelimit:<#seconds>โ 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. it's giving โจpool partyโจ
--agent-attempts <number>โ The number of attemptsjtregwill make to access an agent with the desired characteristics, either by creating a new one, or obtaining one from the pool of reusable VMs. The minimum value, and the default value, is1.--max-pool-size <number>โ The maximum number of VMs to keep available in the agent pool. The default is either2xthe concurrency.--pool-idle-timeout <number>โ how many seconds an idle VM can just be sitting there in the pool before it gets automatically closed. bye bestie ๐ค
โจ Test Selection Options โจ
Okay so these are the little filters that let you go "no, not ALL of them, just these ones" โ refine the set of tests you actually execute. ๐ฏ
-a|-automatic|-automagicโ literally any test with/manualin it will NOT be run. manual girlies stay home ๐-bug:<bugid>โ run only those tests which apply to the given bugid.-exclude:<file>|-Xexclude:<file>โ hand it a file specifying tests that should not be run ๐ซ-k:<keywordExpr>|-keywords:<keywordExpr>โ a keyword boolean expression for test selection. the expression can contain keyword names, and you can combine them with&(and),|(or),!(not) and parentheses. it's giving algebra class but slay ๐งฎ-m|-manualโ only tests with/manualwill be run. manual mode girlies rise ๐โโ๏ธ-match:<file>โ hand it a file specifying tests that can be run. it's the inverse of-exclude(iconic duo fr)-noshellโ any tests which contain shell actions will not be run-shellโ only tests which contain shell actions will be run ๐-status:<value>,...โ select tests according to their result in an earlier run. value can be one or more of the values below, separated by commas:passโ tests that passed โจfailโ tests that failed ๐ญnotRunโ tests that have not been runerrorโ tests that could not be run because of errors, or tests that were ignored ๐
โจ Test Mode Options โจ
so every test is a series of steps, and we call those steps actions. the jtreg harness ships with different modes, and the mode decides which JVM gets used to execute each action. the default? brand new JVM for every single action. ok periodt.
-avm|-agentvm|-s|-svm|-samevmโ execute each action using a pool of reusable JVMs, except when an action specifies otherwise. it's giving good performance and reasonable isolation between actions: if a JVM can be reset to a standard state after it's been used, it gets returned to the pool for reuse; otherwise it's discarded and replaced if and when necessary. this mode is generally recommended for all use, no cap ๐ซถ. the JDK to use can be specified with-testjdkor-jdk, except for@compileactions, which use-compilejdkor-jdk. if values are not provided, the environment variableJAVA_HOMEis used.-ovm|-othervmโ 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 math is mathing, bestie ๐ธ). the JDK to use can be specified with-testjdkor-jdk, except for@compileactions, which use-compilejdkor-jdk. if values are not provided, the environment variableJAVA_HOMEis 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 -vmoption; and 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 java -help or java -X. if an option is not applicable to a particular platform or JDK release, it will be rejected. cold. โ๏ธ
--add-modules <module>(,<module>)*โ root modules to resolve in addition to the initial module-agentlib:<libname><[=<options>]โ load native agent library-agentpath:<pathname><[=<options>]โ load native agent library by full pathname-classic|-green|-native|-hotspot|-client|-server|-d32|-d64โ VM Options-compilejdk:<java.home>โ compile all tests using the 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-cpa:<path>|-classpathappend:<path>โ append the provided classPath to theCLASSPATHof 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 theCLASSPATHwould be necessary:-cpa:/usr/local/java/swing-1.0.3/swingall.jar-D<name>=<value>โ define a system property-debug:<option>...โ use this to specify VM options to attach a debugger to a VM running a test. it's similar to-vmoptionsexcept 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-javaoptionsand-vmoptions.-enableassertions|--enableassertions:*|-ea|--ea:*|-disableassertions|--disableassertions:*|-da|--da:*โ enable or disable assertions-enablesystemassertions|-esa|-disablesystemassertions|-dsaโ enable or disable system assertions-javaagent:<jarpath><[=<options>]โ load Java programming language agent-javacoption:<option>โ additional compiler option. you can give this option multiple times. any embedded filenames must be given with absolute paths.-javacoptions:<option>...โ 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. โ ๏ธ
-javaoption:<option>โ 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.-javaoptions:<option>...โ 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. see also-vmoptions.
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. โ ๏ธ
-jdk:<java.home>|-testjdk:<java.home>โ run all tests using the specified JDK. for example,-jdk:/usr/local/java/jdk1.5/solaris-sparc-jitโ enable the JIT for the tests. the JIT is turned on by default.--limit-modules <module>(,<module>)*โ limit the universe of observable modules-nojitโ disable the JIT for the tests.--patch-module <module>=<path>โ specify classes to override module classes-vmoption:<option>โ 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.-vmoptions:<option>...โ 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. this option will be used when compiling and running classes. see also-javaoptions.
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. โ ๏ธ
-X*โ non-standard VM Options.-Xbootclasspath:<path>โ set search path for bootstrap classes and resources-Xbootclasspath/a:<path>โ append to end of bootstrap class path-Xbootclasspath/p:<path>โ prepend in front of bootstrap class path-Xint*|-Xmixed*|-Xcomp*โ non-standard VM Options-XX*|-Xms*|-Xmx*โ non-standard VM Options
โจ Tests โจ
Specifying collections of tests. ๐งช
Testsโ Specifying collections of tests.Testsโ Specifying collections of tests.
at-files
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. sneaky little escape hatch, love that for us ๐
Tests
Specifying collections of tests.
Groups
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. ok careful bestie, spacing matters here โ
Summary
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.
directoryโ all tests found in and under the given directory.file[#id][?string]โ bestie, this one's the multitasker ๐ . Give it just a file and you get every single test in that file โ because yes, one file can hold a whole squad of tests, as long as each test description sits in its own separate comment block. Throw in an id and it narrows down to exactly that one test, no cap.
And then there's ?string ๐ฆ โ if you tack it on, that string gets handed off to the test so it can filter which parts of itself actually run. Typically the string is the name of a method you want executed, iykyk. Oh, and if you give conflicting values for the string on a specific test? The last one you gave wins โ no takebacks, periodt.
[path]:group-nameโ a whole group of tests, defined in theTEST.groupsfile sitting in the testsuite root directory. If you give a path, that's your testsuite root directory, queen โจ. If you don't give one, it defaults to the directory enclosing the current directory. It's giving "I'll find my own way home" energy.@fileโ a file stuffed with values that get treated as if they were right there on the command-line. Sneaky, iconic, lowkey my fave ๐.
Where is this thing even living, and what's it running on ๐ซถ
Installed in /build/reproducible-path/jtreg8-8.3+1+ds1/build/images/jtreg/lib/jtreg.jar
Running on platform version 21.0.12.1 from /usr/lib/jvm/java-21-openjdk-amd64.
Built with Java(TM) 2 SDK, Version 21.0.12.1+1-1-deb13u1-De on Fri, 23 Oct 2026 12:27:33 +0200.
Then the receipts keep coming ๐ โ JT Harness, version 6.0 ea b24 (January 25, 1970), %%PRODUCT_NAME_LONG%%, version %%PRODUCT_VERSION%% %%PRODUCT_MILESTONE%% %%PRODUCT_BUILDNUMBER%% (%%BUILD_DATE%%).
TestNG: testng.jar, guice.jar, jcommander.jar, slf4j-simple.jar, slf4j-api.jar
- TestNG (
testng.jar): version7.5 - TestNG (
guice.jar): version5.1.0 - TestNG (
jcommander.jar): versionunknown - TestNG (
slf4j-simple.jar): version1.7.32 - TestNG (
slf4j-api.jar): version1.7.32
JUnit: junit-platform-console-standalone.jar
JUnit: version unknown
๐ SEE ALSO ๐
Okay so the fullโจdeluxeโจdocumentation for jtreg lives as a Texinfo manual โ the main character of docs, honestly ๐. And if the info and jtreg programs are properly installed at your site, then this command:
info jtreg
should give you access to the complete manual. Go get your girl ๐ฆ๐.
That's a wrap, bestie! This gorgeous little page is from jtreg 8.3-src+1, dated October 2026, and yes she is still out here being section JTREG(1) like the icon she is. Slay, read your man pages, stay curious ๐ธ๐
โจ
๐ฆ where this page comes from
- debian trixie: jtreg8 8.3+1+ds1-2~deb13u1 ยท GPL-2.0-only WITH Classpath exception
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms