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
testament uses testStdlib to compile and run stdlib modules.
It relies on this logic:
if "when isMainModule" notin contents:
testObj.spec.action = actionCompile
This is ok-ish but can have false positives (if appears in a comment), or false negatives, eg with when defined(osx) and isMainModule.
Instead of fixing this logic, a much better way is to extend the megatest idea from #9581 to stdlib modules.
This can be done as follows, without having to patch any stdlib module:
add each stdlib file to megatest (minus a blacklist of non-joinable tests)
patch compiler so isMainModule is equal to true when -d:isMainModuleIsAlwaysTrue is provided
That'll give the speedup benefit from #9581, and make that logic less fragile
note
on my machine,
nim c -r testament/tester pcat lib # 102 seconds
nim c -r testament/tester all # 390 seconds
so we can save roughly 25% with this (minus time to compile/run the megatest)
But this saving will become more significant as we address remaining issues, eg I have ideas for joining certain failing tests using the new --errorMax:N flag (will discuss in other issue)
The text was updated successfully, but these errors were encountered:
This is a followup from #9581
testament uses
testStdlib
to compile and run stdlib modules.It relies on this logic:
This is ok-ish but can have false positives (if appears in a comment), or false negatives, eg with
when defined(osx) and isMainModule
.Instead of fixing this logic, a much better way is to extend the
megatest
idea from #9581 to stdlib modules.This can be done as follows, without having to patch any stdlib module:
isMainModule
is equal totrue
when-d:isMainModuleIsAlwaysTrue
is providedThat'll give the speedup benefit from #9581, and make that logic less fragile
note
on my machine,
so we can save roughly 25% with this (minus time to compile/run the megatest)
But this saving will become more significant as we address remaining issues, eg I have ideas for joining certain failing tests using the new
--errorMax:N
flag (will discuss in other issue)The text was updated successfully, but these errors were encountered: