Closed bric3 closed 2 years ago
I'd like something closer to the JavaExecSpec
, but the jmh
block is not extending it.
environment(mapOf("JAVA_HOME" to System.getenv("JAVA_HOME")))
environment("JAVA_HOME", System.getenv("JAVA_HOME"))
And I am not sure how best to proceed. Same for the tests.
Wow I wonder how the PR description was empty, was it me that forgot 🤔🤦 ? I just rebased this pr on the latest from master.
Would be great to have a test of some kind. Could be a benchmark which spits out an environment variable via System.out and that the test would search for in the output.
Done
This proposed change is about the support of environment variables when launching the jmh jar. (Because the
org.openjdk.jmh.annotations.Fork
don't allow to pass environments).The jmh block is of type
JmhParameters
andWithJavaToolchain
so in order to support a similar API asJavaExecSpec
it has to be explicitly exposed.Current alternative The currently API does not allow this so we have to executes the jmh jar outside gradle.
Note I didn't see a functional test with jmh options so I'm not sure how you'd want to test that.