Hi Paul,
The reason we stick on standard jtreg tests is because it is simpler.
For us, a java test is not a unit test, it is an application. :)
I agree with you that when writing and debugging java code, I would
choose testng over jtreg and run and debug it inside my java IDE. But
debugging the VM is instead done with a native debugger and what the
framework gives you for java development, becomes a level of indirection
in VM land. Just adding the test class as argument to the java launcher
where a main method exists is preferred.
Cheers,
Stefan
Den 2015-12-02 kl. 09:52, skrev Paul Sandoz:
Hi Christian,
On 1 Dec 2015, at 20:19, Christian Tornqvist
<christian.tornqv...@oracle.com
<mailto:christian.tornqv...@oracle.com>> wrote:
Hi Paul,
Tests in hotspot/test/runtime needs to be jtreg tests.
They are jtreg tests. They are require to be run (re: “launched") with
jtreg see:
http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8143628-unsafe-native-hotspot/webrev/test/runtime/Unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java.html
<http://cr.openjdk.java.net/%7Epsandoz/jdk9/JDK-8143628-unsafe-native-hotspot/webrev/test/runtime/Unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java.html>
24 /*
25 * @test
26 * @bug 8143628
27 * @summary Test unsafe access for boolean
28 * @modules java.base/jdk.internal.misc
29 * @run testng/othervm -Diters=100 -Xint
JdkInternalMiscUnsafeAccessTestBoolean
30 * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1
JdkInternalMiscUnsafeAccessTestBoolean
31 * @run testng/othervm -Diters=20000 -XX:-TieredCompilation
JdkInternalMiscUnsafeAccessTestBoolean
32 * @run testng/othervm -Diters=20000
JdkInternalMiscUnsafeAccessTestBoolean
33 */
That’s the point i was making with:
jtreg is to testng as launcher is to library
Note the use of the "@modules java.base/jdk.internal.misc”. That’s
gonna be important later on.
Looking at your tests, I can't see a reason why they can't easily be
modified to be jtreg tests instead?
That’s not the point. There is a principle here about what test
libraries one can or cannot use with the test in a particular area of
a particular repo. At the moment i am not hearing any consistent and
solid technical argument as to why testng cannot be used for HotSpot
runtime tests.
Paul.