1 USING: accessors arrays bootstrap.image continuations
2 io.directories io.files.info io.files.temp io.launcher
3 io.backend kernel layouts math sequences system
4 tools.deploy.backend tools.deploy.config.editor ;
7 : test-image ( -- str )
8 my-arch-name "test." ".image" surround ;
10 : shake-and-bake ( vocab -- )
11 [ test-image temp-file delete-file ] ignore-errors
13 [ vm-path test-image temp-file ] dip
14 dup deploy-config make-deploy-image drop
15 ] with-resource-directory ;
17 ERROR: image-too-big actual-size max-size ;
19 : small-enough? ( n -- )
20 [ test-image temp-file file-info size>> ]
23 cpu ppc? [ 100000 + ] when
24 os windows? [ 160000 + ] when
26 2dup <= [ 2drop ] [ throw-image-too-big ] if ;
28 : deploy-test-command ( -- args )
30 "resource:Factor.app/Contents/MacOS/factor" normalize-path vm-path ?
31 "-i=" test-image temp-file append 2array ;
33 : run-temp-image ( -- )
34 deploy-test-command try-output-process ;