1 USING: tools.test system io io.encodings.ascii io.pathnames
\r
2 io.files io.files.info io.files.temp kernel tools.deploy.config
\r
3 tools.deploy.config.editor tools.deploy.backend math sequences
\r
4 io.launcher arrays namespaces continuations layouts accessors
\r
5 urls math.parser io.directories tools.deploy.test ;
\r
6 IN: tools.deploy.tests
\r
8 [ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test
\r
10 [ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test
\r
12 [ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test
\r
14 [ "staging.math-threads-compiler-ui.image" ] [
\r
15 "hello-ui" deploy-config
\r
16 [ bootstrap-profile staging-image-name file-name ] bind
\r
19 [ ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test
\r
21 [ ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test
\r
23 [ ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test
\r
25 [ ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test
\r
27 [ ] [ "gpu.demos.raytrace" shake-and-bake 2500000 small-enough? ] unit-test
\r
29 [ ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test
\r
31 [ ] [ "gpu.demos.bunny" shake-and-bake 3500000 small-enough? ] unit-test
\r
34 [ ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test
\r
37 [ ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test
\r
40 "tools.deploy.test.1"
\r
41 "tools.deploy.test.2"
\r
42 "tools.deploy.test.3"
\r
43 "tools.deploy.test.4"
\r
51 USING: http.client http.server http.server.dispatchers
\r
52 http.server.responses http.server.static io.servers.connection ;
\r
54 SINGLETON: quit-responder
\r
56 M: quit-responder call-responder*
\r
57 2drop stop-this-server "Goodbye" "text/html" <content> ;
\r
59 : add-quot-responder ( responder -- responder )
\r
60 quit-responder "quit" add-responder ;
\r
62 : test-httpd ( responder -- )
\r
69 sockets>> first addr>> port>>
\r
70 dup number>string "resource:temp/port-number" ascii set-file-contents
\r
77 "vocab:http/test" <static> >>default
\r
83 "tools.deploy.test.5" shake-and-bake
\r
87 : add-port ( url -- url' )
\r
88 >url clone "port" get >>port ;
\r
90 [ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
\r
93 "tools.deploy.test.6"
\r
94 "tools.deploy.test.7"
\r
95 "tools.deploy.test.9"
\r
96 "tools.deploy.test.10"
\r
97 "tools.deploy.test.11"
\r
98 "tools.deploy.test.12"
\r
106 os windows? os macosx? or [
\r
107 [ ] [ "tools.deploy.test.8" shake-and-bake run-temp-image ] unit-test
\r
111 [ ] [ "tools.deploy.test.14" shake-and-bake run-temp-image ] unit-test
\r
114 [ { "a" "b" "c" } ] [
\r
115 "tools.deploy.test.15" shake-and-bake deploy-test-command
\r
116 { "a" "b" "c" } append
\r
117 ascii [ lines ] with-process-reader
\r
121 [ ] [ "tools.deploy.test.16" shake-and-bake run-temp-image ] unit-test
\r
123 [ ] [ "tools.deploy.test.17" shake-and-bake run-temp-image ] unit-test
\r
126 "tools.deploy.test.18" shake-and-bake
\r
127 deploy-test-command ascii [ readln ] with-process-reader
\r
128 "test.image" temp-file =
\r