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