shrub/app/test.hoon

182 lines
4.6 KiB
Plaintext
Raw Normal View History

::
|%
++ test
$% [%arvo ~] ::UNIMPLEMENTED
[%marks ~] ::UNIMPLEMENTED
[%cores p=path]
[%hoons p=path]
[%names p=path]
2018-03-28 03:38:34 +03:00
[%renders p=path]
==
--
::
|%
++ join
|= {a/cord b/(list cord)}
?~ b ''
(rap 3 |-([i.b ?~(t.b ~ [a $(b t.b)])]))
2018-03-28 03:30:31 +03:00
::
++ fake-fcgi [%many [%blob *cred:eyre] $+[%n ~] ~]
--
::
2017-02-14 01:57:07 +03:00
=, gall
=, ford
2017-11-14 03:31:46 +03:00
=, format
2016-11-17 02:05:24 +03:00
|_ {bowl $~}
::
2016-11-17 02:05:24 +03:00
++ peek _~
::
++ report-error
|= [=spur bud=build-result]
^- tang
=/ should-fail (~(get by failing) (flop spur))
?- -.bud
%success
?~ should-fail ~
:~ leaf+"warn: expected failure, {<`tape`u.should-fail>}"
leaf+"warn: built succesfully"
?: ?=(%bake +<.bud)
(sell q.cage.bud)
?> ?=(%core +<.bud)
(sell vase.bud)
==
::
%error
?^ should-fail
~[>[%failed-known `tape`(weld "TODO: " u.should-fail)]<]
(flop message.bud)
==
::
2017-11-14 03:31:46 +03:00
++ made-a-core
|= [=spur @da res=made-result]
2017-11-14 03:31:46 +03:00
:_ +>.$
?: ?=([%incomplete *] res)
~& incomplete-core+spur
((slog tang.res) ~)
?. ?=([%complete %success *] res)
~& unsuccessful-core+spur
((slog message.build-result.res) ~)
?> ?=(^ +<.build-result.res)
%- (slog (report-error spur head.build-result.res))
=/ nex=(list ^spur)
=< p
2019-05-09 05:05:21 +03:00
;; [%success %$ %cont * p=(list ^spur)]
tail.build-result.res
2018-03-08 06:19:42 +03:00
?~ nex ~&(%cores-tested ~)
2017-11-14 03:31:46 +03:00
[ost (build-core nex)]~
::
++ build-core
|= [a=spur b=(list spur)]
~& >> (flop a)
:- %build
2018-12-13 09:34:12 +03:00
:+ a-core+a
live=|
^- schematic:ford
:- [%core now-disc %hoon a]
[%$ %cont !>(b)]
2016-11-17 02:05:24 +03:00
::
2018-03-28 03:30:31 +03:00
++ made-a-rend
|= [=spur @da res=made-result]
2018-03-28 03:30:31 +03:00
:_ +>.$
?> ?=([ren=term ~] spur)
=+ `[ren=term pax=path]`?~(spur !! spur)
?: ?=([%incomplete *] res)
~& incomplete-core+spur
((slog tang.res) ~)
?. ?=([%complete %success *] res)
~& unsuccessful-core+spur
((slog message.build-result.res) ~)
?> ?=(^ +<.build-result.res)
%- (slog (report-error /[ren]/ren head.build-result.res))
=/ nex=(list term)
=< p
2019-05-09 05:05:21 +03:00
;; [%success %$ %cont * p=(list term)]
tail.build-result.res
2018-03-28 03:30:31 +03:00
?~ nex ~&(%rens-tested ~)
[ost (build-rend nex)]~
::
++ build-rend
|= [a=term b=(list term)]
~& >> [%ren a]
:- %build
2018-12-13 09:34:12 +03:00
:+ a-rend+/[a]
live=|
^- schematic:ford
=/ bem=beam (need (de-beam %/example))
=/ =rail [[p q] s]:bem
:- [%bake a fake-fcgi rail]
[%$ %cont !>(b)]
2018-03-28 03:30:31 +03:00
::
2016-11-17 02:05:24 +03:00
++ poke-noun
|= a=test
2017-11-14 03:31:46 +03:00
:_ +>
?- -.a
2018-03-28 03:41:52 +03:00
%arvo ~|(%stub !!) ::basically double solid?
2018-03-28 03:38:34 +03:00
%hoons ~&((list-hoons p.a ~) ~)
%cores [ost (build-core [- +]:(list-hoons p.a skip=(sy /sys /ren /tests ~)))]~
%names ~&((list-names p.a) ~)
2018-03-28 03:41:52 +03:00
%marks ~|(%stub !!) ::TODO restore historical handler
%renders ~&(%all-renderers-are-disabled ~)
==
::
++ list-names
|= a/path ^- (list term)
2018-03-28 03:38:34 +03:00
=/ hon (list-hoons a ~)
%+ turn hon
|= b=spur
(join '-' (slag 1 (flop b)))
2017-11-14 03:31:46 +03:00
::
++ list-hoons
2018-03-28 03:38:34 +03:00
|= [under=path skipping=(set spur)] ^- (list spur)
=/ sup (flop under)
~& [%findining-hoons under=under]
2017-11-14 03:31:46 +03:00
|- ^- (list spur)
2017-11-30 00:32:22 +03:00
%- zing
%+ turn
=- (sort ~(tap by -) aor)
dir:.^(arch %cy (en-beam now-beak sup))
|= [a=knot ~] ^- (list spur)
2017-11-14 03:31:46 +03:00
=. sup [a sup]
2018-03-28 03:38:34 +03:00
?: (~(has in skipping) (flop sup))
~&(> [(flop sup) %out-of-scope] ~)
=/ ded (~(get by skip-completely) (flop sup))
2018-03-28 00:34:58 +03:00
?^ ded
~&(> [(flop sup) %skipped `tape`u.ded] ~)
2017-11-30 00:32:22 +03:00
?~ [fil:.^(arch %cy (en-beam now-beak [%hoon sup]))]
^$
~& (flop sup)
[sup ^$]
2016-11-17 02:05:24 +03:00
::
++ now-beak %_(byk r [%da now])
++ now-disc `disc:ford`[p.byk q.byk]
++ skip-completely
2018-03-28 00:34:58 +03:00
^~ ^- (map path tape)
%- my :~ ::TODO don't hardcode
2018-03-28 03:30:31 +03:00
:- /ren/css "not meant to be called outside /web/pack"
:- /ren/js "not meant to be called outside /web/pack"
:- /ren/run "not meant to be called except on a (different) hoon file"
2018-08-01 02:31:30 +03:00
:- /ren/collections "temporarily disabled"
2019-01-08 02:52:06 +03:00
:- /ren/rss-xml "scrys into eyre"
:- /ren/test-gen "temporarily disabled"
:- /ren/urb "temporarily disabled"
2018-07-31 08:24:32 +03:00
:- /ren/x-urb "temporarily disabled"
:- /ren/x-htm "temporarily disabled"
:- /ren/x-collections-snip "temporarily disabled"
:- /ren/x-collections-json "temporarily disabled"
::
:- /web/landscape "/$ doensn't work in tests"
==
::
++ failing
^~ ^- (map path tape)
%- my :~ ::TODO don't hardcode
::
:- /gen/al "compiler types out-of-date"
:- /gen/musk "compiler types out-of-date"
::
:- /gen/cosmetic "incomplete"
:- /gen/lust "incomplete"
:- /gen/scantastic "incomplete"
2018-03-08 05:13:57 +03:00
==
--