]> gitweb.factorcode.org Git - factor.git/blob - extra/tools/image-analyzer/graphviz/graphviz-tests.factor
io.files: exists? -> file-exists? and rename primitive.
[factor.git] / extra / tools / image-analyzer / graphviz / graphviz-tests.factor
1 USING: accessors bootstrap.image fry graphviz io.files io.pathnames
2 kernel sequences system tools.image-analyzer
3 tools.image-analyzer.graphviz tools.test ;
4 IN: tools.image-analyzer.graphviz.tests
5
6 ! Copy paste!
7 : boot-image-path ( arch -- path )
8     boot-image-name resource-path ;
9
10 : ?make-image ( arch -- )
11     dup boot-image-path file-exists? [ drop ] [ make-image ] if ;
12
13 : loadable-images ( -- images )
14     image-names cpu name>> '[ _ tail? ] filter ;
15
16 ! Sanity test
17 { t } [
18     loadable-images [ [ ?make-image ] each ] [
19         [
20             boot-image-path load-image image>graph graph?
21         ] all?
22     ] bi
23 ] unit-test