jbang test
nothing solid yet but just writing down ideas from a chat with @quintesse
It would be interesting introducing a jbang test command
it could start small using JUnit Console Runner and then later possibly explore JUnit Launch support or even full IDE like general testing support for more than junit...but lets start small.
Idea is that jbang test calculatorTest.java would run it as if it was buit and run with jbang but then use Console Runner to execute the tests defined in here using something like ConsoleLauncher.main( "execute", "--scan-class-path", "-cp", jarsList, "--select-classes"....);
Syntax would be like jbang run but just provide a custom generated main method.
So its jbang test <scriptRef> like always and <scriptRef> is the "root" of what will be run. You can add additional deps using --deps or source with --sources.
Having this would allow for quite custom and powerful test running.
jbang test could have ways to specify reporters for different ways of visualizing results.
jbang test --reporter=dot calculatorTest.java
jbang test could even run existing testsuites from mavne/gradle projects as long as the deps are available in some jar referencable format.
Also with jbang test deps can declare they only are relevant for tests once #2126 is availble
as it would know what tests to run and which are from sources and which are binaries could even make ability for continous running the tests; have "re-run" of failed tests etc.