Detect :test errors

This commit is contained in:
Anton Dyudin 2018-03-09 14:25:43 -08:00
parent dfcccfdc8a
commit aa3ddfd53d
2 changed files with 13 additions and 4 deletions

View File

@ -25,6 +25,8 @@ export class Urbit
, 200
#
unpipe: ~> @pty.socket.unpipe!; @ # TODO separate "listeners" stream
every: (re, cb)~>
@pty.pipe (new stream-snitch re).on "match" cb
expect: (re)~>
new Promise (resolve)~>
@pty.pipe (new stream-snitch re).once "match" resolve

View File

@ -6,7 +6,7 @@ Promise.resolve urbit
urb.note "Booting urbit"
Promise.race [
urb.expect ERROR .then ->
urb.warn "Error detected"
urb.warn "Boot error detected"
throw Error "Stack trace while booting"
, do
<- urb.expect /dojo> / .then
@ -15,12 +15,19 @@ Promise.resolve urbit
]
.then (urb)->
urb.note "Testing compilation"
# TODO tally ford stack traces
# urb.warn etc
errs = {} #REVIEW stream reduce?
cur = "init"
urb.every />> (\/[ -~]+)/ ([_,path])-> cur := path
urb.every ERROR, ->
unless errs[cur]
errs[cur] = true
urb.warn "Compile error detected"
#
<- urb.line "|start %test" .then
<- urb.line ":test [%cores /]" .then
<- urb.expect-echo "%compilation-tested" .then
#if tally => throw # a fit
errs := Object.keys errs
if errs.length => throw Error "in #errs"
urb.unpipe!
.then (urb)->
urb.note "Running /===/tests"