Could we get the standard testing library to suppo...
# test
j
Could we get the standard testing library to support
assume()
? Granted I'd prefer different naming, but that's less important than having it supported.
o
That would mean rewriting everything from a static test setup to dynamically enabled tests, right?
j
No, it would mean that a test can result in "not tested" instead of just "success", "failure", or "exception"
o
In kotlin-test, the
@Ignore
annotation will skip your test, statically. That's not what you're looking for, right?
j
No, it is not. I want to read my environment at test time and determine that the test cannot be run on the machine, and should therefore report as "not tested". I don't need to be able to dynamically declare tests; just be able to report that we weren't able to run this specific test.
o
That's what I was referring to: Dynamically enabled tests. That would imply an architecture that differs from kotlin-test. You'll find it in other test frameworks like Kotest or TestBalloon (which I authored).
j
https://junit.org/junit4/javadoc/4.12/org/junit/Assume.html No, this isn't dynamically enabled or created - it's simply an alternate return value from the test. The test still runs, and it's not creating or removing tests, it's just responding with "there's no useful information from the execution of the test". AFAIK this wouldn't require any significant alteration of the library whatsoever.
o
Making this work with multiplatform targets is not trivial: E.g. on JS targets, kotlin-test uses Mocha, which does not support disabling at test time.
j
Bummer. While you could stub in 'no result' to be marked as a success for other platforms, that's not doing it right. All right, guess I'll have to pull out a framework then.
👍 1