| 
									
										
										
										
											2009-10-03 07:53:23 -04:00
										 |  |  | USING: tools.test system io io.encodings.ascii io.pathnames | 
					
						
							|  |  |  | io.files io.files.info io.files.temp kernel tools.deploy.config | 
					
						
							|  |  |  | tools.deploy.config.editor tools.deploy.backend math sequences | 
					
						
							|  |  |  | io.launcher arrays namespaces continuations layouts accessors | 
					
						
							|  |  |  | urls math.parser io.directories tools.deploy.test ;
 | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  | IN: tools.deploy.tests | 
					
						
							| 
									
										
										
										
											2008-03-14 18:39:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-28 02:21:30 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-28 02:21:30 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2008-07-05 04:44:54 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-06 07:25:07 -04:00
										 |  |  | [ "staging.math-threads-compiler-ui.image" ] [ | 
					
						
							| 
									
										
										
										
											2008-03-20 22:35:01 -04:00
										 |  |  |     "hello-ui" deploy-config | 
					
						
							|  |  |  |     [ bootstrap-profile staging-image-name file-name ] bind | 
					
						
							| 
									
										
										
										
											2008-03-19 15:39:08 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2008-11-01 19:56:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2008-10-20 23:05:22 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2009-05-10 22:33:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2009-05-10 22:33:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2008-03-13 04:46:25 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-08 17:02:31 -05:00
										 |  |  | os macosx? [ | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  |     [ ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2008-12-08 17:02:31 -05:00
										 |  |  | ] when
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 03:01:23 -05:00
										 |  |  | [ ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test | 
					
						
							| 
									
										
										
										
											2009-03-18 18:08:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-18 23:29:48 -04:00
										 |  |  | { | 
					
						
							|  |  |  |     "tools.deploy.test.1" | 
					
						
							|  |  |  |     "tools.deploy.test.2" | 
					
						
							|  |  |  |     "tools.deploy.test.3" | 
					
						
							|  |  |  |     "tools.deploy.test.4" | 
					
						
							|  |  |  | } [ | 
					
						
							|  |  |  |     [ ] swap [ | 
					
						
							|  |  |  |         shake-and-bake | 
					
						
							| 
									
										
										
										
											2008-09-28 01:40:41 -04:00
										 |  |  |         run-temp-image | 
					
						
							| 
									
										
										
										
											2008-06-18 23:29:48 -04:00
										 |  |  |     ] curry unit-test | 
					
						
							|  |  |  | ] each
 | 
					
						
							| 
									
										
										
										
											2008-06-25 21:47:07 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-03 21:50:08 -04:00
										 |  |  | USING: http.client http.server http.server.dispatchers | 
					
						
							| 
									
										
										
										
											2008-06-25 21:47:07 -04:00
										 |  |  | http.server.responses http.server.static io.servers.connection ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-03 21:50:08 -04:00
										 |  |  | SINGLETON: quit-responder | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: quit-responder call-responder* | 
					
						
							| 
									
										
										
										
											2008-10-02 09:30:38 -04:00
										 |  |  |     2drop stop-this-server "Goodbye" "text/html" <content> ;
 | 
					
						
							| 
									
										
										
										
											2008-07-03 21:50:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : add-quot-responder ( responder -- responder )
 | 
					
						
							|  |  |  |     quit-responder "quit" add-responder ;
 | 
					
						
							| 
									
										
										
										
											2008-06-25 21:47:07 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-20 23:05:22 -04:00
										 |  |  | : test-httpd ( responder -- )
 | 
					
						
							| 
									
										
										
										
											2008-06-25 21:47:07 -04:00
										 |  |  |     [ | 
					
						
							|  |  |  |         main-responder set
 | 
					
						
							| 
									
										
										
										
											2008-10-20 23:05:22 -04:00
										 |  |  |         <http-server> | 
					
						
							|  |  |  |             0 >>insecure | 
					
						
							|  |  |  |             f >>secure | 
					
						
							|  |  |  |         dup start-server* | 
					
						
							|  |  |  |         sockets>> first addr>> port>> | 
					
						
							|  |  |  |         dup number>string "resource:temp/port-number" ascii set-file-contents | 
					
						
							| 
									
										
										
										
											2008-06-25 21:47:07 -04:00
										 |  |  |     ] with-scope
 | 
					
						
							| 
									
										
										
										
											2008-10-20 23:05:22 -04:00
										 |  |  |     "port" set ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ ] [ | 
					
						
							|  |  |  |     <dispatcher> | 
					
						
							|  |  |  |         add-quot-responder | 
					
						
							| 
									
										
										
										
											2009-02-15 20:53:21 -05:00
										 |  |  |         "vocab:http/test" <static> >>default | 
					
						
							| 
									
										
										
										
											2008-10-20 23:05:22 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     test-httpd | 
					
						
							| 
									
										
										
										
											2008-06-25 21:47:07 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ ] [ | 
					
						
							|  |  |  |     "tools.deploy.test.5" shake-and-bake | 
					
						
							| 
									
										
										
										
											2008-09-28 01:40:41 -04:00
										 |  |  |     run-temp-image | 
					
						
							| 
									
										
										
										
											2008-06-25 21:47:07 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-20 23:05:22 -04:00
										 |  |  | : add-port ( url -- url' )
 | 
					
						
							|  |  |  |     >url clone "port" get >>port ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test | 
					
						
							| 
									
										
										
										
											2008-09-28 01:40:41 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-13 20:41:13 -04:00
										 |  |  | { | 
					
						
							|  |  |  |     "tools.deploy.test.6" | 
					
						
							|  |  |  |     "tools.deploy.test.7" | 
					
						
							|  |  |  |     "tools.deploy.test.9" | 
					
						
							|  |  |  |     "tools.deploy.test.10" | 
					
						
							|  |  |  |     "tools.deploy.test.11" | 
					
						
							|  |  |  |     "tools.deploy.test.12" | 
					
						
							|  |  |  | } [ | 
					
						
							|  |  |  |     [ ] swap [ | 
					
						
							|  |  |  |         shake-and-bake | 
					
						
							|  |  |  |         run-temp-image | 
					
						
							|  |  |  |     ] curry unit-test | 
					
						
							| 
									
										
										
										
											2009-05-11 18:04:14 -04:00
										 |  |  | ] each
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | os windows? os macosx? or [ | 
					
						
							|  |  |  |     [ ] [ "tools.deploy.test.8" shake-and-bake run-temp-image ] unit-test | 
					
						
							| 
									
										
										
										
											2009-09-07 18:59:34 -04:00
										 |  |  | ] when
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-07 23:48:57 -04:00
										 |  |  | os macosx? [ | 
					
						
							| 
									
										
										
										
											2009-09-07 18:59:34 -04:00
										 |  |  |     [ ] [ "tools.deploy.test.14" shake-and-bake run-temp-image ] unit-test | 
					
						
							| 
									
										
										
										
											2009-10-02 22:00:12 -04:00
										 |  |  | ] when
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ { "a" "b" "c" } ] [ | 
					
						
							|  |  |  |     "tools.deploy.test.15" shake-and-bake deploy-test-command | 
					
						
							|  |  |  |     { "a" "b" "c" } append
 | 
					
						
							|  |  |  |     ascii [ lines ] with-process-reader | 
					
						
							|  |  |  |     rest
 | 
					
						
							| 
									
										
										
										
											2009-10-16 22:22:01 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-19 07:11:00 -04:00
										 |  |  | [ ] [ "tools.deploy.test.16" shake-and-bake run-temp-image ] unit-test | 
					
						
							| 
									
										
										
										
											2009-11-20 04:23:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ ] [ "tools.deploy.test.17" shake-and-bake run-temp-image ] unit-test |