You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In that it runs that test on CI. When I inspected the de-compiled compilation output, tests were not present in the submod compile output, but were present in the inlineTests module. So I believe the "compilation concept" works as far as it goes (duplicates the work, but it's CPU work).
Here's the (possibly bonkers) stuff I did in that build to make it work;
Two mill modules, both source generating a testing function...
one generates a function which inlines it's contents - inline def apply[A](a: A) = if(true) a
The other generates a function which... doesn't - inline def apply[A](a: A) = if(false) a exterminates the code as far as I can tell.
Give inlineTests module the same sources as the standard module.
Add the testing framework
to mvnDeps in the testing module
to compileMvnDeps in the "publish" module
marks out of 10?
To be honest I'm surprised / happy that it seemed relatively "easy" to get something.
Are there any obvious reasons this is a terrible idea :-)? Anyone interested in exploring futher?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was reading / thinking about this thread on scala contributors which wants in-source testing / evaluation.
Figured I'd have a go at it in mill for the lolz. Getting "something" seems to be far easier than I would have imagined. Here's an example project.
In line test - https://github.com/Quafadas/fmt_rep/blob/932d55086286f816d8617b3b84093845db6107ea/submod/src/addit.scala#L6
And it seems to "work"... https://github.com/Quafadas/fmt_rep/actions/runs/20665359528/job/59336359516
In that it runs that test on CI. When I inspected the de-compiled compilation output, tests were not present in the
submodcompile output, but were present in theinlineTestsmodule. So I believe the "compilation concept" works as far as it goes (duplicates the work, but it's CPU work).Here's the (possibly bonkers) stuff I did in that build to make it work;
inline def apply[A](a: A) = if(true) ainline def apply[A](a: A) = if(false) aexterminates the code as far as I can tell.inlineTestsmodule the same sources as the standard module.mvnDepsin the testing modulecompileMvnDepsin the "publish" modulemarks out of 10?
To be honest I'm surprised / happy that it seemed relatively "easy" to get something.
Are there any obvious reasons this is a terrible idea :-)? Anyone interested in exploring futher?
Beta Was this translation helpful? Give feedback.
All reactions