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
14 [ "staging." head? ] filter
15 my-arch ".image" append [ tail? ] curry filter
17 ] with-directory-files
19 [ "nosuchvocab" deploy ] [ no-vocab? ] must-fail-with
21 [ "no such vocab, fool!" deploy ] [ bad-vocab-name? ] must-fail-with
23 [ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test
25 [ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test
27 [ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test
29 [ "math-threads-compiler-ui" ] [
30 "hello-ui" deploy-config [
31 bootstrap-profile staging-image-name file-name
36 [ ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test
38 [ ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test
40 [ ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test
42 [ ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test
44 [ ] [ "gpu.demos.raytrace" shake-and-bake 2500000 small-enough? ] unit-test
46 [ ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test
48 [ ] [ "gpu.demos.bunny" shake-and-bake 3500000 small-enough? ] unit-test
51 [ ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test
54 [ ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test
68 USING: http.client http.server http.server.dispatchers
69 http.server.responses http.server.static io.servers ;
71 SINGLETON: quit-responder
73 M: quit-responder call-responder*
74 2drop stop-this-server "Goodbye" <html-content> ;
76 : add-quot-responder ( responder -- responder )
77 quit-responder "quit" add-responder ;
79 : test-httpd ( responder -- )
86 servers>> first addr>> port>>
87 dup number>string "port-number" temp-file ascii set-file-contents
94 "vocab:http/test" <static> >>default
100 "tools.deploy.test.5" shake-and-bake
104 : add-port ( url -- url' )
105 >url clone "port" get >>port ;
107 [ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
110 "tools.deploy.test.6"
111 "tools.deploy.test.7"
112 "tools.deploy.test.9"
113 "tools.deploy.test.10"
114 "tools.deploy.test.11"
115 "tools.deploy.test.12"
123 os windows? os macosx? or [
124 [ ] [ "tools.deploy.test.8" shake-and-bake run-temp-image ] unit-test
128 [ ] [ "tools.deploy.test.14" shake-and-bake run-temp-image ] unit-test
131 [ { "a" "b" "c" } ] [
132 "tools.deploy.test.15" shake-and-bake deploy-test-command
133 { "a" "b" "c" } append
134 ascii [ lines ] with-process-reader
138 [ ] [ "tools.deploy.test.16" shake-and-bake run-temp-image ] unit-test
140 [ ] [ "tools.deploy.test.17" shake-and-bake run-temp-image ] unit-test
143 "tools.deploy.test.18" shake-and-bake
144 deploy-test-command ascii [ readln ] with-process-reader
145 test-image temp-file =
148 [ ] [ "resource:license.txt" "license.txt" temp-file copy-file ] unit-test
150 [ ] [ "tools.deploy.test.19" shake-and-bake run-temp-image ] unit-test
152 [ ] [ "tools.deploy.test.20" shake-and-bake ] unit-test
154 [ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo>Factor</foo>" ]
155 [ deploy-test-command ascii [ readln ] with-process-reader ] unit-test
157 [ ] [ "tools.deploy.test.20" drop 870000 small-enough? ] unit-test
159 [ ] [ "tools.deploy.test.21" shake-and-bake ] unit-test
162 [ deploy-test-command ascii [ readln ] with-process-reader ] unit-test
164 [ ] [ "tools.deploy.test.21" drop 800000 small-enough? ] unit-test
166 [ ] [ "benchmark.ui-panes" shake-and-bake run-temp-image ] unit-test