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 [ t ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test
\r
10 [ t ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test
\r
12 [ t ] [ "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 [ t ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test
\r
21 [ t ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test
\r
23 [ t ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test
\r
25 [ t ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test
\r
27 [ t ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test
\r
30 [ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test
\r
33 [ t ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test
\r
36 "tools.deploy.test.1"
\r
37 "tools.deploy.test.2"
\r
38 "tools.deploy.test.3"
\r
39 "tools.deploy.test.4"
\r
47 USING: http.client http.server http.server.dispatchers
\r
48 http.server.responses http.server.static io.servers.connection ;
\r
50 SINGLETON: quit-responder
\r
52 M: quit-responder call-responder*
\r
53 2drop stop-this-server "Goodbye" "text/html" <content> ;
\r
55 : add-quot-responder ( responder -- responder )
\r
56 quit-responder "quit" add-responder ;
\r
58 : test-httpd ( responder -- )
\r
65 sockets>> first addr>> port>>
\r
66 dup number>string "resource:temp/port-number" ascii set-file-contents
\r
73 "vocab:http/test" <static> >>default
\r
79 "tools.deploy.test.5" shake-and-bake
\r
83 : add-port ( url -- url' )
\r
84 >url clone "port" get >>port ;
\r
86 [ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
\r
89 "tools.deploy.test.6"
\r
90 "tools.deploy.test.7"
\r
91 "tools.deploy.test.9"
\r
92 "tools.deploy.test.10"
\r
93 "tools.deploy.test.11"
\r
94 "tools.deploy.test.12"
\r
102 os windows? os macosx? or [
\r
103 [ ] [ "tools.deploy.test.8" shake-and-bake run-temp-image ] unit-test
\r
107 [ ] [ "tools.deploy.test.14" shake-and-bake run-temp-image ] unit-test
\r
110 [ { "a" "b" "c" } ] [
\r
111 "tools.deploy.test.15" shake-and-bake deploy-test-command
\r
112 { "a" "b" "c" } append
\r
113 ascii [ lines ] with-process-reader
\r
117 [ ] [ "tools.deploy.test.16" shake-and-bake run-temp-image ] unit-test
\r