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 : test-image-path ( -- str )
11 test-image temp-file ;
13 : shake-and-bake ( vocab -- )
14 test-image-path ?delete-file
16 [ vm-path test-image temp-file ] dip
17 dup deploy-config make-deploy-image drop
18 ] with-resource-directory ;
20 ERROR: image-too-big actual-size max-size ;
22 : small-enough? ( n -- )
23 [ test-image-path file-info size>> ]
26 cpu ppc? [ 100000 + ] when
27 os windows? [ 160000 + ] when
29 2dup <= [ 2drop ] [ image-too-big ] if ;
31 : deploy-test-command ( -- args )
33 "resource:Factor.app/Contents/MacOS/factor" normalize-path vm-path ?
34 "-i=" test-image-path append 2array ;
36 : run-temp-image ( -- )
37 deploy-test-command try-output-process ;