]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/deploy-tests.factor
benchmark.nbody-simd: use map-reduce instead of reduce
[factor.git] / basis / tools / deploy / deploy-tests.factor
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 tools.deploy.config.editor\r
4 tools.deploy.backend math sequences io.launcher arrays namespaces\r
5 continuations layouts accessors io.encodings.ascii urls math.parser\r
6 io.directories tools.deploy.test ;\r
7 \r
8 [ t ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test\r
9 \r
10 [ t ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test\r
11 \r
12 [ t ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test\r
13 \r
14 [ "staging.math-threads-compiler-ui-strip.image" ] [\r
15     "hello-ui" deploy-config\r
16     [ bootstrap-profile staging-image-name file-name ] bind\r
17 ] unit-test\r
18 \r
19 [ t ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test\r
20 \r
21 [ t ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test\r
22 \r
23 [ t ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test\r
24 \r
25 [ t ] [ "terrain" shake-and-bake 1600000 small-enough? ] unit-test\r
26 \r
27 [ t ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test\r
28 \r
29 os macosx? [\r
30     [ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test\r
31 ] when\r
32 \r
33 [ t ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test\r
34 \r
35 {\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
40 } [\r
41     [ ] swap [\r
42         shake-and-bake\r
43         run-temp-image\r
44     ] curry unit-test\r
45 ] each\r
46 \r
47 USING: http.client http.server http.server.dispatchers\r
48 http.server.responses http.server.static io.servers.connection ;\r
49 \r
50 SINGLETON: quit-responder\r
51 \r
52 M: quit-responder call-responder*\r
53     2drop stop-this-server "Goodbye" "text/html" <content> ;\r
54 \r
55 : add-quot-responder ( responder -- responder )\r
56     quit-responder "quit" add-responder ;\r
57 \r
58 : test-httpd ( responder -- )\r
59     [\r
60         main-responder set\r
61         <http-server>\r
62             0 >>insecure\r
63             f >>secure\r
64         dup start-server*\r
65         sockets>> first addr>> port>>\r
66         dup number>string "resource:temp/port-number" ascii set-file-contents\r
67     ] with-scope\r
68     "port" set ;\r
69 \r
70 [ ] [\r
71     <dispatcher>\r
72         add-quot-responder\r
73         "vocab:http/test" <static> >>default\r
74 \r
75     test-httpd\r
76 ] unit-test\r
77 \r
78 [ ] [\r
79     "tools.deploy.test.5" shake-and-bake\r
80     run-temp-image\r
81 ] unit-test\r
82 \r
83 : add-port ( url -- url' )\r
84     >url clone "port" get >>port ;\r
85 \r
86 [ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test\r
87 \r
88 {\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
95 } [\r
96     [ ] swap [\r
97         shake-and-bake\r
98         run-temp-image\r
99     ] curry unit-test\r
100 ] each\r
101 \r
102 os windows? os macosx? or [\r
103     [ ] [ "tools.deploy.test.8" shake-and-bake run-temp-image ] unit-test\r
104 ] when