New feature: rerun instructions

Jonathan Gibbons jonathan.gibbons at oracle.com
Sun Aug 11 14:01:15 PDT 2013


The following changeset provides an initial version of a new feature in 
jtreg, to provide a script to rerun a test.  The intent is to make it 
simpler to run a test outside the jtreg harness. Although this is 
otherwise reasonably simple for standard "main program" tests, it may be 
less obvious to the uninitiated how to rerun JUnit and TestNG tests.

http://hg.openjdk.java.net/code-tools/jtreg/rev/b9e916f66af3

As each action within a test is executed, a new block (labeled "rerun") 
is written into the .jtr file. This block contains one or more commands 
in bash syntax to more-or-less replicate the effect of the action 
outside the harness.

If the test was being run in othervm mode, the commands should be 
reasonably accurate.  If the test was being run in agentvm or samevm the 
commands will be more of an approximate, since there is no attempt the 
replicate the classloaders used by jtreg to run the test.

Although there is no attempt to replicate class loaders, jtreg executes  
some classes via "wrapper classes". The use of these wrapper classes is 
included in the rerun script.

Currently, the "rerun" blocks are enabled by default.  This does mean 
that .jtr files are bigger as a result, and the block does appear in the 
output generated by -verbose:all.   Given this, it may be desirable to 
make the presence of the "rerun" blocks optional.

Within the .jtr file itself, the content of all blocks is encoded such 
that non-ASCII characters are encoded as \\u/xxxx/, and \ is encoded as 
\\. (This cannot reasonably be changed.)   As a result, those commands 
in the rerun block which span multiple lines have the end-of-line \ 
encoded as \\. To extract the rerun commands, you can either cut and 
paste from the .jtr file (and fixup the \ characters) or you can use an 
experimental new jtreg command line option "-show:rerun /test-name/". 
The /test-name/ argument should be the name of a test within the test 
suite (not the name of a .jtr file.)






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/jtreg-use/attachments/20130811/972ca954/attachment.html 


More information about the jtreg-use mailing list