1 IN: tools.deploy.tests
\r
2 USING: tools.test system io.pathnames io.files io.files.info
\r
3 io.files.temp kernel tools.deploy.config
\r
4 tools.deploy.config.editor tools.deploy.backend math sequences
\r
5 io.launcher arrays namespaces continuations layouts accessors
\r
6 io.encodings.ascii urls math.parser io.directories
\r
9 [ t ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test
\r
11 [ t ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test
\r
13 [ t ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test
\r
15 [ "staging.math-compiler-threads-ui-strip.image" ] [
\r
16 "hello-ui" deploy-config
\r
17 [ bootstrap-profile staging-image-name file-name ] bind
\r
20 [ t ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test
\r
22 [ t ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test
\r
24 [ t ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test
\r
27 [ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test
\r
31 "tools.deploy.test.1"
\r
32 "tools.deploy.test.2"
\r
33 "tools.deploy.test.3"
\r
34 "tools.deploy.test.4"
\r
42 USING: http.client http.server http.server.dispatchers
\r
43 http.server.responses http.server.static io.servers.connection ;
\r
45 SINGLETON: quit-responder
\r
47 M: quit-responder call-responder*
\r
48 2drop stop-this-server "Goodbye" "text/html" <content> ;
\r
50 : add-quot-responder ( responder -- responder )
\r
51 quit-responder "quit" add-responder ;
\r
53 : test-httpd ( responder -- )
\r
60 sockets>> first addr>> port>>
\r
61 dup number>string "resource:temp/port-number" ascii set-file-contents
\r
68 "resource:basis/http/test" <static> >>default
\r
74 "tools.deploy.test.5" shake-and-bake
\r
78 : add-port ( url -- url' )
\r
79 >url clone "port" get >>port ;
\r
81 [ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
\r
84 "tools.deploy.test.6" shake-and-bake
\r
89 "tools.deploy.test.7" shake-and-bake
\r
94 "tools.deploy.test.8" shake-and-bake
\r
99 "tools.deploy.test.9" shake-and-bake
\r
104 "tools.deploy.test.10" shake-and-bake
\r