mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
-test, -build-file, -build-mark, -build-cast
This commit is contained in:
parent
8d3a497bb9
commit
a705954b08
@ -417,7 +417,7 @@
|
||||
?~ riot
|
||||
(strand-fail %build-file >arg< ~)
|
||||
?> =(%vase p.r.u.riot)
|
||||
(pure:m q.r.u.riot)
|
||||
(pure:m !<(vase q.r.u.riot))
|
||||
:: +build-mark: build a mark definition to a $dais
|
||||
::
|
||||
++ build-mark
|
||||
|
@ -10,6 +10,45 @@
|
||||
+$ test-func (trap tang)
|
||||
--
|
||||
|%
|
||||
++ run-test
|
||||
:: executes an individual test.
|
||||
|= [pax=path test=test-func]
|
||||
^- [ok=? =tang]
|
||||
=+ name=(spud pax)
|
||||
=+ run=(mule test)
|
||||
?- -.run
|
||||
%| :- %| :: the stack is already flopped for output?
|
||||
;: weld
|
||||
p.run
|
||||
`tang`[[%leaf (weld "CRASHED " name)] ~]
|
||||
==
|
||||
%& ?: =(~ p.run)
|
||||
&+[[%leaf (weld "OK " name)] ~]
|
||||
:: Create a welded list of all failures indented.
|
||||
:- %|
|
||||
%- flop
|
||||
;: weld
|
||||
`tang`[[%leaf (weld "FAILED " name)] ~]
|
||||
::TODO indent
|
||||
:: %+ turn p:run
|
||||
:: |= {i/tape}
|
||||
:: ^- tank
|
||||
:: [%leaf (weld " " i)]
|
||||
p.run
|
||||
==
|
||||
==
|
||||
:: +filter-tests-by-prefix
|
||||
::
|
||||
++ filter-tests-by-prefix
|
||||
|= [prefix=path tests=(list test)]
|
||||
^+ tests
|
||||
::
|
||||
=/ prefix-length=@ud (lent prefix)
|
||||
::
|
||||
%+ skim tests
|
||||
::
|
||||
|= [=path *]
|
||||
=(prefix (scag prefix-length path))
|
||||
:: +resolve-test-paths: add test names to file paths to form full identifiers
|
||||
::
|
||||
++ resolve-test-paths
|
||||
|
12
pkg/arvo/ted/build-cast.hoon
Normal file
12
pkg/arvo/ted/build-cast.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
/- spider
|
||||
/+ strandio
|
||||
=, strand=strand:spider
|
||||
^- thread:spider
|
||||
|= arg=vase
|
||||
=/ m (strand ,vase)
|
||||
^- form:m
|
||||
=+ !<([a=mark b=mark ~] arg)
|
||||
;< =bowl:spider bind:m get-bowl:strandio
|
||||
=/ bek=beak [our q.byk da+now]:bowl
|
||||
;< =tube:clay bind:m (build-cast:strandio bek a b)
|
||||
(pure:m !>(tube))
|
11
pkg/arvo/ted/build-file.hoon
Normal file
11
pkg/arvo/ted/build-file.hoon
Normal file
@ -0,0 +1,11 @@
|
||||
/- spider
|
||||
/+ strandio
|
||||
=, strand=strand:spider
|
||||
^- thread:spider
|
||||
|= arg=vase
|
||||
=/ m (strand ,vase)
|
||||
^- form:m
|
||||
=+ !<([pax=path ~] arg)
|
||||
;< =bowl:spider bind:m get-bowl:strandio
|
||||
=/ bek=beak [our q.byk da+now]:bowl
|
||||
(build-file:strandio bek (flop pax))
|
12
pkg/arvo/ted/build-mark.hoon
Normal file
12
pkg/arvo/ted/build-mark.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
/- spider
|
||||
/+ strandio
|
||||
=, strand=strand:spider
|
||||
^- thread:spider
|
||||
|= arg=vase
|
||||
=/ m (strand ,vase)
|
||||
^- form:m
|
||||
=+ !<([mak=mark ~] arg)
|
||||
;< =bowl:spider bind:m get-bowl:strandio
|
||||
=/ bek=beak [our q.byk da+now]:bowl
|
||||
;< =dais:clay bind:m (build-mark:strandio bek mak)
|
||||
(pure:m !>(dais))
|
24
pkg/arvo/ted/test.hoon
Normal file
24
pkg/arvo/ted/test.hoon
Normal file
@ -0,0 +1,24 @@
|
||||
/- spider
|
||||
/+ strandio, *test-runner
|
||||
=, strand=strand:spider
|
||||
^- thread:spider
|
||||
|= arg=vase
|
||||
=/ m (strand ,vase)
|
||||
^- form:m
|
||||
=/ paz=(list path) (turn !<((list path) arg) |=(path [%tests +<]))
|
||||
;< =bowl:spider bind:m get-bowl:strandio
|
||||
=/ bek=beak [our q.byk da+now]:bowl
|
||||
=| test-arms=(map path (list test-arm))
|
||||
|- ^- form:m
|
||||
=* gather-tests $
|
||||
?^ paz
|
||||
;< cor=vase bind:m (build-file:strandio bek hoon+(flop i.paz))
|
||||
=. test-arms (~(put by test-arms) i.paz (get-test-arms cor))
|
||||
gather-tests(paz t.paz)
|
||||
%- pure:m !> ^= ok
|
||||
%+ roll (resolve-test-paths test-arms)
|
||||
|= [[=path =test-func] ok=_`?`%&]
|
||||
^+ ok
|
||||
=/ res (run-test path test-func)
|
||||
%- (slog (flop tang.res))
|
||||
&(ok ok.res)
|
Loading…
Reference in New Issue
Block a user