Overview
Context
Changes
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/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 [d64eb07b64].