This message was deleted.
# community-support
s
This message was deleted.
v
You could write your own test engine for JUnit Platform, then any tool supporting JUnit 5 also supports your tests. (It is easier for narrow cases than it sounds 😄)
a
hmmmm okay… So I could implement the TestEngine interface (example: https://github.com/junit-team/junit5/blob/r5.9.2/documentation/src/test/java/example/CustomTestEngine.java) and then throw a ‘test failed exception’
v
Sounds right, yes
a
and then figure out a way to JavaExec launch a local class?
v
What for?
a
I assume at some point I would need to execute the TestEngine from within a Test task
v
That is what JUnit platform does for you. If you for example have the custom test engine in your test source set and did not restrict which tests engines should run, it is automatically run like any other test engine.
a
ahhh, but I don’t want to define the TestEngine from within a source set. I want to have a Gradle task that does this
So I want to dynamically define a Gradle task that will produce a ‘TestDescriptor’ so any TestListener will be able to pick it up
v
Make a dedicated source set with your test engine, make a dedicated
Test
task running that source set. (Or actually use the JVM Test Suites plugin to let Gradle define all that for you, except for the actual test engine)
a
v
Urgh, that's not what I meant. But well, if it works for you and you are fine with using internal API. 👌
a
I understood what you mean, but it wasn’t what I was asking for :)
v
I don't agree, but that's ok. 😄
a
it’s nice to be able to dynamically define a test without needing JUnit or an additional source set, because perhaps the subproject I want to test isn’t a Java project
🤷 1