-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addQuitProc
now works with closures, and c, js(node/browser) backend; fix some bugs in testament
#14342
Conversation
7225082
to
96c8087
Compare
Please don't merge the two separate mechanisms into one. |
It would be quite useful if the same treatment is applied to procs such as |
6d37566
to
7347e15
Compare
7347e15
to
6a9fbeb
Compare
this is left as future work @Araq |
(in particular ordering issue)
testament fixes
testament/testament r tfoo
now correctly adds target-specific default options (for now just -d:nodejs for js), just like it does when running withoutr
(eg the js test suite runs with -d:nodejs but it didn't add -d:nodejs fortestament r
); this was needed so that this works:nim r testament/testament r tests/stdlib/tquitprocs.nim
(+ others)tests/stdlib/tquitprocs.nim JS--lib:lib
=>tests/stdlib/tquitprocs.nim JS --lib:lib
caveat
caveat is pre-existing from when addQuitClosure was added, and seems consistent with the preexisting doc comment:
In case of an unhandled exception the exit handlers should not be called explicitly
, although I think behavior should be changed (in future PR)if a registered quitProc raises during teardown, subsequent procs won't be called; one option (in subsequent PR) would be to enhance this by wrapping each call into a
try ... except
and keeping track of at least one raised; and then callquit(0)
orquit(1)
depending on thatCI failures unrelated
TODO for future PR's