1 USING: bootstrap.image tools.test system io io.encodings.ascii
2 io.pathnames io.files io.files.info io.files.temp kernel
3 tools.deploy.config tools.deploy.config.editor
4 tools.deploy.backend math sequences io.launcher arrays
5 namespaces continuations layouts accessors urls math.parser
6 io.directories splitting tools.deploy tools.deploy.test vocabs ;
10 ! Delete all cached staging images in case syntax or
11 ! other core vocabularies have changed and staging
15 [ "nosuchvocab" deploy ] [ no-vocab? ] must-fail-with
17 [ "no such vocab, fool!" deploy ] [ bad-vocab-name? ] must-fail-with
19 { } [ "hello-world" shake-and-bake 550000 small-enough? ] unit-test
21 { } [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test
23 ! [ ] [ "hello-ui" shake-and-bake 1605000 small-enough? ] unit-test
24 { } [ "hello-ui" shake-and-bake 2069160 small-enough? ] unit-test
26 { "math-threads-compiler-io-ui" } [
27 "hello-ui" deploy-config [
28 bootstrap-profile staging-image-name file-name
33 ! [ ] [ "maze" shake-and-bake 1520000 small-enough? ] unit-test
34 { } [ "maze" shake-and-bake 2000000 small-enough? ] unit-test
36 ! [ ] [ "tetris" shake-and-bake 1734000 small-enough? ] unit-test
37 { } [ "tetris" shake-and-bake 2186392 small-enough? ] unit-test
39 ! [ ] [ "spheres" shake-and-bake 1557000 small-enough? ] unit-test
40 { } [ "spheres" shake-and-bake 2031096 small-enough? ] unit-test
42 ! [ ] [ "terrain" shake-and-bake 2053000 small-enough? ] unit-test
43 { } [ "terrain" shake-and-bake 2671928 small-enough? ] unit-test
45 ! [ ] [ "gpu.demos.raytrace" shake-and-bake 2764000 small-enough? ] unit-test
46 { } [ "gpu.demos.raytrace" shake-and-bake 3307816 small-enough? ] unit-test
48 { } [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test
50 { } [ "gpu.demos.bunny" shake-and-bake 3500000 small-enough? ] unit-test
53 [ ] [ "webkit-demo" shake-and-bake 600000 small-enough? ] unit-test
56 { } [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test
70 USING: http.client http.server http.server.dispatchers
71 http.server.responses http.server.static io.servers ;
73 SINGLETON: quit-responder
75 M: quit-responder call-responder*
76 2drop stop-this-server "Goodbye" <html-content> ;
78 : add-quot-responder ( responder -- responder )
79 quit-responder "quit" add-responder ;
81 : test-httpd ( responder -- )
88 servers>> first addr>> port>>
89 dup number>string "port-number" temp-file ascii set-file-contents
96 "vocab:http/test" <static> >>default
102 "tools.deploy.test.5" shake-and-bake
106 : add-port ( url -- url' )
107 >url clone "port" get >>port ;
109 { } [ "http://localhost/quit" add-port http-get 2drop ] unit-test
112 "tools.deploy.test.6"
113 "tools.deploy.test.7"
114 "tools.deploy.test.9"
115 "tools.deploy.test.10"
116 "tools.deploy.test.11"
117 "tools.deploy.test.12"
125 os windows? os macosx? or [
126 [ ] [ "tools.deploy.test.8" shake-and-bake run-temp-image ] unit-test
130 [ ] [ "tools.deploy.test.14" shake-and-bake run-temp-image ] unit-test
133 { { "a" "b" "c" } } [
134 "tools.deploy.test.15" shake-and-bake deploy-test-command
135 { "a" "b" "c" } append
136 ascii [ lines ] with-process-reader
140 { } [ "tools.deploy.test.16" shake-and-bake run-temp-image ] unit-test
142 { } [ "tools.deploy.test.17" shake-and-bake run-temp-image ] unit-test
145 "tools.deploy.test.18" shake-and-bake
146 deploy-test-command ascii [ readln ] with-process-reader
147 test-image temp-file =
150 { } [ "resource:license.txt" "license.txt" temp-file copy-file ] unit-test
152 { } [ "tools.deploy.test.19" shake-and-bake run-temp-image ] unit-test
154 { } [ "tools.deploy.test.20" shake-and-bake ] unit-test
156 { "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo>Factor</foo>" }
157 [ deploy-test-command ascii [ readln ] with-process-reader ] unit-test
159 ! [ ] [ "tools.deploy.test.20" drop 1353000 small-enough? ] unit-test
160 { } [ "tools.deploy.test.20" drop 1363000 small-enough? ] unit-test
162 { } [ "tools.deploy.test.21" shake-and-bake ] unit-test
165 [ deploy-test-command ascii [ readln ] with-process-reader ] unit-test
167 { } [ "tools.deploy.test.21" drop 1260000 small-enough? ] unit-test
169 { } [ "benchmark.ui-panes" shake-and-bake run-temp-image ] unit-test