There is no issue here and the tests that used to "work" with jtreg b05 didn't do what you thought they did. Just look at the .jtr file and see what jtreg actually did before.

First, you need to realize that "@build" is a shorthand for "@run build". The section on "shorthands" is in the very next section of the spec after the section on "defaults" that you mention.

Shorthand       Equivalent
@build <classname>+       @run build <classname>+
@clean <classname>+       @run clean <classname>+
@compile<option>* <arg>+    @run compile<option>* <arg>+
@ignore <word>*   @run ignore <word>*



Now consider what a test containing just @build does. @build is a shorthard for "@run build" and so after you expand the shorthand, it is /not/ a candidate for the default action with the part of the spec you reference. Therefore there is no attempt to actually run the class that was built. That was the old behavior up through jtreg b05. Clearly, that old behavior is silly -- it didn't actually run the test. That is the behavior you seem to be asking me to restore! Once we realized the issue, the simplest fix was to detect and report this situation, which is the current behavior. If you just tell jtreg to build the test (and not run it) that will be now reported as an error.

I believe that the current state is a good one, even if it means users having to fix tests that were previously dysfunctional.

-- Jon

On 05/06/2015 07:11 AM, Alexander Scherbatiy wrote:

This is the known issue in jtreg: CODETOOLS-7901378 Test result error when @build used without @run main
   https://bugs.openjdk.java.net/browse/CODETOOLS-7901378

It is closed as not an issue but I would argue against it. It definitely worked in jtreg 4.1 fcs b05.
 Why tests which pass with jtreg 4.1 b05 started to fail in b11?

 Thanks,
 Alexandr.


On 5/6/2015 3:29 PM, Sergey Bylokhov wrote:
Hello,
It seems that this is a bug in the jtreg because according its specification:

"If no |@run| tags are present in a defining file, a default is assumed depending upon the file's filename extension"

File type     Default     Notes
.java |@run main <name>| <name> is the name of the file without the ".java" suffix
.sh     |@run shell <file>|
.html     |@run applet <file>|


Jonathan do you know something about this issue?

On 06.05.15 9:18, pooja chopra wrote:
Hello,
Please review a fix for issue:
8079428 [TEST_BUG] Test javax/swing/plaf/windows/6921687/bug6921687.java
Test bug fix.
https://bugs.openjdk.java.net/browse/JDK-8079428
The webrev is : http://cr.openjdk.java.net/~pchopra/8079428/webrev.00/

Thanks,
Pooja


--
Best regards, Sergey.


Reply via email to