On Wed, 10 Jan 2024 15:10:58 GMT, Claes Redestad <redes...@openjdk.org> wrote:

> JMH microbenchmarks may have dependencies on artifacts in the test image 
> outside of the benchmarks.jar. This includes native libraries (built into 
> `$TEST_IMAGE/micro/native`) and may soon include other test libraries like 
> wb.jar (built into `$TEST_IMAGE/lib-test/`)
> 
> By moving execution to the test image root (currently we run out of the 
> `make` directory) we can make do with relative paths, which means benchmark 
> can supply a build-time constant flag themselves rather than have the test 
> runner provide it for you. And needing to be explicit about external 
> dependencies is good, I think.
> 
> Taken together this makes the benchmarks.jar more self-contained and simpler 
> to run: all you need is to run `java -jar micro/benchmarks.jar` from the test 
> image root.
> 
> This patch also drive-by fixes some lang.foreign tests that were printing 
> warnings due to a missing `--enable-native-access=ALL-UNNAMED` flag.

In principle, I think tests should be executed from their corresponding 
test-support directory. (I think there is some JBS issue for this that's been 
around for some while.) The rationale is that this is a good directory for any 
arbitrary output generated from the test, for files that are just dumped in the 
current directory. (This happens from time to time with tests.)

But if executing from the test image improves the code quality of the tests, I 
am not going to argue heavily against it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17349#issuecomment-1886933844

Reply via email to