addQuitProc now works with closures, and c, js(node/browser) backend; fix some bugs in testament (#14342)

* make addQuitProc great again

* fix bugs in testament

* fix test

* change 2016 => 2020

* addQuitProc => addExitProc + locks

* move to std/exitprocs
This commit is contained in:
Timothee Cour 2020-06-16 02:43:48 -07:00 • committed by GitHub
commit dfe51d10a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 117 additions and 44 deletions

View file

@ -87,6 +87,13 @@ const
targetToExt*: array[TTarget, string] = ["nim.c", "nim.cpp", "nim.m", "js"]
targetToCmd*: array[TTarget, string] = ["c", "cpp", "objc", "js"]
proc defaultOptions*(a: TTarget): string =
case a
of targetJS: "-d:nodejs"
# once we start testing for `nim js -d:nimbrowser` (eg selenium or similar),
# we can adapt this logic; or a given js test can override with `-u:nodejs`.
else: ""
when not declared(parseCfgBool):
# candidate for the stdlib:
proc parseCfgBool(s: string): bool =