Native tests in the JDK?!

Claes Redestad claes.redestad at oracle.com
Wed Jun 21 09:51:03 UTC 2017


Hi jdk10-dev,

8181147 added build infrastructure support to test native code in the 
JDK core libraries, with a test specifically exercising String 
encoding/decoding methods in libjava.

During review on core-libs-dev and build-dev the issue was raised that 
this might surprise some users (and test systems) with some variant of 
"Error: Use -nativepath to specify the location of native code", since 
jtreg will expect you to build a test library and add it using -nativepath.

Consider this a late notification that this is something you might 
unexpectedly run into.

Making it harder to test locally isn't nice, but thankfully there's new, 
helpful support in the jdk10 makefiles to do all the required test setup 
and build automatically (tips many hats at Magnus Ihse-Bursie), which 
makes adapting to this (and any future additions) a breeze:

$ make run-test TEST=jdk/test/java/lang

Alternatively, if one has to run jtreg directly and can't be bothered 
with any of this - because reasons - one may add the flag -k:!native to 
exclude any and all native tests.

Thanks/Sorry!

/Claes


More information about the jdk10-dev mailing list