jpm test now starts a new interpreter per test.

This should help with setup/teardown semantics, especially
with native modules.
This commit is contained in:
Calvin Rose 2019-09-16 00:47:54 -05:00
parent 16127fc55c
commit f2ba91899f
1 changed files with 3 additions and 1 deletions

View File

@ -783,7 +783,9 @@ int main(int argc, const char **argv) {
(case (os/stat ndir :mode)
:file (when (string/has-suffix? ".janet" ndir)
(print "running " ndir " ...")
(dofile ndir :exit true))
(def result (os/execute [(dyn :executable "janet") ndir] :p))
(when (not= 0 result)
(os/exit result)))
:directory (dodir ndir))))
(dodir "test")
(print "All tests passed.")))