2018-03-09 23:47:45 +03:00
|
|
|
{Urbit,ERROR} = require './runner.ls'
|
2018-03-09 22:32:17 +03:00
|
|
|
|
|
|
|
urbit = new Urbit <[-B urbit.pill -A .. -cFI zod zod]>
|
|
|
|
Promise.resolve urbit
|
|
|
|
.then (urb)->
|
|
|
|
urb.note "Booting urbit"
|
2018-03-09 22:55:07 +03:00
|
|
|
Promise.race [
|
2018-03-09 23:47:45 +03:00
|
|
|
urb.expect ERROR .then ->
|
2018-03-10 01:25:43 +03:00
|
|
|
urb.warn "Boot error detected"
|
2018-03-09 22:55:07 +03:00
|
|
|
throw Error "Stack trace while booting"
|
|
|
|
, do
|
|
|
|
<- urb.expect /dojo> / .then
|
|
|
|
<- urb.expect-echo "%dojo-booted" .then
|
2018-03-10 01:24:00 +03:00
|
|
|
urb.unpipe!
|
2018-03-09 22:55:07 +03:00
|
|
|
]
|
2018-03-09 22:32:17 +03:00
|
|
|
.then (urb)->
|
|
|
|
urb.note "Testing compilation"
|
2018-03-10 01:25:43 +03:00
|
|
|
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"
|
|
|
|
#
|
2018-03-09 22:32:17 +03:00
|
|
|
<- urb.line "|start %test" .then
|
|
|
|
<- urb.line ":test [%cores /]" .then
|
|
|
|
<- urb.expect-echo "%compilation-tested" .then
|
2018-03-10 01:25:43 +03:00
|
|
|
errs := Object.keys errs
|
|
|
|
if errs.length => throw Error "in #errs"
|
2018-03-10 01:24:00 +03:00
|
|
|
urb.unpipe!
|
2018-03-09 22:32:17 +03:00
|
|
|
.then (urb)->
|
|
|
|
urb.note "Running /===/tests"
|
|
|
|
# TODO tally FAILED and CRASHED
|
|
|
|
<- urb.line "+test, =defer |, =seed `@uvI`(shaz %reproducible)" .then
|
|
|
|
<- urb.expect-echo "%ran-tests" .then
|
|
|
|
#if tally => throw # a fit
|
2018-03-10 01:24:00 +03:00
|
|
|
urb.unpipe!
|
2018-03-09 22:32:17 +03:00
|
|
|
.then ->
|
|
|
|
urbit.exit 0
|
|
|
|
.catch (err)->
|
|
|
|
<- urbit.wait-silent!then # assumptions?
|
2018-03-09 22:55:07 +03:00
|
|
|
urbit.warn "Test aborted:" err
|
2018-03-09 22:32:17 +03:00
|
|
|
urbit.exit 1
|