Console launcher should support `--version`
sormuras opened this issue · comments
The junit
console launcher should support a --version
option and print its version.
Perhaps it should also print the version of each discoverable test engine?
There's support for version options in Picocli: https://picocli.info/#_version_help
Related option already in place: --list-engines
Looks very good to me!
java -jar junit-platform-console-standalone-1.11.0-20240516.144734-223.jar --version
JUnit Platform Console Launcher 1.11.0-SNAPSHOT
JVM: 23-ea (Oracle Corporation OpenJDK 64-Bit Server VM 23-ea+21-1723)
OS: Windows 11 10.0 amd64
However, running junit
on the module path does not look so good to me.
org.junit.platform.console/junit@1.11.0-M2 --version
JUnit Platform Console Launcher null
JVM: 22.0.1 (Oracle Corporation OpenJDK 64-Bit Server VM 22.0.1+8-16)
OS: Windows 11 10.0 amd64
This
returns
null
.
We should fist try a ModuleVersionProvider
on Java 9+, like we do here:
And resort to a non-null fallback value.
@sormuras, can you please create a new issue to address that in 5.11 M3?