tools.deploy.test: include arch in test.image file name.

db4
John Benediktsson 2012-07-26 08:01:57 -07:00
parent f4c369bdb0
commit 9df7475314
2 changed files with 11 additions and 7 deletions

View File

@ -142,7 +142,7 @@ os macosx? [
[ t ] [ [ t ] [
"tools.deploy.test.18" shake-and-bake "tools.deploy.test.18" shake-and-bake
deploy-test-command ascii [ readln ] with-process-reader deploy-test-command ascii [ readln ] with-process-reader
"test.image" temp-file = test-image temp-file =
] unit-test ] unit-test
[ ] [ "resource:license.txt" "license.txt" temp-file copy-file ] unit-test [ ] [ "resource:license.txt" "license.txt" temp-file copy-file ] unit-test

View File

@ -1,19 +1,23 @@
USING: accessors arrays continuations io.directories io.files.info USING: accessors arrays bootstrap.image continuations
io.files.temp io.launcher io.backend kernel layouts math sequences system io.directories io.files.info io.files.temp io.launcher
io.backend kernel layouts math sequences system
tools.deploy.backend tools.deploy.config.editor ; tools.deploy.backend tools.deploy.config.editor ;
IN: tools.deploy.test IN: tools.deploy.test
: test-image ( -- str )
my-arch "test." ".image" surround ;
: shake-and-bake ( vocab -- ) : shake-and-bake ( vocab -- )
[ "test.image" temp-file delete-file ] ignore-errors [ test-image temp-file delete-file ] ignore-errors
"resource:" [ "resource:" [
[ vm "test.image" temp-file ] dip [ vm test-image temp-file ] dip
dup deploy-config make-deploy-image drop dup deploy-config make-deploy-image drop
] with-directory ; ] with-directory ;
ERROR: image-too-big actual-size max-size ; ERROR: image-too-big actual-size max-size ;
: small-enough? ( n -- ) : small-enough? ( n -- )
[ "test.image" temp-file file-info size>> ] [ test-image temp-file file-info size>> ]
[ [
cell 4 / * cell 4 / *
cpu ppc? [ 100000 + ] when cpu ppc? [ 100000 + ] when
@ -24,7 +28,7 @@ ERROR: image-too-big actual-size max-size ;
: deploy-test-command ( -- args ) : deploy-test-command ( -- args )
os macosx? os macosx?
"resource:Factor.app/Contents/MacOS/factor" normalize-path vm ? "resource:Factor.app/Contents/MacOS/factor" normalize-path vm ?
"-i=" "test.image" temp-file append 2array ; "-i=" test-image temp-file append 2array ;
: run-temp-image ( -- ) : run-temp-image ( -- )
deploy-test-command try-output-process ; deploy-test-command try-output-process ;