This is equivalent to a diff from
977a37ad23
to dae2c48a5c
Modified Makefile
from [a4b44c1e54]
to [be8dc8c4a5].
︙ | | |
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
-
+
|
ADTLSCR=mt_laststep mt_runstep mt_ezstep
HELPERS=$(addprefix $(PREFIX)/bin/,$(ADTLSCR))
DEPLOYHELPERS=$(addprefix $(DEPLOYTARG)/,$(ADTLSCR))
MTESTHASH=$(shell fossil info|grep checkout:| awk '{print $$2}')
all : mtest dboard
mtest: $(OFILES) megatest.o
csc $(CSCOPTS) $(OFILES) megatest.o -o mtest
csc -heap-size 1m $(CSCOPTS) $(OFILES) megatest.o -o mtest
dboard : $(OFILES) $(GOFILES)
csc $(OFILES) $(GOFILES) -o dboard
$(DEPLOYTARG)/megatest : $(OFILES) megatest.o
csc -deployed $(CSCOPTS) $(OFILES) megatest.o -o $(DEPLOYTARG)/megatest
|
︙ | | |
Added testhttp/example-client.scm version [83732ef8d7].
|
1
2
3
|
+
+
+
|
(use http-client)
(print (with-input-from-request "http://localhost:8082/?foo=1" #f read-string))
|
| |
Added testhttp/example-server.scm version [d5822303ef].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
(use spiffy awful)
(tcp-buffer-size 2048)
(enable-sxml #t)
(define (hello-world)
(define-page (main-page-path)
(lambda ()
(with-request-variables (foo)
(conc foo " Hello, world! Goodbye Dolly")))))
(define (start-server #!key (portnum 8080))
(handle-exceptions
exn
(begin
(print-error-message exn)
(if (< portnum 9000)
(begin
(print "WARNING: failed to start on portnum: " portnum ", trying next port")
(sleep 1)
(start-server portnum: (+ portnum 1)))
(print "ERROR: Tried and tried but could not start the server")))
(print "INFO: Trying to start server on portnum: " portnum)
(awful-start hello-world port: portnum)))
(start-server)
|
| | | | | | | | | | | | | | | | | | | | | | | | |
Added testhttp/mockupclient.scm version [fceab37de6].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
(use posix)
(define cname "Bob")
(define runtime 10)
(let ((args (argv)))
(if (< (length args) 3)
(begin
(print "Usage: mockupclient clientname runtime")
(exit))
(begin
(set! cname (cadr args))
(set! runtime (string->number (caddr args))))))
;; (define start-delay (/ (random 100) 9))
;; (define runtime (+ 1 (/ (random 200) 2)))
(print "Starting client " cname " with runtime " runtime)
(include "mockupclientlib.scm")
(set! endtime (+ (current-seconds) runtime))
(let loop ()
(let ((x (random 15))
(varname (list-ref (list "hello" "goodbye" "saluton" "kiaorana")(random 4))))
(case x
;; ((1)(dbaccess cname 'sync "nodat" #f))
((2 3 4 5)(dbaccess cname 'set varname (random 999)))
((6 7 8 9 10)(print cname ": Get \"" varname "\" " (dbaccess cname 'get varname #f)))
(else
(thread-sleep! 0.011)))
(if (< (current-seconds) endtime)
(loop))))
(print "Client " cname " all done!!")
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added testhttp/mockupclientlib.scm version [6a9bd9de5d].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
(define sub (make-socket 'sub))
(define push (make-socket 'push))
(socket-option-set! sub 'subscribe cname)
(connect-socket sub "tcp://localhost:5563")
(connect-socket push "tcp://localhost:5564")
(define (dbaccess cname cmd var val #!key (numtries 1))
(let* ((msg (conc cname ":" cmd ":" (if val (conc var " " val) var)))
(res #f)
(do-access (lambda ()
(print "Sending msg: " msg)
(send-message push msg)
(print "Message " msg " sent")
(print "Client " cname " waiting for response to " msg)
(print "Client " cname " received address " (receive-message* sub))
(set! res (receive-message* sub)))))
(let ((th1 (make-thread do-access "do access"))
(th2 (make-thread (lambda ()
(thread-sleep! 5)
(if (not res)
(if (> numtries 0)
(begin
(print "WARNING: access timed out for " cname ", trying again. Trys remaining=" numtries)
(dbaccess cname cmd var val numtries: (- numtries 1)))
(begin
(print "ERROR: dbaccess timed out. Exiting")
(exit)))))
"timeout thread")))
(thread-start! th1)
(thread-start! th2)
(thread-join! th1)
res)))
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added testhttp/mockupserver.scm version [aa3c5bcdcf].