From aa3ddfd53d2f5d3e138c08986876ab92a1a86c36 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 9 Mar 2018 14:25:43 -0800 Subject: [PATCH] Detect :test errors --- .travis/runner.ls | 2 ++ .travis/test.ls | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis/runner.ls b/.travis/runner.ls index ac2a944ff..e566eaac5 100644 --- a/.travis/runner.ls +++ b/.travis/runner.ls @@ -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 diff --git a/.travis/test.ls b/.travis/test.ls index b8568bfb2..290467472 100644 --- a/.travis/test.ls +++ b/.travis/test.ls @@ -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"