0000: 0a 3b 3b 20 43 6f 70 79 72 69 67 68 74 20 32 30 .;; Copyright 20
0010: 30 36 2d 32 30 31 32 2c 20 4d 61 74 74 68 65 77 06-2012, Matthew
0020: 20 57 65 6c 6c 61 6e 64 2e 0a 3b 3b 20 0a 3b 3b Welland..;; .;;
0030: 20 20 54 68 69 73 20 70 72 6f 67 72 61 6d 20 69 This program i
0040: 73 20 6d 61 64 65 20 61 76 61 69 6c 61 62 6c 65 s made available
0050: 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 20 47 under the GNU G
0060: 50 4c 20 76 65 72 73 69 6f 6e 20 32 2e 30 20 6f PL version 2.0 o
0070: 72 0a 3b 3b 20 20 67 72 65 61 74 65 72 2e 20 53 r.;; greater. S
0080: 65 65 20 74 68 65 20 61 63 63 6f 6d 70 61 6e 79 ee the accompany
0090: 69 6e 67 20 66 69 6c 65 20 43 4f 50 59 49 4e 47 ing file COPYING
00a0: 20 66 6f 72 20 64 65 74 61 69 6c 73 2e 0a 3b 3b for details..;;
00b0: 20 0a 3b 3b 20 20 54 68 69 73 20 70 72 6f 67 72 .;; This progr
00c0: 61 6d 20 69 73 20 64 69 73 74 72 69 62 75 74 65 am is distribute
00d0: 64 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 d WITHOUT ANY WA
00e0: 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 RRANTY; without
00f0: 65 76 65 6e 20 74 68 65 0a 3b 3b 20 20 69 6d 70 even the.;; imp
0100: 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 lied warranty of
0110: 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 MERCHANTABILITY
0120: 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 or FITNESS FOR
0130: 41 20 50 41 52 54 49 43 55 4c 41 52 0a 3b 3b 20 A PARTICULAR.;;
0140: 20 50 55 52 50 4f 53 45 2e 0a 0a 3b 3b 20 20 73 PURPOSE...;; s
0150: 74 72 66 74 69 6d 65 28 27 25 6d 2f 25 64 2f 25 trftime('%m/%d/%
0160: 59 20 25 48 3a 25 4d 3a 25 53 27 2c 27 6e 6f 77 Y %H:%M:%S','now
0170: 27 2c 27 6c 6f 63 61 6c 74 69 6d 65 27 29 0a 0a ','localtime')..
0180: 28 75 73 65 20 73 71 6c 69 74 65 33 20 73 72 66 (use sqlite3 srf
0190: 69 2d 31 20 70 6f 73 69 78 20 72 65 67 65 78 20 i-1 posix regex
01a0: 72 65 67 65 78 2d 63 61 73 65 20 73 72 66 69 2d regex-case srfi-
01b0: 36 39 20 64 6f 74 2d 6c 6f 63 6b 69 6e 67 20 28 69 dot-locking (
01c0: 73 72 66 69 20 31 38 29 20 70 6f 73 69 78 2d 65 srfi 18) posix-e
01d0: 78 74 72 61 73 20 64 69 72 65 63 74 6f 72 79 2d xtras directory-
01e0: 75 74 69 6c 73 29 0a 28 69 6d 70 6f 72 74 20 28 utils).(import (
01f0: 70 72 65 66 69 78 20 73 71 6c 69 74 65 33 20 73 prefix sqlite3 s
0200: 71 6c 69 74 65 33 3a 29 29 0a 0a 28 64 65 63 6c qlite3:))..(decl
0210: 61 72 65 20 28 75 6e 69 74 20 72 75 6e 73 29 29 are (unit runs))
0220: 0a 28 64 65 63 6c 61 72 65 20 28 75 73 65 73 20 .(declare (uses
0230: 64 62 29 29 0a 28 64 65 63 6c 61 72 65 20 28 75 db)).(declare (u
0240: 73 65 73 20 63 6f 6d 6d 6f 6e 29 29 0a 28 64 65 ses common)).(de
0250: 63 6c 61 72 65 20 28 75 73 65 73 20 69 74 65 6d clare (uses item
0260: 73 29 29 0a 28 64 65 63 6c 61 72 65 20 28 75 73 s)).(declare (us
0270: 65 73 20 72 75 6e 63 6f 6e 66 69 67 29 29 0a 28 es runconfig)).(
0280: 64 65 63 6c 61 72 65 20 28 75 73 65 73 20 74 65 declare (uses te
0290: 73 74 73 29 29 0a 28 64 65 63 6c 61 72 65 20 28 sts)).(declare (
02a0: 75 73 65 73 20 73 65 72 76 65 72 29 29 0a 0a 28 uses server))..(
02b0: 69 6e 63 6c 75 64 65 20 22 63 6f 6d 6d 6f 6e 5f include "common_
02c0: 72 65 63 6f 72 64 73 2e 73 63 6d 22 29 0a 28 69 records.scm").(i
02d0: 6e 63 6c 75 64 65 20 22 6b 65 79 5f 72 65 63 6f nclude "key_reco
02e0: 72 64 73 2e 73 63 6d 22 29 0a 28 69 6e 63 6c 75 rds.scm").(inclu
02f0: 64 65 20 22 64 62 5f 72 65 63 6f 72 64 73 2e 73 de "db_records.s
0300: 63 6d 22 29 0a 28 69 6e 63 6c 75 64 65 20 22 72 cm").(include "r
0310: 75 6e 5f 72 65 63 6f 72 64 73 2e 73 63 6d 22 29 un_records.scm")
0320: 0a 28 69 6e 63 6c 75 64 65 20 22 74 65 73 74 5f .(include "test_
0330: 72 65 63 6f 72 64 73 2e 73 63 6d 22 29 0a 0a 3b records.scm")..;
0340: 3b 20 72 75 6e 73 3a 67 65 74 2d 72 75 6e 73 2d ; runs:get-runs-
0350: 62 79 2d 70 61 74 74 0a 3b 3b 20 67 65 74 20 72 by-patt.;; get r
0360: 75 6e 73 20 62 79 20 6c 69 73 74 20 6f 66 20 63 uns by list of c
0370: 72 69 74 65 72 69 61 0a 3b 3b 20 72 65 67 69 73 riteria.;; regis
0380: 74 65 72 20 61 20 74 65 73 74 20 72 75 6e 20 77 ter a test run w
0390: 69 74 68 20 74 68 65 20 64 62 0a 3b 3b 0a 3b 3b ith the db.;;.;;
03a0: 20 55 73 65 3a 20 28 64 62 2d 67 65 74 2d 76 61 Use: (db-get-va
03b0: 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 20 28 64 lue-by-header (d
03c0: 62 3a 67 65 74 2d 68 65 61 64 65 72 20 72 75 6e b:get-header run
03d0: 69 6e 66 6f 29 28 64 62 3a 67 65 74 2d 72 6f 77 info)(db:get-row
03e0: 20 72 75 6e 69 6e 66 6f 29 29 0a 3b 3b 20 20 74 runinfo)).;; t
03f0: 6f 20 65 78 74 72 61 63 74 20 69 6e 66 6f 20 66 o extract info f
0400: 72 6f 6d 20 74 68 65 20 73 74 72 75 63 74 75 72 rom the structur
0410: 65 20 72 65 74 75 72 6e 65 64 0a 3b 3b 0a 28 64 e returned.;;.(d
0420: 65 66 69 6e 65 20 28 72 75 6e 73 3a 67 65 74 2d efine (runs:get-
0430: 72 75 6e 73 2d 62 79 2d 70 61 74 74 20 64 62 20 runs-by-patt db
0440: 6b 65 79 73 20 72 75 6e 6e 61 6d 65 70 61 74 74 keys runnamepatt
0450: 29 20 3b 3b 20 74 65 73 74 2d 6e 61 6d 65 29 0a ) ;; test-name).
0460: 20 20 28 6c 65 74 2a 20 28 28 6b 65 79 76 61 6c (let* ((keyval
0470: 6c 73 74 20 28 6b 65 79 73 2d 3e 76 61 6c 6c 69 lst (keys->valli
0480: 73 74 20 6b 65 79 73 29 29 0a 09 20 28 74 6d 70 st keys)).. (tmp
0490: 20 20 20 20 20 20 28 72 75 6e 73 3a 67 65 74 2d (runs:get-
04a0: 73 74 64 2d 72 75 6e 2d 66 69 65 6c 64 73 20 6b std-run-fields k
04b0: 65 79 73 20 27 28 22 69 64 22 20 22 72 75 6e 6e eys '("id" "runn
04c0: 61 6d 65 22 20 22 73 74 61 74 65 22 20 22 73 74 ame" "state" "st
04d0: 61 74 75 73 22 20 22 6f 77 6e 65 72 22 20 22 65 atus" "owner" "e
04e0: 76 65 6e 74 5f 74 69 6d 65 22 29 29 29 0a 09 20 vent_time")))..
04f0: 28 6b 65 79 73 74 72 20 20 20 28 63 61 72 20 74 (keystr (car t
0500: 6d 70 29 29 0a 09 20 28 68 65 61 64 65 72 20 20 mp)).. (header
0510: 20 28 63 61 64 72 20 74 6d 70 29 29 0a 09 20 28 (cadr tmp)).. (
0520: 72 65 73 20 20 20 20 20 27 28 29 29 0a 09 20 28 res '()).. (
0530: 6b 65 79 2d 70 61 74 74 20 22 22 29 0a 09 20 28 key-patt "").. (
0540: 72 75 6e 77 69 6c 64 74 79 70 65 20 28 69 66 20 runwildtype (if
0550: 28 73 75 62 73 74 72 69 6e 67 2d 69 6e 64 65 78 (substring-index
0560: 20 22 25 22 20 72 75 6e 6e 61 6d 65 70 61 74 74 "%" runnamepatt
0570: 29 20 22 6c 69 6b 65 22 20 22 67 6c 6f 62 22 29 ) "like" "glob")
0580: 29 0a 09 20 28 71 72 79 2d 73 74 72 20 20 23 66 ).. (qry-str #f
0590: 29 29 0a 20 20 20 20 28 66 6f 72 2d 65 61 63 68 )). (for-each
05a0: 20 28 6c 61 6d 62 64 61 20 28 6b 65 79 76 61 6c (lambda (keyval
05b0: 29 0a 09 09 28 6c 65 74 2a 20 28 28 6b 65 79 20 )...(let* ((key
05c0: 20 20 20 28 76 65 63 74 6f 72 2d 72 65 66 20 6b (vector-ref k
05d0: 65 79 76 61 6c 20 30 29 29 0a 09 09 20 20 20 20 eyval 0))...
05e0: 20 20 20 28 66 75 6c 6b 65 79 20 28 63 6f 6e 63 (fulkey (conc
05f0: 20 22 3a 22 20 6b 65 79 29 29 0a 09 09 20 20 20 ":" key))...
0600: 20 20 20 20 28 70 61 74 74 20 20 20 28 61 72 67 (patt (arg
0610: 73 3a 67 65 74 2d 61 72 67 20 66 75 6c 6b 65 79 s:get-arg fulkey
0620: 29 29 0a 09 09 20 20 20 20 20 20 20 28 77 69 6c ))... (wil
0630: 64 74 79 70 65 20 28 69 66 20 28 73 75 62 73 74 dtype (if (subst
0640: 72 69 6e 67 2d 69 6e 64 65 78 20 22 25 22 20 70 ring-index "%" p
0650: 61 74 74 29 20 22 6c 69 6b 65 22 20 22 67 6c 6f att) "like" "glo
0660: 62 22 29 29 29 0a 09 09 20 20 28 69 66 20 70 61 b")))... (if pa
0670: 74 74 0a 09 09 20 20 20 20 20 20 28 73 65 74 21 tt... (set!
0680: 20 6b 65 79 2d 70 61 74 74 20 28 63 6f 6e 63 20 key-patt (conc
0690: 6b 65 79 2d 70 61 74 74 20 22 20 41 4e 44 20 22 key-patt " AND "
06a0: 20 6b 65 79 20 22 20 22 20 77 69 6c 64 74 79 70 key " " wildtyp
06b0: 65 20 22 20 27 22 20 70 61 74 74 20 22 27 22 29 e " '" patt "'")
06c0: 29 0a 09 09 20 20 20 20 20 20 28 62 65 67 69 6e )... (begin
06d0: 0a 09 09 09 28 64 65 62 75 67 3a 70 72 69 6e 74 ....(debug:print
06e0: 20 30 20 22 45 52 52 4f 52 3a 20 73 65 61 72 63 0 "ERROR: searc
06f0: 68 69 6e 67 20 66 6f 72 20 72 75 6e 73 20 77 69 hing for runs wi
0700: 74 68 20 6e 6f 20 70 61 74 74 65 72 6e 20 73 65 th no pattern se
0710: 74 20 66 6f 72 20 22 20 66 75 6c 6b 65 79 29 0a t for " fulkey).
0720: 09 09 09 28 65 78 69 74 20 36 29 29 29 29 29 0a ...(exit 6))))).
0730: 09 20 20 20 20 20 20 6b 65 79 73 29 0a 20 20 20 . keys).
0740: 20 28 73 65 74 21 20 71 72 79 2d 73 74 72 20 28 (set! qry-str (
0750: 63 6f 6e 63 20 22 53 45 4c 45 43 54 20 22 20 6b conc "SELECT " k
0760: 65 79 73 74 72 20 22 20 46 52 4f 4d 20 72 75 6e eystr " FROM run
0770: 73 20 57 48 45 52 45 20 72 75 6e 6e 61 6d 65 20 s WHERE runname
0780: 22 20 72 75 6e 77 69 6c 64 74 79 70 65 20 22 20 " runwildtype "
0790: 3f 20 22 20 6b 65 79 2d 70 61 74 74 20 22 3b 22 ? " key-patt ";"
07a0: 29 29 0a 20 20 20 20 28 64 65 62 75 67 3a 70 72 )). (debug:pr
07b0: 69 6e 74 2d 69 6e 66 6f 20 34 20 22 72 75 6e 73 int-info 4 "runs
07c0: 3a 67 65 74 2d 72 75 6e 73 2d 62 79 2d 70 61 74 :get-runs-by-pat
07d0: 74 20 71 72 79 3d 22 20 71 72 79 2d 73 74 72 20 t qry=" qry-str
07e0: 22 20 22 20 72 75 6e 6e 61 6d 65 70 61 74 74 29 " " runnamepatt)
07f0: 0a 20 20 20 20 28 73 71 6c 69 74 65 33 3a 66 6f . (sqlite3:fo
0800: 72 2d 65 61 63 68 2d 72 6f 77 20 0a 20 20 20 20 r-each-row .
0810: 20 28 6c 61 6d 62 64 61 20 28 61 20 2e 20 72 29 (lambda (a . r)
0820: 0a 20 20 20 20 20 20 20 28 73 65 74 21 20 72 65 . (set! re
0830: 73 20 28 63 6f 6e 73 20 28 6c 69 73 74 2d 3e 76 s (cons (list->v
0840: 65 63 74 6f 72 20 28 63 6f 6e 73 20 61 20 72 29 ector (cons a r)
0850: 29 20 72 65 73 29 29 29 0a 20 20 20 20 20 64 62 ) res))). db
0860: 20 0a 20 20 20 20 20 71 72 79 2d 73 74 72 0a 20 . qry-str.
0870: 20 20 20 20 72 75 6e 6e 61 6d 65 70 61 74 74 29 runnamepatt)
0880: 0a 20 20 20 20 28 76 65 63 74 6f 72 20 68 65 61 . (vector hea
0890: 64 65 72 20 72 65 73 29 29 29 0a 0a 28 64 65 66 der res)))..(def
08a0: 69 6e 65 20 28 72 75 6e 73 3a 74 65 73 74 2d 67 ine (runs:test-g
08b0: 65 74 2d 66 75 6c 6c 2d 70 61 74 68 20 74 65 73 et-full-path tes
08c0: 74 29 0a 20 20 28 6c 65 74 2a 20 28 28 74 65 73 t). (let* ((tes
08d0: 74 6e 61 6d 65 20 28 64 62 3a 74 65 73 74 2d 67 tname (db:test-g
08e0: 65 74 2d 74 65 73 74 6e 61 6d 65 20 20 20 74 65 et-testname te
08f0: 73 74 29 29 0a 09 20 28 69 74 65 6d 70 61 74 68 st)).. (itempath
0900: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 74 (db:test-get-it
0910: 65 6d 2d 70 61 74 68 20 74 65 73 74 29 29 29 0a em-path test))).
0920: 20 20 20 20 28 63 6f 6e 63 20 74 65 73 74 6e 61 (conc testna
0930: 6d 65 20 28 69 66 20 28 65 71 75 61 6c 3f 20 69 me (if (equal? i
0940: 74 65 6d 70 61 74 68 20 22 22 29 20 22 22 20 28 tempath "") "" (
0950: 63 6f 6e 63 20 22 28 22 20 69 74 65 6d 70 61 74 conc "(" itempat
0960: 68 20 22 29 22 29 29 29 29 29 0a 0a 28 64 65 66 h ")")))))..(def
0970: 69 6e 65 20 28 64 62 3a 67 65 74 2d 72 75 6e 2d ine (db:get-run-
0980: 6b 65 79 2d 76 61 6c 20 64 62 20 72 75 6e 2d 69 key-val db run-i
0990: 64 20 6b 65 79 29 0a 20 20 28 6c 65 74 20 28 28 d key). (let ((
09a0: 72 65 73 20 23 66 29 29 0a 20 20 20 20 28 73 71 res #f)). (sq
09b0: 6c 69 74 65 33 3a 66 6f 72 2d 65 61 63 68 2d 72 lite3:for-each-r
09c0: 6f 77 0a 20 20 20 20 20 28 6c 61 6d 62 64 61 20 ow. (lambda
09d0: 28 76 61 6c 29 0a 20 20 20 20 20 20 20 28 73 65 (val). (se
09e0: 74 21 20 72 65 73 20 76 61 6c 29 29 0a 20 20 20 t! res val)).
09f0: 20 20 64 62 20 0a 20 20 20 20 20 28 63 6f 6e 63 db . (conc
0a00: 20 22 53 45 4c 45 43 54 20 22 20 28 6b 65 79 3a "SELECT " (key:
0a10: 67 65 74 2d 66 69 65 6c 64 6e 61 6d 65 20 6b 65 get-fieldname ke
0a20: 79 29 20 22 20 46 52 4f 4d 20 72 75 6e 73 20 57 y) " FROM runs W
0a30: 48 45 52 45 20 69 64 3d 3f 3b 22 29 0a 20 20 20 HERE id=?;").
0a40: 20 20 72 75 6e 2d 69 64 29 0a 20 20 20 20 72 65 run-id). re
0a50: 73 29 29 0a 0a 28 64 65 66 69 6e 65 20 28 64 62 s))..(define (db
0a60: 3a 67 65 74 2d 72 75 6e 2d 6e 61 6d 65 2d 66 72 :get-run-name-fr
0a70: 6f 6d 2d 69 64 20 64 62 20 72 75 6e 2d 69 64 29 om-id db run-id)
0a80: 0a 20 20 28 6c 65 74 20 28 28 72 65 73 20 23 66 . (let ((res #f
0a90: 29 29 0a 20 20 20 20 28 73 71 6c 69 74 65 33 3a )). (sqlite3:
0aa0: 66 6f 72 2d 65 61 63 68 2d 72 6f 77 0a 20 20 20 for-each-row.
0ab0: 20 20 28 6c 61 6d 62 64 61 20 28 72 75 6e 6e 61 (lambda (runna
0ac0: 6d 65 29 0a 20 20 20 20 20 20 20 28 73 65 74 21 me). (set!
0ad0: 20 72 65 73 20 72 75 6e 6e 61 6d 65 29 29 0a 20 res runname)).
0ae0: 20 20 20 20 64 62 0a 20 20 20 20 20 22 53 45 4c db. "SEL
0af0: 45 43 54 20 72 75 6e 6e 61 6d 65 20 46 52 4f 4d ECT runname FROM
0b00: 20 72 75 6e 73 20 57 48 45 52 45 20 69 64 3d 3f runs WHERE id=?
0b10: 3b 22 0a 20 20 20 20 20 72 75 6e 2d 69 64 29 0a ;". run-id).
0b20: 20 20 20 20 72 65 73 29 29 0a 0a 28 64 65 66 69 res))..(defi
0b30: 6e 65 20 28 73 65 74 2d 6d 65 67 61 74 65 73 74 ne (set-megatest
0b40: 2d 65 6e 76 2d 76 61 72 73 20 72 75 6e 2d 69 64 -env-vars run-id
0b50: 29 0a 20 20 28 6c 65 74 20 28 28 6b 65 79 73 20 ). (let ((keys
0b60: 28 63 64 62 3a 72 65 6d 6f 74 65 2d 72 75 6e 20 (cdb:remote-run
0b70: 64 62 3a 67 65 74 2d 6b 65 79 73 20 23 66 29 29 db:get-keys #f))
0b80: 0a 09 28 76 61 6c 73 20 28 68 61 73 68 2d 74 61 ..(vals (hash-ta
0b90: 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 ble-ref/default
0ba0: 2a 65 6e 76 2d 76 61 72 73 2d 62 79 2d 72 75 6e *env-vars-by-run
0bb0: 2d 69 64 2a 20 72 75 6e 2d 69 64 20 23 66 29 29 -id* run-id #f))
0bc0: 29 0a 20 20 20 20 3b 3b 20 67 65 74 20 74 68 65 ). ;; get the
0bd0: 20 69 6e 66 6f 20 66 72 6f 6d 20 74 68 65 20 64 info from the d
0be0: 62 20 61 6e 64 20 70 75 74 20 69 74 20 69 6e 20 b and put it in
0bf0: 74 68 65 20 63 61 63 68 65 0a 20 20 20 20 28 69 the cache. (i
0c00: 66 20 28 6e 6f 74 20 76 61 6c 73 29 0a 09 28 6c f (not vals)..(l
0c10: 65 74 20 28 28 68 74 20 28 6d 61 6b 65 2d 68 61 et ((ht (make-ha
0c20: 73 68 2d 74 61 62 6c 65 29 29 29 0a 09 20 20 28 sh-table))).. (
0c30: 68 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 hash-table-set!
0c40: 2a 65 6e 76 2d 76 61 72 73 2d 62 79 2d 72 75 6e *env-vars-by-run
0c50: 2d 69 64 2a 20 72 75 6e 2d 69 64 20 68 74 29 0a -id* run-id ht).
0c60: 09 20 20 28 73 65 74 21 20 76 61 6c 73 20 68 74 . (set! vals ht
0c70: 29 0a 09 20 20 28 66 6f 72 2d 65 61 63 68 0a 09 ).. (for-each..
0c80: 20 20 20 28 6c 61 6d 62 64 61 20 28 6b 65 79 29 (lambda (key)
0c90: 0a 09 20 20 20 20 20 28 68 61 73 68 2d 74 61 62 .. (hash-tab
0ca0: 6c 65 2d 73 65 74 21 20 76 61 6c 73 20 6b 65 79 le-set! vals key
0cb0: 20 28 63 64 62 3a 72 65 6d 6f 74 65 2d 72 75 6e (cdb:remote-run
0cc0: 20 64 62 3a 67 65 74 2d 72 75 6e 2d 6b 65 79 2d db:get-run-key-
0cd0: 76 61 6c 20 23 66 20 72 75 6e 2d 69 64 20 6b 65 val #f run-id ke
0ce0: 79 29 29 29 0a 09 20 20 20 6b 65 79 73 29 29 29 y))).. keys)))
0cf0: 0a 20 20 20 20 3b 3b 20 66 72 6f 6d 20 74 68 65 . ;; from the
0d00: 20 63 61 63 68 65 64 20 64 61 74 61 20 73 65 74 cached data set
0d10: 20 74 68 65 20 76 61 72 73 0a 20 20 20 20 28 68 the vars. (h
0d20: 61 73 68 2d 74 61 62 6c 65 2d 66 6f 72 2d 65 61 ash-table-for-ea
0d30: 63 68 0a 20 20 20 20 20 76 61 6c 73 0a 20 20 20 ch. vals.
0d40: 20 20 28 6c 61 6d 62 64 61 20 28 6b 65 79 20 76 (lambda (key v
0d50: 61 6c 29 0a 20 20 20 20 20 20 20 28 64 65 62 75 al). (debu
0d60: 67 3a 70 72 69 6e 74 20 32 20 22 73 65 74 65 6e g:print 2 "seten
0d70: 76 20 22 20 28 6b 65 79 3a 67 65 74 2d 66 69 65 v " (key:get-fie
0d80: 6c 64 6e 61 6d 65 20 6b 65 79 29 20 22 20 22 20 ldname key) " "
0d90: 76 61 6c 29 0a 20 20 20 20 20 20 20 28 73 65 74 val). (set
0da0: 65 6e 76 20 28 6b 65 79 3a 67 65 74 2d 66 69 65 env (key:get-fie
0db0: 6c 64 6e 61 6d 65 20 6b 65 79 29 20 76 61 6c 29 ldname key) val)
0dc0: 29 29 0a 20 20 20 20 28 61 6c 69 73 74 2d 3e 65 )). (alist->e
0dd0: 6e 76 2d 76 61 72 73 20 28 68 61 73 68 2d 74 61 nv-vars (hash-ta
0de0: 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 ble-ref/default
0df0: 2a 63 6f 6e 66 69 67 64 61 74 2a 20 22 65 6e 76 *configdat* "env
0e00: 2d 6f 76 65 72 72 69 64 65 22 20 27 28 29 29 29 -override" '()))
0e10: 0a 20 20 20 20 3b 3b 20 4c 65 74 73 20 75 73 65 . ;; Lets use
0e20: 20 74 68 69 73 20 61 73 20 61 6e 20 6f 70 70 6f this as an oppo
0e30: 72 74 75 6e 69 74 79 20 74 6f 20 70 75 74 20 4d rtunity to put M
0e40: 54 5f 52 55 4e 4e 41 4d 45 20 69 6e 20 74 68 65 T_RUNNAME in the
0e50: 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a 20 20 20 environment.
0e60: 20 28 73 65 74 65 6e 76 20 22 4d 54 5f 52 55 4e (setenv "MT_RUN
0e70: 4e 41 4d 45 22 20 28 63 64 62 3a 72 65 6d 6f 74 NAME" (cdb:remot
0e80: 65 2d 72 75 6e 20 64 62 3a 67 65 74 2d 72 75 6e e-run db:get-run
0e90: 2d 6e 61 6d 65 2d 66 72 6f 6d 2d 69 64 20 23 66 -name-from-id #f
0ea0: 20 72 75 6e 2d 69 64 29 29 0a 20 20 20 20 28 73 run-id)). (s
0eb0: 65 74 65 6e 76 20 22 4d 54 5f 52 55 4e 5f 41 52 etenv "MT_RUN_AR
0ec0: 45 41 5f 48 4f 4d 45 22 20 2a 74 6f 70 70 61 74 EA_HOME" *toppat
0ed0: 68 2a 29 0a 20 20 20 20 29 29 0a 0a 28 64 65 66 h*). ))..(def
0ee0: 69 6e 65 20 28 73 65 74 2d 69 74 65 6d 2d 65 6e ine (set-item-en
0ef0: 76 2d 76 61 72 73 20 69 74 65 6d 64 61 74 29 0a v-vars itemdat).
0f00: 20 20 28 66 6f 72 2d 65 61 63 68 20 28 6c 61 6d (for-each (lam
0f10: 62 64 61 20 28 69 74 65 6d 29 0a 09 20 20 20 20 bda (item)..
0f20: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 32 (debug:print 2
0f30: 20 22 73 65 74 65 6e 76 20 22 20 28 63 61 72 20 "setenv " (car
0f40: 69 74 65 6d 29 20 22 20 22 20 28 63 61 64 72 20 item) " " (cadr
0f50: 69 74 65 6d 29 29 0a 09 20 20 20 20 20 20 28 73 item)).. (s
0f60: 65 74 65 6e 76 20 28 63 61 72 20 69 74 65 6d 29 etenv (car item)
0f70: 20 28 63 61 64 72 20 69 74 65 6d 29 29 29 0a 09 (cadr item)))..
0f80: 20 20 20 20 69 74 65 6d 64 61 74 29 29 0a 0a 28 itemdat))..(
0f90: 64 65 66 69 6e 65 20 2a 6c 61 73 74 2d 6e 75 6d define *last-num
0fa0: 2d 72 75 6e 6e 69 6e 67 2d 74 65 73 74 73 2a 20 -running-tests*
0fb0: 30 29 0a 28 64 65 66 69 6e 65 20 2a 72 75 6e 73 0).(define *runs
0fc0: 3a 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 :can-run-more-te
0fd0: 73 74 73 2d 64 65 6c 61 79 2a 20 30 29 0a 28 64 sts-delay* 0).(d
0fe0: 65 66 69 6e 65 20 28 72 75 6e 73 3a 73 68 72 69 efine (runs:shri
0ff0: 6e 6b 2d 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d nk-can-run-more-
1000: 74 65 73 74 73 2d 64 65 6c 61 79 29 0a 20 20 28 tests-delay). (
1010: 73 65 74 21 20 2a 72 75 6e 73 3a 63 61 6e 2d 72 set! *runs:can-r
1020: 75 6e 2d 6d 6f 72 65 2d 74 65 73 74 73 2d 64 65 un-more-tests-de
1030: 6c 61 79 2a 20 30 29 29 20 3b 3b 20 28 2f 20 2a lay* 0)) ;; (/ *
1040: 72 75 6e 73 3a 63 61 6e 2d 72 75 6e 2d 6d 6f 72 runs:can-run-mor
1050: 65 2d 74 65 73 74 73 2d 64 65 6c 61 79 2a 20 32 e-tests-delay* 2
1060: 29 29 29 0a 0a 28 64 65 66 69 6e 65 20 28 72 75 )))..(define (ru
1070: 6e 73 3a 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d ns:can-run-more-
1080: 74 65 73 74 73 20 74 65 73 74 2d 72 65 63 6f 72 tests test-recor
1090: 64 29 0a 20 20 28 74 68 72 65 61 64 2d 73 6c 65 d). (thread-sle
10a0: 65 70 21 20 2a 72 75 6e 73 3a 63 61 6e 2d 72 75 ep! *runs:can-ru
10b0: 6e 2d 6d 6f 72 65 2d 74 65 73 74 73 2d 64 65 6c n-more-tests-del
10c0: 61 79 2a 29 0a 20 20 28 6c 65 74 2a 20 28 28 74 ay*). (let* ((t
10d0: 63 6f 6e 66 69 67 20 20 20 20 20 20 20 20 20 20 config
10e0: 20 20 20 20 20 20 20 28 74 65 73 74 73 3a 74 65 (tests:te
10f0: 73 74 71 75 65 75 65 2d 67 65 74 2d 74 65 73 74 stqueue-get-test
1100: 63 6f 6e 66 69 67 20 74 65 73 74 2d 72 65 63 6f config test-reco
1110: 72 64 29 29 0a 09 20 28 6a 6f 62 67 72 6f 75 70 rd)).. (jobgroup
1120: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1130: 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 74 (config-lookup t
1140: 63 6f 6e 66 69 67 20 22 72 65 71 75 69 72 65 6d config "requirem
1150: 65 6e 74 73 22 20 22 6a 6f 62 67 72 6f 75 70 22 ents" "jobgroup"
1160: 29 29 0a 09 20 3b 3b 20 48 65 75 72 69 73 74 69 )).. ;; Heuristi
1170: 63 20 66 69 78 2e 20 54 68 65 73 65 20 61 72 65 c fix. These are
1180: 20 67 65 74 74 69 6e 67 20 63 61 6c 6c 65 64 20 getting called
1190: 74 6f 6f 20 72 61 70 69 64 6c 79 20 77 68 65 6e too rapidly when
11a0: 20 6a 6f 62 73 20 61 72 65 20 72 75 6e 6e 69 6e jobs are runnin
11b0: 67 20 6f 72 20 73 74 75 63 6b 0a 09 20 3b 3b 20 g or stuck.. ;;
11c0: 73 6f 20 77 65 20 61 72 65 20 67 6f 69 6e 67 20 so we are going
11d0: 74 6f 20 69 6e 63 72 65 6d 65 6e 74 20 61 20 67 to increment a g
11e0: 6c 6f 62 61 6c 20 64 65 6c 61 79 20 62 79 20 30 lobal delay by 0
11f0: 2e 31 20 73 65 63 6f 6e 64 73 20 75 70 20 74 6f .1 seconds up to
1200: 20 31 30 20 73 65 63 6f 6e 64 73 0a 09 20 3b 3b 10 seconds.. ;;
1210: 20 65 76 65 72 79 20 74 69 6d 65 20 72 75 6e 73 every time runs
1220: 3a 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 :can-run-more-te
1230: 73 74 73 20 69 73 20 63 61 6c 6c 65 64 2e 0a 09 sts is called...
1240: 20 3b 3b 20 77 68 65 6e 20 61 20 74 65 73 74 20 ;; when a test
1250: 69 73 20 6c 61 75 6e 63 68 65 64 20 6f 72 20 6f is launched or o
1260: 74 68 65 72 20 61 63 74 69 76 69 74 79 20 6f 63 ther activity oc
1270: 63 75 72 73 20 64 69 76 69 64 65 20 74 68 65 20 curs divide the
1280: 64 65 6c 61 79 20 62 79 20 32 0a 09 20 28 6e 75 delay by 2.. (nu
1290: 6d 2d 72 75 6e 6e 69 6e 67 20 20 20 20 20 20 20 m-running
12a0: 20 20 20 20 20 20 28 63 64 62 3a 72 65 6d 6f 74 (cdb:remot
12b0: 65 2d 72 75 6e 20 64 62 3a 67 65 74 2d 63 6f 75 e-run db:get-cou
12c0: 6e 74 2d 74 65 73 74 73 2d 72 75 6e 6e 69 6e 67 nt-tests-running
12d0: 20 23 66 29 29 0a 09 20 28 6e 75 6d 2d 72 75 6e #f)).. (num-run
12e0: 6e 69 6e 67 2d 69 6e 2d 6a 6f 62 67 72 6f 75 70 ning-in-jobgroup
12f0: 20 28 63 64 62 3a 72 65 6d 6f 74 65 2d 72 75 6e (cdb:remote-run
1300: 20 64 62 3a 67 65 74 2d 63 6f 75 6e 74 2d 74 65 db:get-count-te
1310: 73 74 73 2d 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a sts-running-in-j
1320: 6f 62 67 72 6f 75 70 20 23 66 20 6a 6f 62 67 72 obgroup #f jobgr
1330: 6f 75 70 29 29 0a 09 20 28 6d 61 78 2d 63 6f 6e oup)).. (max-con
1340: 63 75 72 72 65 6e 74 2d 6a 6f 62 73 20 20 20 20 current-jobs
1350: 20 28 6c 65 74 20 28 28 6d 63 6a 20 28 63 6f 6e (let ((mcj (con
1360: 66 69 67 2d 6c 6f 6f 6b 75 70 20 2a 63 6f 6e 66 fig-lookup *conf
1370: 69 67 64 61 74 2a 20 22 73 65 74 75 70 22 20 20 igdat* "setup"
1380: 20 20 20 22 6d 61 78 5f 63 6f 6e 63 75 72 72 65 "max_concurre
1390: 6e 74 5f 6a 6f 62 73 22 29 29 29 0a 09 09 09 09 nt_jobs"))).....
13a0: 20 20 20 20 28 69 66 20 28 61 6e 64 20 6d 63 6a (if (and mcj
13b0: 20 28 73 74 72 69 6e 67 2d 3e 6e 75 6d 62 65 72 (string->number
13c0: 20 6d 63 6a 29 29 0a 09 09 09 09 09 28 73 74 72 mcj))......(str
13d0: 69 6e 67 2d 3e 6e 75 6d 62 65 72 20 6d 63 6a 29 ing->number mcj)
13e0: 0a 09 09 09 09 09 31 29 29 29 0a 09 20 28 6a 6f ......1))).. (jo
13f0: 62 2d 67 72 6f 75 70 2d 6c 69 6d 69 74 20 20 20 b-group-limit
1400: 20 20 20 20 20 20 28 63 6f 6e 66 69 67 2d 6c 6f (config-lo
1410: 6f 6b 75 70 20 2a 63 6f 6e 66 69 67 64 61 74 2a okup *configdat*
1420: 20 22 6a 6f 62 67 72 6f 75 70 73 22 20 6a 6f 62 "jobgroups" job
1430: 67 72 6f 75 70 29 29 29 0a 20 20 20 20 28 69 66 group))). (if
1440: 20 28 61 6e 64 20 28 3e 20 28 2b 20 6e 75 6d 2d (and (> (+ num-
1450: 72 75 6e 6e 69 6e 67 20 6e 75 6d 2d 72 75 6e 6e running num-runn
1460: 69 6e 67 2d 69 6e 2d 6a 6f 62 67 72 6f 75 70 29 ing-in-jobgroup)
1470: 20 30 29 0a 09 20 20 20 20 20 28 3c 20 2a 72 75 0).. (< *ru
1480: 6e 73 3a 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d ns:can-run-more-
1490: 74 65 73 74 73 2d 64 65 6c 61 79 2a 20 31 29 29 tests-delay* 1))
14a0: 0a 09 28 62 65 67 69 6e 0a 09 20 20 28 73 65 74 ..(begin.. (set
14b0: 21 20 2a 72 75 6e 73 3a 63 61 6e 2d 72 75 6e 2d ! *runs:can-run-
14c0: 6d 6f 72 65 2d 74 65 73 74 73 2d 64 65 6c 61 79 more-tests-delay
14d0: 2a 20 28 2b 20 2a 72 75 6e 73 3a 63 61 6e 2d 72 * (+ *runs:can-r
14e0: 75 6e 2d 6d 6f 72 65 2d 74 65 73 74 73 2d 64 65 un-more-tests-de
14f0: 6c 61 79 2a 20 30 2e 30 30 39 29 29 0a 09 20 20 lay* 0.009))..
1500: 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 (debug:print-inf
1510: 6f 20 31 34 20 22 63 61 6e 2d 72 75 6e 2d 6d 6f o 14 "can-run-mo
1520: 72 65 2d 74 65 73 74 73 2d 64 65 6c 61 79 3a 20 re-tests-delay:
1530: 22 20 2a 72 75 6e 73 3a 63 61 6e 2d 72 75 6e 2d " *runs:can-run-
1540: 6d 6f 72 65 2d 74 65 73 74 73 2d 64 65 6c 61 79 more-tests-delay
1550: 2a 29 29 29 0a 20 20 20 20 28 69 66 20 28 6e 6f *))). (if (no
1560: 74 20 28 65 71 3f 20 2a 6c 61 73 74 2d 6e 75 6d t (eq? *last-num
1570: 2d 72 75 6e 6e 69 6e 67 2d 74 65 73 74 73 2a 20 -running-tests*
1580: 6e 75 6d 2d 72 75 6e 6e 69 6e 67 29 29 0a 09 28 num-running))..(
1590: 62 65 67 69 6e 0a 09 20 20 28 64 65 62 75 67 3a begin.. (debug:
15a0: 70 72 69 6e 74 20 32 20 22 6d 61 78 2d 63 6f 6e print 2 "max-con
15b0: 63 75 72 72 65 6e 74 2d 6a 6f 62 73 3a 20 22 20 current-jobs: "
15c0: 6d 61 78 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a max-concurrent-j
15d0: 6f 62 73 20 22 2c 20 6e 75 6d 2d 72 75 6e 6e 69 obs ", num-runni
15e0: 6e 67 3a 20 22 20 6e 75 6d 2d 72 75 6e 6e 69 6e ng: " num-runnin
15f0: 67 29 0a 09 20 20 28 73 65 74 21 20 2a 6c 61 73 g).. (set! *las
1600: 74 2d 6e 75 6d 2d 72 75 6e 6e 69 6e 67 2d 74 65 t-num-running-te
1610: 73 74 73 2a 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 sts* num-running
1620: 29 29 29 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 ))). (if (not
1630: 20 28 65 71 3f 20 30 20 2a 67 6c 6f 62 61 6c 65 (eq? 0 *globale
1640: 78 69 74 73 74 61 74 75 73 2a 29 29 0a 09 28 6c xitstatus*))..(l
1650: 69 73 74 20 23 66 20 6e 75 6d 2d 72 75 6e 6e 69 ist #f num-runni
1660: 6e 67 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 2d 69 ng num-running-i
1670: 6e 2d 6a 6f 62 67 72 6f 75 70 20 6d 61 78 2d 63 n-jobgroup max-c
1680: 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 20 6a oncurrent-jobs j
1690: 6f 62 2d 67 72 6f 75 70 2d 6c 69 6d 69 74 29 0a ob-group-limit).
16a0: 09 28 6c 65 74 20 28 28 63 61 6e 2d 6e 6f 74 2d .(let ((can-not-
16b0: 72 75 6e 2d 6d 6f 72 65 20 28 63 6f 6e 64 0a 09 run-more (cond..
16c0: 09 09 09 20 3b 3b 20 69 66 20 6d 61 78 2d 63 6f ... ;; if max-co
16d0: 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 20 69 73 ncurrent-jobs is
16e0: 20 73 65 74 20 61 6e 64 20 74 68 65 20 6e 75 6d set and the num
16f0: 62 65 72 20 72 75 6e 6e 69 6e 67 20 69 73 20 67 ber running is g
1700: 72 65 61 74 65 72 20 0a 09 09 09 09 20 3b 3b 20 reater ..... ;;
1710: 74 68 61 6e 20 69 74 20 74 68 61 6e 20 63 61 6e than it than can
1720: 6e 6f 74 20 72 75 6e 20 6d 6f 72 65 20 6a 6f 62 not run more job
1730: 73 0a 09 09 09 09 20 28 28 61 6e 64 20 6d 61 78 s..... ((and max
1740: 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 -concurrent-jobs
1750: 20 28 3e 3d 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 (>= num-running
1760: 20 6d 61 78 2d 63 6f 6e 63 75 72 72 65 6e 74 2d max-concurrent-
1770: 6a 6f 62 73 29 29 0a 09 09 09 09 20 20 28 64 65 jobs))..... (de
1780: 62 75 67 3a 70 72 69 6e 74 20 30 20 22 57 41 52 bug:print 0 "WAR
1790: 4e 49 4e 47 3a 20 4d 61 78 20 72 75 6e 6e 69 6e NING: Max runnin
17a0: 67 20 6a 6f 62 73 20 65 78 63 65 65 64 65 64 2c g jobs exceeded,
17b0: 20 63 75 72 72 65 6e 74 20 6e 75 6d 62 65 72 20 current number
17c0: 72 75 6e 6e 69 6e 67 3a 20 22 20 6e 75 6d 2d 72 running: " num-r
17d0: 75 6e 6e 69 6e 67 20 0a 09 09 09 09 09 20 20 20 unning ......
17e0: 20 20 20 20 22 2c 20 6d 61 78 5f 63 6f 6e 63 75 ", max_concu
17f0: 72 72 65 6e 74 5f 6a 6f 62 73 3a 20 22 20 6d 61 rrent_jobs: " ma
1800: 78 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 x-concurrent-job
1810: 73 29 0a 09 09 09 09 20 20 23 74 29 0a 09 09 09 s)..... #t)....
1820: 09 20 3b 3b 20 69 66 20 6a 6f 62 2d 67 72 6f 75 . ;; if job-grou
1830: 70 2d 6c 69 6d 69 74 20 69 73 20 73 65 74 20 61 p-limit is set a
1840: 6e 64 20 6e 75 6d 62 65 72 20 6f 66 20 6a 6f 62 nd number of job
1850: 73 20 69 6e 20 74 68 65 20 67 72 6f 75 70 20 69 s in the group i
1860: 73 20 67 72 65 61 74 65 72 0a 09 09 09 09 20 3b s greater..... ;
1870: 3b 20 74 68 61 6e 20 74 68 65 20 6c 69 6d 69 74 ; than the limit
1880: 20 74 68 65 6e 20 63 61 6e 6e 6f 74 20 72 75 6e then cannot run
1890: 20 6d 6f 72 65 20 6a 6f 62 73 20 6f 66 20 74 68 more jobs of th
18a0: 69 73 20 6b 69 6e 64 0a 09 09 09 09 20 28 28 61 is kind..... ((a
18b0: 6e 64 20 6a 6f 62 2d 67 72 6f 75 70 2d 6c 69 6d nd job-group-lim
18c0: 69 74 0a 09 09 09 09 20 20 20 20 20 20 20 28 3e it..... (>
18d0: 3d 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 2d 69 6e = num-running-in
18e0: 2d 6a 6f 62 67 72 6f 75 70 20 6a 6f 62 2d 67 72 -jobgroup job-gr
18f0: 6f 75 70 2d 6c 69 6d 69 74 29 29 0a 09 09 09 09 oup-limit)).....
1900: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 31 (debug:print 1
1910: 20 22 57 41 52 4e 49 4e 47 3a 20 6e 75 6d 62 65 "WARNING: numbe
1920: 72 20 6f 66 20 6a 6f 62 73 20 22 20 6e 75 6d 2d r of jobs " num-
1930: 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a 6f 62 67 72 running-in-jobgr
1940: 6f 75 70 20 0a 09 09 09 09 09 20 20 20 20 20 20 oup ......
1950: 20 22 20 69 6e 20 22 20 6a 6f 62 67 72 6f 75 70 " in " jobgroup
1960: 20 22 20 65 78 63 65 65 64 65 64 2c 20 77 69 6c " exceeded, wil
1970: 6c 20 6e 6f 74 20 72 75 6e 20 22 20 28 74 65 73 l not run " (tes
1980: 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 ts:testqueue-get
1990: 2d 74 65 73 74 6e 61 6d 65 20 74 65 73 74 2d 72 -testname test-r
19a0: 65 63 6f 72 64 29 29 0a 09 09 09 09 20 20 23 74 ecord))..... #t
19b0: 29 0a 09 09 09 09 20 28 65 6c 73 65 20 23 66 29 )..... (else #f)
19c0: 29 29 29 0a 09 20 20 28 6c 69 73 74 20 28 6e 6f ))).. (list (no
19d0: 74 20 63 61 6e 2d 6e 6f 74 2d 72 75 6e 2d 6d 6f t can-not-run-mo
19e0: 72 65 29 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 20 re) num-running
19f0: 6e 75 6d 2d 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a num-running-in-j
1a00: 6f 62 67 72 6f 75 70 20 6d 61 78 2d 63 6f 6e 63 obgroup max-conc
1a10: 75 72 72 65 6e 74 2d 6a 6f 62 73 20 6a 6f 62 2d urrent-jobs job-
1a20: 67 72 6f 75 70 2d 6c 69 6d 69 74 29 29 29 29 29 group-limit)))))
1a30: 0a 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ..;;============
1a40: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1a50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1a60: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1a70: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 4e 65 ==========.;; Ne
1a80: 77 20 6d 65 74 68 6f 64 6f 6c 6f 67 79 2e 20 54 w methodology. T
1a90: 68 65 73 65 20 72 6f 75 74 69 6e 65 73 20 77 69 hese routines wi
1aa0: 6c 6c 20 72 65 70 6c 61 63 65 20 74 68 65 20 61 ll replace the a
1ab0: 62 6f 76 65 20 69 6e 20 74 69 6d 65 2e 20 46 6f bove in time. Fo
1ac0: 72 0a 3b 3b 20 6e 6f 77 20 74 68 65 20 63 6f 64 r.;; now the cod
1ad0: 65 20 69 73 20 64 75 70 6c 69 63 61 74 65 64 2e e is duplicated.
1ae0: 20 54 68 69 73 20 73 74 75 66 66 20 69 73 20 69 This stuff is i
1af0: 6e 69 74 69 61 6c 6c 79 20 75 73 65 64 20 69 6e nitially used in
1b00: 20 74 68 65 20 6d 6f 6e 69 74 6f 72 0a 3b 3b 20 the monitor.;;
1b10: 62 61 73 65 64 20 63 6f 64 65 2e 0a 3b 3b 3d 3d based code..;;==
1b20: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1b30: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1b40: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1b50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1b60: 3d 3d 3d 3d 0a 0a 0a 3b 3b 20 54 68 69 73 20 69 ====...;; This i
1b70: 73 20 61 20 64 75 70 6c 69 63 61 74 65 20 6f 66 s a duplicate of
1b80: 20 72 75 6e 2d 74 65 73 74 73 20 28 77 68 69 63 run-tests (whic
1b90: 68 20 68 61 73 20 62 65 65 6e 20 64 65 70 72 65 h has been depre
1ba0: 63 61 74 65 64 29 2e 20 55 73 65 20 74 68 69 73 cated). Use this
1bb0: 20 6f 6e 65 20 69 6e 73 74 65 61 64 20 6f 66 20 one instead of
1bc0: 72 75 6e 20 74 65 73 74 73 2e 0a 3b 3b 20 6b 65 run tests..;; ke
1bd0: 79 76 61 6c 73 2e 0a 3b 3b 0a 3b 3b 20 20 74 65 yvals..;;.;; te
1be0: 73 74 2d 6e 61 6d 65 73 3a 20 43 6f 6d 6d 61 20 st-names: Comma
1bf0: 73 65 70 61 72 61 74 65 64 20 70 61 74 74 65 72 separated patter
1c00: 6e 73 20 73 61 6d 65 20 61 73 20 74 65 73 74 2d ns same as test-
1c10: 70 61 74 74 73 20 62 75 74 20 75 73 65 64 20 69 patts but used i
1c20: 6e 20 73 65 6c 65 63 74 69 6f 6e 20 0a 3b 3b 20 n selection .;;
1c30: 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 66 20 of
1c40: 74 65 73 74 73 20 74 6f 20 72 75 6e 2e 20 54 68 tests to run. Th
1c50: 65 20 69 74 65 6d 20 70 6f 72 74 69 6f 6e 73 20 e item portions
1c60: 61 72 65 20 6e 6f 74 20 72 65 73 70 65 63 74 65 are not respecte
1c70: 64 2e 0a 3b 3b 20 20 20 20 20 20 20 20 20 20 20 d..;;
1c80: 20 20 20 46 49 58 4d 45 3a 20 65 72 72 6f 72 20 FIXME: error
1c90: 6f 75 74 20 69 66 20 2f 70 61 74 74 20 73 70 65 out if /patt spe
1ca0: 63 69 66 69 65 64 0a 3b 3b 20 20 20 20 20 20 20 cified.;;
1cb0: 20 20 20 20 20 0a 28 64 65 66 69 6e 65 20 28 72 .(define (r
1cc0: 75 6e 73 3a 72 75 6e 2d 74 65 73 74 73 20 74 61 uns:run-tests ta
1cd0: 72 67 65 74 20 72 75 6e 6e 61 6d 65 20 74 65 73 rget runname tes
1ce0: 74 2d 6e 61 6d 65 73 20 74 65 73 74 2d 70 61 74 t-names test-pat
1cf0: 74 73 20 75 73 65 72 20 66 6c 61 67 73 29 0a 20 ts user flags).
1d00: 20 28 63 6f 6d 6d 6f 6e 3a 63 6c 65 61 72 2d 63 (common:clear-c
1d10: 61 63 68 65 73 29 20 3b 3b 20 63 6c 65 61 72 20 aches) ;; clear
1d20: 61 6c 6c 20 63 61 63 68 65 73 0a 20 20 28 6c 65 all caches. (le
1d30: 74 2a 20 28 28 64 62 20 20 20 20 20 20 20 20 20 t* ((db
1d40: 20 23 66 29 0a 09 20 28 6b 65 79 73 20 20 20 20 #f).. (keys
1d50: 20 20 20 20 28 63 64 62 3a 72 65 6d 6f 74 65 2d (cdb:remote-
1d60: 72 75 6e 20 64 62 3a 67 65 74 2d 6b 65 79 73 20 run db:get-keys
1d70: 23 66 29 29 0a 09 20 28 6b 65 79 76 61 6c 6c 73 #f)).. (keyvalls
1d80: 74 20 20 20 28 6b 65 79 73 3a 74 61 72 67 65 74 t (keys:target
1d90: 2d 3e 6b 65 79 76 61 6c 20 6b 65 79 73 20 74 61 ->keyval keys ta
1da0: 72 67 65 74 29 29 0a 09 20 28 72 75 6e 2d 69 64 rget)).. (run-id
1db0: 20 20 20 20 20 20 28 63 64 62 3a 72 65 6d 6f 74 (cdb:remot
1dc0: 65 2d 72 75 6e 20 64 62 3a 72 65 67 69 73 74 65 e-run db:registe
1dd0: 72 2d 72 75 6e 20 23 66 20 6b 65 79 73 20 6b 65 r-run #f keys ke
1de0: 79 76 61 6c 6c 73 74 20 72 75 6e 6e 61 6d 65 20 yvallst runname
1df0: 22 6e 65 77 22 20 22 6e 2f 61 22 20 75 73 65 72 "new" "n/a" user
1e00: 29 29 20 20 3b 3b 20 20 74 65 73 74 2d 6e 61 6d )) ;; test-nam
1e10: 65 29 29 29 0a 09 20 28 6b 65 79 76 61 6c 73 20 e))).. (keyvals
1e20: 20 20 20 20 28 69 66 20 72 75 6e 2d 69 64 20 28 (if run-id (
1e30: 63 64 62 3a 72 65 6d 6f 74 65 2d 72 75 6e 20 64 cdb:remote-run d
1e40: 62 3a 67 65 74 2d 6b 65 79 2d 76 61 6c 73 20 23 b:get-key-vals #
1e50: 66 20 72 75 6e 2d 69 64 29 20 23 66 29 29 0a 09 f run-id) #f))..
1e60: 20 28 64 65 66 65 72 72 65 64 20 20 20 20 27 28 (deferred '(
1e70: 29 29 20 3b 3b 20 64 65 6c 61 79 20 72 75 6e 6e )) ;; delay runn
1e80: 69 6e 67 20 74 68 65 73 65 20 73 69 6e 63 65 20 ing these since
1e90: 74 68 65 79 20 68 61 76 65 20 61 20 77 61 69 74 they have a wait
1ea0: 6f 6e 20 63 6c 61 75 73 65 0a 09 20 3b 3b 20 6b on clause.. ;; k
1eb0: 65 65 70 67 6f 69 6e 67 20 69 73 20 74 68 65 20 eepgoing is the
1ec0: 64 65 66 61 63 74 6f 20 6d 6f 64 61 6c 69 74 79 defacto modality
1ed0: 20 6e 6f 77 2c 20 77 69 6c 6c 20 61 64 64 20 68 now, will add h
1ee0: 69 74 2d 6e 2d 72 75 6e 20 61 20 62 69 74 20 6c it-n-run a bit l
1ef0: 61 74 65 72 0a 09 20 3b 3b 20 28 6b 65 65 70 67 ater.. ;; (keepg
1f00: 6f 69 6e 67 20 20 20 28 68 61 73 68 2d 74 61 62 oing (hash-tab
1f10: 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 66 le-ref/default f
1f20: 6c 61 67 73 20 22 2d 6b 65 65 70 67 6f 69 6e 67 lags "-keepgoing
1f30: 22 20 23 66 29 29 0a 09 20 28 72 75 6e 63 6f 6e " #f)).. (runcon
1f40: 66 69 67 66 20 20 20 28 63 6f 6e 63 20 20 2a 74 figf (conc *t
1f50: 6f 70 70 61 74 68 2a 20 22 2f 72 75 6e 63 6f 6e oppath* "/runcon
1f60: 66 69 67 73 2e 63 6f 6e 66 69 67 22 29 29 0a 09 figs.config"))..
1f70: 20 28 72 65 71 75 69 72 65 64 2d 74 65 73 74 73 (required-tests
1f80: 20 27 28 29 29 0a 09 20 28 74 65 73 74 2d 72 65 '()).. (test-re
1f90: 63 6f 72 64 73 20 28 6d 61 6b 65 2d 68 61 73 68 cords (make-hash
1fa0: 2d 74 61 62 6c 65 29 29 29 0a 0a 20 20 20 20 28 -table))).. (
1fb0: 73 65 74 2d 6d 65 67 61 74 65 73 74 2d 65 6e 76 set-megatest-env
1fc0: 2d 76 61 72 73 20 72 75 6e 2d 69 64 29 20 3b 3b -vars run-id) ;;
1fd0: 20 74 68 65 73 65 20 6d 61 79 20 62 65 20 6e 65 these may be ne
1fe0: 65 64 65 64 20 62 79 20 74 68 65 20 6c 61 75 6e eded by the laun
1ff0: 63 68 69 6e 67 20 70 72 6f 63 65 73 73 0a 0a 20 ching process..
2000: 20 20 20 28 69 66 20 28 66 69 6c 65 2d 65 78 69 (if (file-exi
2010: 73 74 73 3f 20 72 75 6e 63 6f 6e 66 69 67 66 29 sts? runconfigf)
2020: 0a 09 28 73 65 74 75 70 2d 65 6e 76 2d 64 65 66 ..(setup-env-def
2030: 61 75 6c 74 73 20 72 75 6e 63 6f 6e 66 69 67 66 aults runconfigf
2040: 20 72 75 6e 2d 69 64 20 2a 61 6c 72 65 61 64 79 run-id *already
2050: 2d 73 65 65 6e 2d 72 75 6e 63 6f 6e 66 69 67 2d -seen-runconfig-
2060: 69 6e 66 6f 2a 20 6b 65 79 73 20 6b 65 79 76 61 info* keys keyva
2070: 6c 73 20 22 70 72 65 2d 6c 61 75 6e 63 68 2d 65 ls "pre-launch-e
2080: 6e 76 2d 76 61 72 73 22 29 0a 09 28 64 65 62 75 nv-vars")..(debu
2090: 67 3a 70 72 69 6e 74 20 30 20 22 57 41 52 4e 49 g:print 0 "WARNI
20a0: 4e 47 3a 20 59 6f 75 20 64 6f 20 6e 6f 74 20 68 NG: You do not h
20b0: 61 76 65 20 61 20 72 75 6e 20 63 6f 6e 66 69 67 ave a run config
20c0: 20 66 69 6c 65 3a 20 22 20 72 75 6e 63 6f 6e 66 file: " runconf
20d0: 69 67 66 29 29 0a 20 20 20 20 0a 20 20 20 20 3b igf)). . ;
20e0: 3b 20 6c 6f 6f 6b 20 75 70 20 61 6c 6c 20 74 65 ; look up all te
20f0: 73 74 73 20 6d 61 74 63 68 69 6e 67 20 74 68 65 sts matching the
2100: 20 63 6f 6d 6d 61 20 73 65 70 61 72 61 74 65 64 comma separated
2110: 20 6c 69 73 74 20 6f 66 20 67 6c 6f 62 73 20 69 list of globs i
2120: 6e 0a 20 20 20 20 3b 3b 20 74 65 73 74 2d 70 61 n. ;; test-pa
2130: 74 74 73 20 28 75 73 69 6e 67 20 25 20 61 73 20 tts (using % as
2140: 77 69 6c 64 63 61 72 64 29 0a 0a 20 20 20 20 28 wildcard).. (
2150: 73 65 74 21 20 74 65 73 74 2d 6e 61 6d 65 73 20 set! test-names
2160: 28 74 65 73 74 73 3a 67 65 74 2d 76 61 6c 69 64 (tests:get-valid
2170: 2d 74 65 73 74 73 20 2a 74 6f 70 70 61 74 68 2a -tests *toppath*
2180: 20 74 65 73 74 2d 6e 61 6d 65 73 29 29 0a 20 20 test-names)).
2190: 20 20 28 73 65 74 21 20 74 65 73 74 2d 6e 61 6d (set! test-nam
21a0: 65 73 20 28 64 65 6c 65 74 65 2d 64 75 70 6c 69 es (delete-dupli
21b0: 63 61 74 65 73 20 74 65 73 74 2d 6e 61 6d 65 73 cates test-names
21c0: 29 29 0a 0a 20 20 20 20 28 64 65 62 75 67 3a 70 )).. (debug:p
21d0: 72 69 6e 74 2d 69 6e 66 6f 20 30 20 22 74 65 73 rint-info 0 "tes
21e0: 74 20 6e 61 6d 65 73 20 22 20 74 65 73 74 2d 6e t names " test-n
21f0: 61 6d 65 73 29 0a 0a 20 20 20 20 3b 3b 20 6f 6e ames).. ;; on
2200: 20 74 68 65 20 66 69 72 73 74 20 70 61 73 73 20 the first pass
2210: 6f 72 20 63 61 6c 6c 20 74 6f 20 72 75 6e 2d 74 or call to run-t
2220: 65 73 74 73 20 73 65 74 20 46 41 49 4c 53 20 74 ests set FAILS t
2230: 6f 20 4e 4f 54 5f 53 54 41 52 54 45 44 20 69 66 o NOT_STARTED if
2240: 0a 20 20 20 20 3b 3b 20 2d 6b 65 65 70 67 6f 69 . ;; -keepgoi
2250: 6e 67 20 69 73 20 73 70 65 63 69 66 69 65 64 0a ng is specified.
2260: 20 20 20 20 28 69 66 20 28 65 71 3f 20 2a 70 61 (if (eq? *pa
2270: 73 73 6e 75 6d 2a 20 30 29 0a 09 28 62 65 67 69 ssnum* 0)..(begi
2280: 6e 0a 09 20 20 3b 3b 20 68 61 76 65 20 74 6f 20 n.. ;; have to
2290: 64 65 6c 65 74 65 20 74 65 73 74 20 72 65 63 6f delete test reco
22a0: 72 64 73 20 77 68 65 72 65 20 4e 4f 54 5f 53 54 rds where NOT_ST
22b0: 41 52 54 45 44 20 73 69 6e 63 65 20 74 68 65 79 ARTED since they
22c0: 20 63 61 6e 20 63 61 75 73 65 20 2d 6b 65 65 70 can cause -keep
22d0: 67 6f 69 6e 67 20 74 6f 20 0a 09 20 20 3b 3b 20 going to .. ;;
22e0: 67 65 74 20 73 74 75 63 6b 20 64 75 65 20 74 6f get stuck due to
22f0: 20 62 65 63 6f 6d 69 6e 67 20 69 6e 61 63 63 65 becoming inacce
2300: 73 73 69 62 6c 65 20 66 72 6f 6d 20 61 20 66 61 ssible from a fa
2310: 69 6c 65 64 20 74 65 73 74 2e 20 49 2e 65 2e 20 iled test. I.e.
2320: 69 66 20 74 65 73 74 20 42 20 64 65 70 65 6e 64 if test B depend
2330: 73 20 0a 09 20 20 3b 3b 20 6f 6e 20 74 65 73 74 s .. ;; on test
2340: 20 41 20 62 75 74 20 74 65 73 74 20 42 20 72 65 A but test B re
2350: 61 63 68 65 64 20 74 68 65 20 70 6f 69 6e 74 20 ached the point
2360: 6f 6e 20 62 65 69 6e 67 20 72 65 67 69 73 74 65 on being registe
2370: 72 65 64 20 61 73 20 4e 4f 54 5f 53 54 41 52 54 red as NOT_START
2380: 45 44 20 61 6e 64 20 74 65 73 74 0a 09 20 20 3b ED and test.. ;
2390: 3b 20 41 20 66 61 69 6c 65 64 20 66 6f 72 20 73 ; A failed for s
23a0: 6f 6d 65 20 72 65 61 73 6f 6e 20 74 68 65 6e 20 ome reason then
23b0: 6f 6e 20 72 65 2d 72 75 6e 20 75 73 69 6e 67 20 on re-run using
23c0: 2d 6b 65 65 70 67 6f 69 6e 67 20 74 68 65 20 72 -keepgoing the r
23d0: 75 6e 20 63 61 6e 20 6e 65 76 65 72 20 63 6f 6d un can never com
23e0: 70 6c 65 74 65 2e 0a 09 20 20 28 63 64 62 3a 64 plete... (cdb:d
23f0: 65 6c 65 74 65 2d 74 65 73 74 73 2d 69 6e 2d 73 elete-tests-in-s
2400: 74 61 74 65 20 2a 72 75 6e 72 65 6d 6f 74 65 2a tate *runremote*
2410: 20 72 75 6e 2d 69 64 20 22 4e 4f 54 5f 53 54 41 run-id "NOT_STA
2420: 52 54 45 44 22 29 0a 09 20 20 28 63 64 62 3a 72 RTED").. (cdb:r
2430: 65 6d 6f 74 65 2d 72 75 6e 20 64 62 3a 73 65 74 emote-run db:set
2440: 2d 74 65 73 74 73 2d 73 74 61 74 65 2d 73 74 61 -tests-state-sta
2450: 74 75 73 20 23 66 20 72 75 6e 2d 69 64 20 74 65 tus #f run-id te
2460: 73 74 2d 6e 61 6d 65 73 20 23 66 20 22 46 41 49 st-names #f "FAI
2470: 4c 22 20 22 4e 4f 54 5f 53 54 41 52 54 45 44 22 L" "NOT_STARTED"
2480: 20 22 46 41 49 4c 22 29 29 29 0a 0a 20 20 20 20 "FAIL")))..
2490: 3b 3b 20 66 72 6f 6d 20 68 65 72 65 20 6f 6e 20 ;; from here on
24a0: 6f 75 74 20 74 68 65 20 64 62 20 77 69 6c 6c 20 out the db will
24b0: 62 65 20 6f 70 65 6e 65 64 20 61 6e 64 20 63 6c be opened and cl
24c0: 6f 73 65 64 20 6f 6e 20 65 76 65 72 79 20 63 61 osed on every ca
24d0: 6c 6c 20 72 75 6e 73 3a 72 75 6e 2d 74 65 73 74 ll runs:run-test
24e0: 73 2d 71 75 65 75 65 0a 20 20 20 20 3b 3b 20 28 s-queue. ;; (
24f0: 73 71 6c 69 74 65 33 3a 66 69 6e 61 6c 69 7a 65 sqlite3:finalize
2500: 21 20 64 62 29 20 0a 20 20 20 20 3b 3b 20 6e 6f ! db) . ;; no
2510: 77 20 61 64 64 20 6e 6f 6e 2d 64 69 72 65 63 74 w add non-direct
2520: 6c 79 20 72 65 66 65 72 65 6e 63 65 64 20 64 65 ly referenced de
2530: 70 65 6e 64 65 6e 63 69 65 73 20 28 69 2e 65 2e pendencies (i.e.
2540: 20 77 61 69 74 6f 6e 29 0a 20 20 20 20 28 69 66 waiton). (if
2550: 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 65 73 (not (null? tes
2560: 74 2d 6e 61 6d 65 73 29 29 0a 09 28 6c 65 74 20 t-names))..(let
2570: 6c 6f 6f 70 20 28 28 68 65 64 20 28 63 61 72 20 loop ((hed (car
2580: 74 65 73 74 2d 6e 61 6d 65 73 29 29 0a 09 09 20 test-names))...
2590: 20 20 28 74 61 6c 20 28 63 64 72 20 74 65 73 74 (tal (cdr test
25a0: 2d 6e 61 6d 65 73 29 29 29 20 20 20 20 20 20 20 -names)))
25b0: 20 20 3b 3b 20 27 72 65 74 75 72 6e 2d 70 72 6f ;; 'return-pro
25c0: 63 73 20 74 65 6c 6c 73 20 74 68 65 20 63 6f 6e cs tells the con
25d0: 66 69 67 20 72 65 61 64 65 72 20 74 6f 20 70 72 fig reader to pr
25e0: 65 70 20 72 75 6e 6e 69 6e 67 20 73 79 73 74 65 ep running syste
25f0: 6d 20 62 75 74 20 72 65 74 75 72 6e 20 61 20 70 m but return a p
2600: 72 6f 63 0a 09 20 20 28 64 65 62 75 67 3a 70 72 roc.. (debug:pr
2610: 69 6e 74 2d 69 6e 66 6f 20 34 20 22 68 65 64 3d int-info 4 "hed=
2620: 22 20 68 65 64 20 22 20 61 74 20 74 6f 70 20 6f " hed " at top o
2630: 66 20 6c 6f 6f 70 22 29 0a 09 20 20 28 6c 65 74 f loop").. (let
2640: 2a 20 28 28 63 6f 6e 66 69 67 20 20 28 74 65 73 * ((config (tes
2650: 74 73 3a 67 65 74 2d 74 65 73 74 63 6f 6e 66 69 ts:get-testconfi
2660: 67 20 68 65 64 20 27 72 65 74 75 72 6e 2d 70 72 g hed 'return-pr
2670: 6f 63 73 29 29 0a 09 09 20 28 77 61 69 74 6f 6e ocs))... (waiton
2680: 73 20 28 6c 65 74 20 28 28 69 6e 73 74 72 20 28 s (let ((instr (
2690: 69 66 20 63 6f 6e 66 69 67 20 0a 09 09 09 09 09 if config ......
26a0: 20 20 20 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 (config-looku
26b0: 70 20 63 6f 6e 66 69 67 20 22 72 65 71 75 69 72 p config "requir
26c0: 65 6d 65 6e 74 73 22 20 22 77 61 69 74 6f 6e 22 ements" "waiton"
26d0: 29 0a 09 09 09 09 09 20 20 20 28 62 65 67 69 6e )...... (begin
26e0: 20 3b 3b 20 4e 6f 20 63 6f 6e 66 69 67 20 6d 65 ;; No config me
26f0: 61 6e 73 20 74 68 69 73 20 69 73 20 61 20 6e 6f ans this is a no
2700: 6e 2d 65 78 69 73 74 61 6e 74 20 74 65 73 74 0a n-existant test.
2710: 09 09 09 09 09 20 20 20 20 20 28 64 65 62 75 67 ..... (debug
2720: 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a :print 0 "ERROR:
2730: 20 6e 6f 6e 2d 65 78 69 73 74 65 6e 74 20 72 65 non-existent re
2740: 71 75 69 72 65 64 20 74 65 73 74 20 5c 22 22 20 quired test \""
2750: 68 65 64 20 22 5c 22 22 29 0a 09 09 09 09 09 20 hed "\"")......
2760: 20 20 20 20 28 69 66 20 64 62 20 28 73 71 6c 69 (if db (sqli
2770: 74 65 33 3a 66 69 6e 61 6c 69 7a 65 21 20 64 62 te3:finalize! db
2780: 29 29 0a 09 09 09 09 09 20 20 20 20 20 28 65 78 ))...... (ex
2790: 69 74 20 31 29 29 29 29 29 0a 09 09 09 20 20 20 it 1)))))....
27a0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e (debug:print-in
27b0: 66 6f 20 38 20 22 77 61 69 74 6f 6e 73 20 73 74 fo 8 "waitons st
27c0: 72 69 6e 67 20 69 73 20 22 20 69 6e 73 74 72 29 ring is " instr)
27d0: 0a 09 09 09 20 20 20 20 28 73 74 72 69 6e 67 2d .... (string-
27e0: 73 70 6c 69 74 20 28 63 6f 6e 64 0a 09 09 09 09 split (cond.....
27f0: 09 20 20 20 28 28 70 72 6f 63 65 64 75 72 65 3f . ((procedure?
2800: 20 69 6e 73 74 72 29 0a 09 09 09 09 09 20 20 20 instr)......
2810: 20 28 6c 65 74 20 28 28 72 65 73 20 28 69 6e 73 (let ((res (ins
2820: 74 72 29 29 29 0a 09 09 09 09 09 20 20 20 20 20 tr)))......
2830: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e (debug:print-in
2840: 66 6f 20 38 20 22 77 61 69 74 6f 6e 20 70 72 6f fo 8 "waiton pro
2850: 63 65 64 75 72 65 20 72 65 73 75 6c 74 73 20 69 cedure results i
2860: 6e 20 73 74 72 69 6e 67 20 22 20 72 65 73 20 22 n string " res "
2870: 20 66 6f 72 20 74 65 73 74 20 22 20 68 65 64 29 for test " hed)
2880: 0a 09 09 09 09 09 20 20 20 20 20 20 72 65 73 29 ...... res)
2890: 29 0a 09 09 09 09 09 20 20 20 28 28 73 74 72 69 )...... ((stri
28a0: 6e 67 3f 20 69 6e 73 74 72 29 20 20 20 20 20 69 ng? instr) i
28b0: 6e 73 74 72 29 0a 09 09 09 09 09 20 20 20 28 65 nstr)...... (e
28c0: 6c 73 65 20 0a 09 09 09 09 09 20 20 20 20 3b 3b lse ...... ;;
28d0: 20 4e 4f 54 45 3a 20 54 68 69 73 20 69 73 20 61 NOTE: This is a
28e0: 63 74 75 61 6c 6c 79 20 74 68 65 20 63 61 73 65 ctually the case
28f0: 20 6f 66 20 2a 6e 6f 2a 20 77 61 69 74 6f 6e 73 of *no* waitons
2900: 21 20 3b 3b 20 28 64 65 62 75 67 3a 70 72 69 6e ! ;; (debug:prin
2910: 74 20 30 20 22 45 52 52 4f 52 3a 20 73 6f 6d 65 t 0 "ERROR: some
2920: 74 68 69 6e 67 20 77 65 6e 74 20 77 72 6f 6e 67 thing went wrong
2930: 20 69 6e 20 70 72 6f 63 65 73 73 69 6e 67 20 77 in processing w
2940: 61 69 74 6f 6e 73 20 66 6f 72 20 74 65 73 74 20 aitons for test
2950: 22 20 68 65 64 29 0a 09 09 09 09 09 20 20 20 20 " hed)......
2960: 22 22 29 29 29 29 29 29 0a 09 20 20 20 20 28 64 "")))))).. (d
2970: 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 ebug:print-info
2980: 38 20 22 77 61 69 74 6f 6e 73 3a 20 22 20 77 61 8 "waitons: " wa
2990: 69 74 6f 6e 73 29 0a 09 20 20 20 20 3b 3b 20 63 itons).. ;; c
29a0: 68 65 63 6b 20 66 6f 72 20 68 65 64 20 69 6e 20 heck for hed in
29b0: 77 61 69 74 6f 6e 73 20 3d 3e 20 74 68 69 73 20 waitons => this
29c0: 77 6f 75 6c 64 20 62 65 20 63 69 72 63 75 6c 61 would be circula
29d0: 72 2c 20 72 65 6d 6f 76 65 20 69 74 20 61 6e 64 r, remove it and
29e0: 20 69 73 73 75 65 20 61 6e 0a 09 20 20 20 20 3b issue an.. ;
29f0: 3b 20 65 72 72 6f 72 0a 09 20 20 20 20 28 69 66 ; error.. (if
2a00: 20 28 6d 65 6d 62 65 72 20 68 65 64 20 77 61 69 (member hed wai
2a10: 74 6f 6e 73 29 0a 09 09 28 62 65 67 69 6e 0a 09 tons)...(begin..
2a20: 09 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 . (debug:print
2a30: 30 20 22 45 52 52 4f 52 3a 20 74 65 73 74 20 22 0 "ERROR: test "
2a40: 20 68 65 64 20 22 20 68 61 73 20 6c 69 73 74 65 hed " has liste
2a50: 64 20 69 74 73 65 6c 66 20 61 73 20 61 20 77 61 d itself as a wa
2a60: 69 74 6f 6e 2c 20 70 6c 65 61 73 65 20 63 6f 72 iton, please cor
2a70: 72 65 63 74 20 74 68 69 73 21 22 29 0a 09 09 20 rect this!")...
2a80: 20 28 73 65 74 21 20 77 61 69 74 6f 6e 73 20 28 (set! waitons (
2a90: 66 69 6c 74 65 72 20 28 6c 61 6d 62 64 61 20 28 filter (lambda (
2aa0: 78 29 28 6e 6f 74 20 28 65 71 75 61 6c 3f 20 78 x)(not (equal? x
2ab0: 20 68 65 64 29 29 29 20 77 61 69 74 6f 6e 73 29 hed))) waitons)
2ac0: 29 29 29 0a 09 20 20 20 20 0a 09 20 20 20 20 3b ))).. .. ;
2ad0: 3b 20 28 69 74 65 6d 73 20 20 20 28 69 74 65 6d ; (items (item
2ae0: 73 3a 67 65 74 2d 69 74 65 6d 73 2d 66 72 6f 6d s:get-items-from
2af0: 2d 63 6f 6e 66 69 67 20 63 6f 6e 66 69 67 29 29 -config config))
2b00: 29 0a 09 20 20 20 20 28 69 66 20 28 6e 6f 74 20 ).. (if (not
2b10: 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 2f (hash-table-ref/
2b20: 64 65 66 61 75 6c 74 20 74 65 73 74 2d 72 65 63 default test-rec
2b30: 6f 72 64 73 20 68 65 64 20 23 66 29 29 0a 09 09 ords hed #f))...
2b40: 28 68 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 (hash-table-set!
2b50: 20 74 65 73 74 2d 72 65 63 6f 72 64 73 0a 09 09 test-records...
2b60: 09 09 20 68 65 64 20 28 76 65 63 74 6f 72 20 68 .. hed (vector h
2b70: 65 64 20 20 20 20 20 3b 3b 20 30 0a 09 09 09 09 ed ;; 0.....
2b80: 09 20 20 20 20 20 63 6f 6e 66 69 67 20 20 3b 3b . config ;;
2b90: 20 31 0a 09 09 09 09 09 20 20 20 20 20 77 61 69 1...... wai
2ba0: 74 6f 6e 73 20 3b 3b 20 32 0a 09 09 09 09 09 20 tons ;; 2......
2bb0: 20 20 20 20 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b (config-look
2bc0: 75 70 20 63 6f 6e 66 69 67 20 22 72 65 71 75 69 up config "requi
2bd0: 72 65 6d 65 6e 74 73 22 20 22 70 72 69 6f 72 69 rements" "priori
2be0: 74 79 22 29 20 20 20 20 20 3b 3b 20 70 72 69 6f ty") ;; prio
2bf0: 72 69 74 79 20 33 0a 09 09 09 09 09 20 20 20 20 rity 3......
2c00: 20 28 6c 65 74 20 28 28 69 74 65 6d 73 20 20 20 (let ((items
2c10: 20 20 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 (hash-table-r
2c20: 65 66 2f 64 65 66 61 75 6c 74 20 63 6f 6e 66 69 ef/default confi
2c30: 67 20 22 69 74 65 6d 73 22 20 23 66 29 29 20 3b g "items" #f)) ;
2c40: 3b 20 69 74 65 6d 73 20 34 0a 09 09 09 09 09 09 ; items 4.......
2c50: 20 20 20 28 69 74 65 6d 73 74 61 62 6c 65 20 28 (itemstable (
2c60: 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 2f 64 hash-table-ref/d
2c70: 65 66 61 75 6c 74 20 63 6f 6e 66 69 67 20 22 69 efault config "i
2c80: 74 65 6d 73 74 61 62 6c 65 22 20 23 66 29 29 29 temstable" #f)))
2c90: 20 0a 09 09 09 09 09 20 20 20 20 20 20 20 3b 3b ...... ;;
2ca0: 20 69 66 20 65 69 74 68 65 72 20 69 74 65 6d 73 if either items
2cb0: 20 6f 72 20 69 74 65 6d 73 20 74 61 62 6c 65 20 or items table
2cc0: 69 73 20 61 20 70 72 6f 63 20 72 65 74 75 72 6e is a proc return
2cd0: 20 69 74 20 73 6f 20 74 65 73 74 20 72 75 6e 6e it so test runn
2ce0: 69 6e 67 0a 09 09 09 09 09 20 20 20 20 20 20 20 ing......
2cf0: 3b 3b 20 70 72 6f 63 65 73 73 20 63 61 6e 20 6b ;; process can k
2d00: 6e 6f 77 20 74 6f 20 63 61 6c 6c 20 69 74 65 6d now to call item
2d10: 73 3a 67 65 74 2d 69 74 65 6d 73 2d 66 72 6f 6d s:get-items-from
2d20: 2d 63 6f 6e 66 69 67 0a 09 09 09 09 09 20 20 20 -config......
2d30: 20 20 20 20 3b 3b 20 69 66 20 65 69 74 68 65 72 ;; if either
2d40: 20 69 73 20 61 20 6c 69 73 74 20 61 6e 64 20 6e is a list and n
2d50: 6f 6e 65 20 69 73 20 61 20 70 72 6f 63 20 67 6f one is a proc go
2d60: 20 61 68 65 61 64 20 61 6e 64 20 63 61 6c 6c 20 ahead and call
2d70: 67 65 74 2d 69 74 65 6d 73 0a 09 09 09 09 09 20 get-items......
2d80: 20 20 20 20 20 20 3b 3b 20 6f 74 68 65 72 77 69 ;; otherwi
2d90: 73 65 20 72 65 74 75 72 6e 20 23 66 20 2d 20 74 se return #f - t
2da0: 68 69 73 20 69 73 20 6e 6f 74 20 61 6e 20 69 74 his is not an it
2db0: 65 72 61 74 65 64 20 74 65 73 74 0a 09 09 09 09 erated test.....
2dc0: 09 20 20 20 20 20 20 20 28 63 6f 6e 64 0a 09 09 . (cond...
2dd0: 09 09 09 09 28 28 70 72 6f 63 65 64 75 72 65 3f ....((procedure?
2de0: 20 69 74 65 6d 73 29 20 20 20 20 20 20 0a 09 09 items) ...
2df0: 09 09 09 09 20 28 64 65 62 75 67 3a 70 72 69 6e .... (debug:prin
2e00: 74 2d 69 6e 66 6f 20 34 20 22 69 74 65 6d 73 20 t-info 4 "items
2e10: 69 73 20 61 20 70 72 6f 63 65 64 75 72 65 2c 20 is a procedure,
2e20: 77 69 6c 6c 20 63 61 6c 63 20 6c 61 74 65 72 22 will calc later"
2e30: 29 0a 09 09 09 09 09 09 20 69 74 65 6d 73 29 20 )....... items)
2e40: 20 20 20 20 20 20 20 20 20 20 20 3b 3b 20 63 61 ;; ca
2e50: 6c 63 20 6c 61 74 65 72 0a 09 09 09 09 09 09 28 lc later.......(
2e60: 28 70 72 6f 63 65 64 75 72 65 3f 20 69 74 65 6d (procedure? item
2e70: 73 74 61 62 6c 65 29 0a 09 09 09 09 09 09 20 28 stable)....... (
2e80: 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f debug:print-info
2e90: 20 34 20 22 69 74 65 6d 73 74 61 62 6c 65 20 69 4 "itemstable i
2ea0: 73 20 61 20 70 72 6f 63 65 64 75 72 65 2c 20 77 s a procedure, w
2eb0: 69 6c 6c 20 63 61 6c 63 20 6c 61 74 65 72 22 29 ill calc later")
2ec0: 0a 09 09 09 09 09 09 20 69 74 65 6d 73 74 61 62 ....... itemstab
2ed0: 6c 65 29 20 20 20 20 20 20 20 3b 3b 20 63 61 6c le) ;; cal
2ee0: 63 20 6c 61 74 65 72 0a 09 09 09 09 09 09 28 28 c later.......((
2ef0: 66 69 6c 74 65 72 20 28 6c 61 6d 62 64 61 20 28 filter (lambda (
2f00: 78 29 0a 09 09 09 09 09 09 09 20 20 20 28 6c 65 x)........ (le
2f10: 74 20 28 28 76 61 6c 20 28 63 61 72 20 78 29 29 t ((val (car x))
2f20: 29 0a 09 09 09 09 09 09 09 20 20 20 20 20 28 69 )........ (i
2f30: 66 20 28 70 72 6f 63 65 64 75 72 65 3f 20 76 61 f (procedure? va
2f40: 6c 29 20 76 61 6c 20 23 66 29 29 29 0a 09 09 09 l) val #f)))....
2f50: 09 09 09 09 20 28 61 70 70 65 6e 64 20 28 69 66 .... (append (if
2f60: 20 28 6c 69 73 74 3f 20 69 74 65 6d 73 29 20 69 (list? items) i
2f70: 74 65 6d 73 20 27 28 29 29 0a 09 09 09 09 09 09 tems '()).......
2f80: 09 09 20 28 69 66 20 28 6c 69 73 74 3f 20 69 74 .. (if (list? it
2f90: 65 6d 73 74 61 62 6c 65 29 20 69 74 65 6d 73 74 emstable) itemst
2fa0: 61 62 6c 65 20 27 28 29 29 29 29 0a 09 09 09 09 able '()))).....
2fb0: 09 09 20 27 68 61 76 65 2d 70 72 6f 63 65 64 75 .. 'have-procedu
2fc0: 72 65 29 0a 09 09 09 09 09 09 28 28 6f 72 20 28 re).......((or (
2fd0: 6c 69 73 74 3f 20 69 74 65 6d 73 29 28 6c 69 73 list? items)(lis
2fe0: 74 3f 20 69 74 65 6d 73 74 61 62 6c 65 29 29 20 t? itemstable))
2ff0: 3b 3b 20 63 61 6c 63 20 6e 6f 77 0a 09 09 09 09 ;; calc now.....
3000: 09 09 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d .. (debug:print-
3010: 69 6e 66 6f 20 34 20 22 69 74 65 6d 73 20 61 6e info 4 "items an
3020: 64 20 69 74 65 6d 73 74 61 62 6c 65 20 61 72 65 d itemstable are
3030: 20 6c 69 73 74 73 2c 20 63 61 6c 63 20 6e 6f 77 lists, calc now
3040: 5c 6e 22 0a 09 09 09 09 09 09 09 20 20 20 20 20 \n"........
3050: 20 22 20 20 20 20 69 74 65 6d 73 3a 20 22 20 69 " items: " i
3060: 74 65 6d 73 20 22 20 69 74 65 6d 73 74 61 62 6c tems " itemstabl
3070: 65 3a 20 22 20 69 74 65 6d 73 74 61 62 6c 65 29 e: " itemstable)
3080: 0a 09 09 09 09 09 09 20 28 69 74 65 6d 73 3a 67 ....... (items:g
3090: 65 74 2d 69 74 65 6d 73 2d 66 72 6f 6d 2d 63 6f et-items-from-co
30a0: 6e 66 69 67 20 63 6f 6e 66 69 67 29 29 0a 09 09 nfig config))...
30b0: 09 09 09 09 28 65 6c 73 65 20 23 66 29 29 29 20 ....(else #f)))
30c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
30d0: 20 20 20 20 20 20 20 20 20 20 3b 3b 20 6e 6f 74 ;; not
30e0: 20 69 74 65 72 61 74 65 64 0a 09 09 09 09 09 20 iterated......
30f0: 20 20 20 20 23 66 20 20 20 20 20 20 3b 3b 20 69 #f ;; i
3100: 74 65 6d 73 64 61 74 20 35 0a 09 09 09 09 09 20 temsdat 5......
3110: 20 20 20 20 23 66 20 20 20 20 20 20 3b 3b 20 73 #f ;; s
3120: 70 61 72 65 20 2d 20 75 73 65 64 20 66 6f 72 20 pare - used for
3130: 69 74 65 6d 2d 70 61 74 68 0a 09 09 09 09 09 20 item-path......
3140: 20 20 20 20 29 29 29 0a 09 20 20 20 20 28 66 6f ))).. (fo
3150: 72 2d 65 61 63 68 20 0a 09 20 20 20 20 20 28 6c r-each .. (l
3160: 61 6d 62 64 61 20 28 77 61 69 74 6f 6e 29 0a 09 ambda (waiton)..
3170: 20 20 20 20 20 20 20 28 69 66 20 28 61 6e 64 20 (if (and
3180: 77 61 69 74 6f 6e 20 28 6e 6f 74 20 28 6d 65 6d waiton (not (mem
3190: 62 65 72 20 77 61 69 74 6f 6e 20 74 65 73 74 2d ber waiton test-
31a0: 6e 61 6d 65 73 29 29 29 0a 09 09 20 20 20 28 62 names)))... (b
31b0: 65 67 69 6e 0a 09 09 20 20 20 20 20 28 73 65 74 egin... (set
31c0: 21 20 72 65 71 75 69 72 65 64 2d 74 65 73 74 73 ! required-tests
31d0: 20 28 63 6f 6e 73 20 77 61 69 74 6f 6e 20 72 65 (cons waiton re
31e0: 71 75 69 72 65 64 2d 74 65 73 74 73 29 29 0a 09 quired-tests))..
31f0: 09 20 20 20 20 20 28 73 65 74 21 20 74 65 73 74 . (set! test
3200: 2d 6e 61 6d 65 73 20 28 63 6f 6e 73 20 77 61 69 -names (cons wai
3210: 74 6f 6e 20 74 65 73 74 2d 6e 61 6d 65 73 29 29 ton test-names))
3220: 29 29 29 20 3b 3b 20 77 61 73 20 61 6e 20 61 70 ))) ;; was an ap
3230: 70 65 6e 64 2c 20 6e 6f 77 20 61 20 63 6f 6e 73 pend, now a cons
3240: 0a 09 20 20 20 20 20 77 61 69 74 6f 6e 73 29 0a .. waitons).
3250: 09 20 20 20 20 28 6c 65 74 20 28 28 72 65 6d 74 . (let ((remt
3260: 65 73 74 73 20 28 64 65 6c 65 74 65 2d 64 75 70 ests (delete-dup
3270: 6c 69 63 61 74 65 73 20 28 61 70 70 65 6e 64 20 licates (append
3280: 77 61 69 74 6f 6e 73 20 74 61 6c 29 29 29 29 0a waitons tal)))).
3290: 09 20 20 20 20 20 20 28 69 66 20 28 6e 6f 74 20 . (if (not
32a0: 28 6e 75 6c 6c 3f 20 72 65 6d 74 65 73 74 73 29 (null? remtests)
32b0: 29 0a 09 09 20 20 28 6c 6f 6f 70 20 28 63 61 72 )... (loop (car
32c0: 20 72 65 6d 74 65 73 74 73 29 28 63 64 72 20 72 remtests)(cdr r
32d0: 65 6d 74 65 73 74 73 29 29 29 29 29 29 29 0a 0a emtests)))))))..
32e0: 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 6e 75 (if (not (nu
32f0: 6c 6c 3f 20 72 65 71 75 69 72 65 64 2d 74 65 73 ll? required-tes
3300: 74 73 29 29 0a 09 28 64 65 62 75 67 3a 70 72 69 ts))..(debug:pri
3310: 6e 74 2d 69 6e 66 6f 20 31 20 22 41 64 64 69 6e nt-info 1 "Addin
3320: 67 20 22 20 72 65 71 75 69 72 65 64 2d 74 65 73 g " required-tes
3330: 74 73 20 22 20 74 6f 20 74 68 65 20 72 75 6e 20 ts " to the run
3340: 71 75 65 75 65 22 29 29 0a 20 20 20 20 3b 3b 20 queue")). ;;
3350: 4e 4f 54 45 3a 20 74 68 65 73 65 20 61 72 65 20 NOTE: these are
3360: 61 6c 6c 20 70 61 72 65 6e 74 20 74 65 73 74 73 all parent tests
3370: 2c 20 69 74 65 6d 73 20 61 72 65 20 6e 6f 74 20 , items are not
3380: 65 78 70 61 6e 64 65 64 20 79 65 74 2e 0a 20 20 expanded yet..
3390: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 (debug:print-i
33a0: 6e 66 6f 20 34 20 22 74 65 73 74 2d 72 65 63 6f nfo 4 "test-reco
33b0: 72 64 73 3d 22 20 28 68 61 73 68 2d 74 61 62 6c rds=" (hash-tabl
33c0: 65 2d 3e 61 6c 69 73 74 20 74 65 73 74 2d 72 65 e->alist test-re
33d0: 63 6f 72 64 73 29 29 0a 20 20 20 20 28 72 75 6e cords)). (run
33e0: 73 3a 72 75 6e 2d 74 65 73 74 73 2d 71 75 65 75 s:run-tests-queu
33f0: 65 20 72 75 6e 2d 69 64 20 72 75 6e 6e 61 6d 65 e run-id runname
3400: 20 74 65 73 74 2d 72 65 63 6f 72 64 73 20 6b 65 test-records ke
3410: 79 76 61 6c 6c 73 74 20 66 6c 61 67 73 20 74 65 yvallst flags te
3420: 73 74 2d 70 61 74 74 73 29 0a 20 20 20 20 28 64 st-patts). (d
3430: 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 ebug:print-info
3440: 34 20 22 41 6c 6c 20 64 6f 6e 65 20 62 79 20 68 4 "All done by h
3450: 65 72 65 22 29 29 29 0a 0a 28 64 65 66 69 6e 65 ere")))..(define
3460: 20 28 72 75 6e 73 3a 63 61 6c 63 2d 66 61 69 6c (runs:calc-fail
3470: 73 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 s prereqs-not-me
3480: 74 29 0a 20 20 28 66 69 6c 74 65 72 20 28 6c 61 t). (filter (la
3490: 6d 62 64 61 20 28 74 65 73 74 29 0a 09 20 20 20 mbda (test)..
34a0: 20 28 61 6e 64 20 28 76 65 63 74 6f 72 3f 20 74 (and (vector? t
34b0: 65 73 74 29 20 3b 3b 20 6e 6f 74 20 28 73 74 72 est) ;; not (str
34c0: 69 6e 67 3f 20 74 65 73 74 29 29 0a 09 09 20 28 ing? test))... (
34d0: 65 71 75 61 6c 3f 20 28 64 62 3a 74 65 73 74 2d equal? (db:test-
34e0: 67 65 74 2d 73 74 61 74 65 20 74 65 73 74 29 20 get-state test)
34f0: 22 43 4f 4d 50 4c 45 54 45 44 22 29 0a 09 09 20 "COMPLETED")...
3500: 28 6e 6f 74 20 28 6d 65 6d 62 65 72 20 28 64 62 (not (member (db
3510: 3a 74 65 73 74 2d 67 65 74 2d 73 74 61 74 75 73 :test-get-status
3520: 20 74 65 73 74 29 0a 09 09 09 20 20 20 20 20 20 test)....
3530: 27 28 22 50 41 53 53 22 20 22 57 41 52 4e 22 20 '("PASS" "WARN"
3540: 22 43 48 45 43 4b 22 20 22 57 41 49 56 45 44 22 "CHECK" "WAIVED"
3550: 20 22 53 4b 49 50 22 29 29 29 29 29 0a 09 20 20 "SKIP")))))..
3560: 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 prereqs-not-met)
3570: 29 0a 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 )..(define (runs
3580: 3a 63 61 6c 63 2d 6e 6f 74 2d 63 6f 6d 70 6c 65 :calc-not-comple
3590: 74 65 64 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d ted prereqs-not-
35a0: 6d 65 74 29 0a 20 20 28 66 69 6c 74 65 72 0a 20 met). (filter.
35b0: 20 20 28 6c 61 6d 62 64 61 20 28 74 29 0a 20 20 (lambda (t).
35c0: 20 20 20 28 6f 72 20 28 6e 6f 74 20 28 76 65 63 (or (not (vec
35d0: 74 6f 72 3f 20 74 29 29 0a 09 20 28 6e 6f 74 20 tor? t)).. (not
35e0: 28 65 71 75 61 6c 3f 20 22 43 4f 4d 50 4c 45 54 (equal? "COMPLET
35f0: 45 44 22 20 28 64 62 3a 74 65 73 74 2d 67 65 74 ED" (db:test-get
3600: 2d 73 74 61 74 65 20 74 29 29 29 29 29 0a 20 20 -state t))))).
3610: 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 prereqs-not-met
3620: 29 29 0a 0a 28 64 65 66 69 6e 65 20 28 72 75 6e ))..(define (run
3630: 73 3a 70 72 65 74 74 79 2d 73 74 72 69 6e 67 20 s:pretty-string
3640: 6c 73 74 29 0a 20 20 28 6d 61 70 20 28 6c 61 6d lst). (map (lam
3650: 62 64 61 20 28 74 29 0a 09 20 28 69 66 20 28 6e bda (t).. (if (n
3660: 6f 74 20 28 76 65 63 74 6f 72 3f 20 74 29 29 0a ot (vector? t)).
3670: 09 20 20 20 20 20 28 63 6f 6e 63 20 74 29 0a 09 . (conc t)..
3680: 20 20 20 20 20 28 63 6f 6e 63 20 28 64 62 3a 74 (conc (db:t
3690: 65 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 est-get-testname
36a0: 20 74 29 20 22 3a 22 20 28 64 62 3a 74 65 73 74 t) ":" (db:test
36b0: 2d 67 65 74 2d 73 74 61 74 65 20 74 29 20 22 2f -get-state t) "/
36c0: 22 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 73 " (db:test-get-s
36d0: 74 61 74 75 73 20 74 29 29 29 29 0a 20 20 20 20 tatus t)))).
36e0: 20 20 20 6c 73 74 29 29 0a 0a 28 64 65 66 69 6e lst))..(defin
36f0: 65 20 28 72 75 6e 73 3a 6d 61 6b 65 2d 66 75 6c e (runs:make-ful
3700: 6c 2d 74 65 73 74 2d 6e 61 6d 65 20 74 65 73 74 l-test-name test
3710: 6e 61 6d 65 20 69 74 65 6d 70 61 74 68 29 0a 20 name itempath).
3720: 20 28 69 66 20 28 65 71 75 61 6c 3f 20 69 74 65 (if (equal? ite
3730: 6d 70 61 74 68 20 22 22 29 20 74 65 73 74 6e 61 mpath "") testna
3740: 6d 65 20 28 63 6f 6e 63 20 74 65 73 74 6e 61 6d me (conc testnam
3750: 65 20 22 2f 22 20 69 74 65 6d 70 61 74 68 29 29 e "/" itempath))
3760: 29 0a 0a 3b 3b 20 74 65 73 74 2d 72 65 63 6f 72 )..;; test-recor
3770: 64 73 20 69 73 20 61 20 68 61 73 68 20 74 61 62 ds is a hash tab
3780: 6c 65 20 74 65 73 74 6e 61 6d 65 3a 69 74 65 6d le testname:item
3790: 5f 70 61 74 68 20 3d 3e 20 76 65 63 74 6f 72 20 _path => vector
37a0: 3c 20 74 65 73 74 6e 61 6d 65 20 74 65 73 74 63 < testname testc
37b0: 6f 6e 66 69 67 20 77 61 69 74 6f 6e 73 20 70 72 onfig waitons pr
37c0: 69 6f 72 69 74 79 20 69 74 65 6d 73 2d 69 6e 66 iority items-inf
37d0: 6f 20 2e 2e 2e 20 3e 0a 28 64 65 66 69 6e 65 20 o ... >.(define
37e0: 28 72 75 6e 73 3a 72 75 6e 2d 74 65 73 74 73 2d (runs:run-tests-
37f0: 71 75 65 75 65 20 72 75 6e 2d 69 64 20 72 75 6e queue run-id run
3800: 6e 61 6d 65 20 74 65 73 74 2d 72 65 63 6f 72 64 name test-record
3810: 73 20 6b 65 79 76 61 6c 6c 73 74 20 66 6c 61 67 s keyvallst flag
3820: 73 20 74 65 73 74 2d 70 61 74 74 73 29 0a 20 20 s test-patts).
3830: 20 20 3b 3b 20 41 74 20 74 68 69 73 20 70 6f 69 ;; At this poi
3840: 6e 74 20 74 68 65 20 6c 69 73 74 20 6f 66 20 70 nt the list of p
3850: 61 72 65 6e 74 20 74 65 73 74 73 20 69 73 20 65 arent tests is e
3860: 78 70 61 6e 64 65 64 20 0a 20 20 20 20 3b 3b 20 xpanded . ;;
3870: 4e 42 2f 2f 20 53 68 6f 75 6c 64 20 65 78 70 61 NB// Should expa
3880: 6e 64 20 69 74 65 6d 73 20 68 65 72 65 20 61 6e nd items here an
3890: 64 20 74 68 65 6e 20 69 6e 73 65 72 74 20 69 6e d then insert in
38a0: 74 6f 20 74 68 65 20 72 75 6e 20 71 75 65 75 65 to the run queue
38b0: 2e 0a 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 .. (debug:print
38c0: 20 35 20 22 74 65 73 74 2d 72 65 63 6f 72 64 73 5 "test-records
38d0: 3a 20 22 20 74 65 73 74 2d 72 65 63 6f 72 64 73 : " test-records
38e0: 20 22 2c 20 6b 65 79 76 61 6c 6c 73 74 3a 20 22 ", keyvallst: "
38f0: 20 6b 65 79 76 61 6c 6c 73 74 20 22 20 66 6c 61 keyvallst " fla
3900: 67 73 3a 20 22 20 28 68 61 73 68 2d 74 61 62 6c gs: " (hash-tabl
3910: 65 2d 3e 61 6c 69 73 74 20 66 6c 61 67 73 29 29 e->alist flags))
3920: 0a 20 20 28 6c 65 74 20 28 28 73 6f 72 74 65 64 . (let ((sorted
3930: 2d 74 65 73 74 2d 6e 61 6d 65 73 20 28 74 65 73 -test-names (tes
3940: 74 73 3a 73 6f 72 74 2d 62 79 2d 70 72 69 6f 72 ts:sort-by-prior
3950: 69 74 79 2d 61 6e 64 2d 77 61 69 74 6f 6e 20 74 ity-and-waiton t
3960: 65 73 74 2d 72 65 63 6f 72 64 73 29 29 0a 09 28 est-records))..(
3970: 74 65 73 74 2d 72 65 67 69 73 74 65 72 79 20 20 test-registery
3980: 20 20 28 6d 61 6b 65 2d 68 61 73 68 2d 74 61 62 (make-hash-tab
3990: 6c 65 29 29 0a 09 28 72 65 67 69 73 74 65 72 79 le))..(registery
39a0: 2d 6d 75 74 65 78 20 20 20 28 6d 61 6b 65 2d 6d -mutex (make-m
39b0: 75 74 65 78 29 29 0a 09 28 6e 75 6d 2d 72 65 74 utex))..(num-ret
39c0: 72 69 65 73 20 20 20 20 20 20 20 20 30 29 0a 09 ries 0)..
39d0: 28 6d 61 78 2d 72 65 74 72 69 65 73 20 20 20 20 (max-retries
39e0: 20 20 20 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 (config-looku
39f0: 70 20 2a 63 6f 6e 66 69 67 64 61 74 2a 20 22 73 p *configdat* "s
3a00: 65 74 75 70 22 20 22 6d 61 78 72 65 74 72 69 65 etup" "maxretrie
3a10: 73 22 29 29 29 0a 20 20 20 20 28 73 65 74 21 20 s"))). (set!
3a20: 6d 61 78 2d 72 65 74 72 69 65 73 20 28 69 66 20 max-retries (if
3a30: 28 61 6e 64 20 6d 61 78 2d 72 65 74 72 69 65 73 (and max-retries
3a40: 20 28 73 74 72 69 6e 67 2d 3e 6e 75 6d 62 65 72 (string->number
3a50: 20 6d 61 78 2d 72 65 74 72 69 65 73 29 29 28 73 max-retries))(s
3a60: 74 72 69 6e 67 2d 3e 6e 75 6d 62 65 72 20 6d 61 tring->number ma
3a70: 78 2d 72 65 74 72 69 65 73 29 20 31 30 30 29 29 x-retries) 100))
3a80: 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 6e . (if (not (n
3a90: 75 6c 6c 3f 20 73 6f 72 74 65 64 2d 74 65 73 74 ull? sorted-test
3aa0: 2d 6e 61 6d 65 73 29 29 0a 09 28 6c 65 74 20 6c -names))..(let l
3ab0: 6f 6f 70 20 28 28 68 65 64 20 20 20 20 20 20 20 oop ((hed
3ac0: 20 20 28 63 61 72 20 73 6f 72 74 65 64 2d 74 65 (car sorted-te
3ad0: 73 74 2d 6e 61 6d 65 73 29 29 0a 09 09 20 20 20 st-names))...
3ae0: 28 74 61 6c 20 20 20 20 20 20 20 20 20 28 63 64 (tal (cd
3af0: 72 20 73 6f 72 74 65 64 2d 74 65 73 74 2d 6e 61 r sorted-test-na
3b00: 6d 65 73 29 29 0a 09 09 20 20 20 28 72 65 72 75 mes))... (reru
3b10: 6e 73 20 20 20 20 20 20 27 28 29 29 29 0a 09 20 ns '()))..
3b20: 20 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f (if (not (null?
3b30: 20 72 65 72 75 6e 73 29 29 28 64 65 62 75 67 3a reruns))(debug:
3b40: 70 72 69 6e 74 2d 69 6e 66 6f 20 34 20 22 72 65 print-info 4 "re
3b50: 72 75 6e 73 3d 22 20 72 65 72 75 6e 73 29 29 0a runs=" reruns)).
3b60: 09 20 20 3b 3b 20 28 70 72 69 6e 74 20 22 54 6f . ;; (print "To
3b70: 70 20 6f 66 20 6c 6f 6f 70 2c 20 68 65 64 3d 22 p of loop, hed="
3b80: 20 68 65 64 20 22 2c 20 74 61 6c 3d 22 20 74 61 hed ", tal=" ta
3b90: 6c 20 22 20 2c 72 65 72 75 6e 73 3d 22 20 72 65 l " ,reruns=" re
3ba0: 72 75 6e 73 29 0a 09 20 20 28 6c 65 74 2a 20 28 runs).. (let* (
3bb0: 28 74 65 73 74 2d 72 65 63 6f 72 64 20 28 68 61 (test-record (ha
3bc0: 73 68 2d 74 61 62 6c 65 2d 72 65 66 20 74 65 73 sh-table-ref tes
3bd0: 74 2d 72 65 63 6f 72 64 73 20 68 65 64 29 29 0a t-records hed)).
3be0: 09 09 20 28 74 65 73 74 2d 6e 61 6d 65 20 20 20 .. (test-name
3bf0: 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 (tests:testqueue
3c00: 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 74 65 -get-testname te
3c10: 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 09 20 28 st-record))... (
3c20: 74 63 6f 6e 66 69 67 20 20 20 20 20 28 74 65 73 tconfig (tes
3c30: 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 ts:testqueue-get
3c40: 2d 74 65 73 74 63 6f 6e 66 69 67 20 74 65 73 74 -testconfig test
3c50: 2d 72 65 63 6f 72 64 29 29 0a 09 09 20 28 74 65 -record))... (te
3c60: 73 74 6d 6f 64 65 20 20 20 20 28 6c 65 74 20 28 stmode (let (
3c70: 28 6d 20 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 (m (config-looku
3c80: 70 20 74 63 6f 6e 66 69 67 20 22 72 65 71 75 69 p tconfig "requi
3c90: 72 65 6d 65 6e 74 73 22 20 22 6d 6f 64 65 22 29 rements" "mode")
3ca0: 29 29 0a 09 09 09 09 28 69 66 20 6d 20 28 73 74 )).....(if m (st
3cb0: 72 69 6e 67 2d 3e 73 79 6d 62 6f 6c 20 6d 29 20 ring->symbol m)
3cc0: 27 6e 6f 72 6d 61 6c 29 29 29 0a 09 09 20 28 77 'normal)))... (w
3cd0: 61 69 74 6f 6e 73 20 20 20 20 20 28 74 65 73 74 aitons (test
3ce0: 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d s:testqueue-get-
3cf0: 77 61 69 74 6f 6e 73 20 20 20 20 74 65 73 74 2d waitons test-
3d00: 72 65 63 6f 72 64 29 29 0a 09 09 20 28 70 72 69 record))... (pri
3d10: 6f 72 69 74 79 20 20 20 20 28 74 65 73 74 73 3a ority (tests:
3d20: 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d 70 72 testqueue-get-pr
3d30: 69 6f 72 69 74 79 20 20 20 74 65 73 74 2d 72 65 iority test-re
3d40: 63 6f 72 64 29 29 0a 09 09 20 28 69 74 65 6d 64 cord))... (itemd
3d50: 61 74 20 20 20 20 20 28 74 65 73 74 73 3a 74 65 at (tests:te
3d60: 73 74 71 75 65 75 65 2d 67 65 74 2d 69 74 65 6d stqueue-get-item
3d70: 64 61 74 20 20 20 20 74 65 73 74 2d 72 65 63 6f dat test-reco
3d80: 72 64 29 29 20 3b 3b 20 69 74 65 6d 64 61 74 20 rd)) ;; itemdat
3d90: 63 61 6e 20 62 65 20 61 20 73 74 72 69 6e 67 2c can be a string,
3da0: 20 6c 69 73 74 20 6f 72 20 23 66 0a 09 09 20 28 list or #f... (
3db0: 69 74 65 6d 73 20 20 20 20 20 20 20 28 74 65 73 items (tes
3dc0: 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 ts:testqueue-get
3dd0: 2d 69 74 65 6d 73 20 20 20 20 20 20 74 65 73 74 -items test
3de0: 2d 72 65 63 6f 72 64 29 29 0a 09 09 20 28 69 74 -record))... (it
3df0: 65 6d 2d 70 61 74 68 20 20 20 28 69 74 65 6d 2d em-path (item-
3e00: 6c 69 73 74 2d 3e 70 61 74 68 20 69 74 65 6d 64 list->path itemd
3e10: 61 74 29 29 0a 09 09 20 28 6e 65 77 74 61 6c 20 at))... (newtal
3e20: 20 20 20 20 20 28 61 70 70 65 6e 64 20 74 61 6c (append tal
3e30: 20 28 6c 69 73 74 20 68 65 64 29 29 29 29 0a 09 (list hed))))..
3e40: 20 20 20 20 0a 09 20 20 20 20 28 64 65 62 75 67 .. (debug
3e50: 3a 70 72 69 6e 74 20 36 0a 09 09 09 20 22 74 65 :print 6.... "te
3e60: 73 74 2d 6e 61 6d 65 3a 20 22 20 74 65 73 74 2d st-name: " test-
3e70: 6e 61 6d 65 0a 09 09 09 20 22 5c 6e 20 20 68 65 name.... "\n he
3e80: 64 3a 20 20 20 20 20 20 20 20 20 22 20 68 65 64 d: " hed
3e90: 0a 09 09 09 20 22 5c 6e 20 20 69 74 65 6d 64 61 .... "\n itemda
3ea0: 74 3a 20 20 20 20 20 22 20 69 74 65 6d 64 61 74 t: " itemdat
3eb0: 0a 09 09 09 20 22 5c 6e 20 20 69 74 65 6d 73 3a .... "\n items:
3ec0: 20 20 20 20 20 20 20 22 20 69 74 65 6d 73 0a 09 " items..
3ed0: 09 09 20 22 5c 6e 20 20 69 74 65 6d 2d 70 61 74 .. "\n item-pat
3ee0: 68 3a 20 20 20 22 20 69 74 65 6d 2d 70 61 74 68 h: " item-path
3ef0: 0a 09 09 09 20 22 5c 6e 20 20 77 61 69 74 6f 6e .... "\n waiton
3f00: 73 3a 20 20 20 20 20 22 20 77 61 69 74 6f 6e 73 s: " waitons
3f10: 0a 09 09 09 20 22 5c 6e 20 20 6e 75 6d 2d 72 65 .... "\n num-re
3f20: 74 72 69 65 73 3a 20 22 20 6e 75 6d 2d 72 65 74 tries: " num-ret
3f30: 72 69 65 73 0a 09 09 09 20 22 5c 6e 20 20 74 61 ries.... "\n ta
3f40: 6c 3a 20 20 20 20 20 20 20 20 20 22 20 74 61 6c l: " tal
3f50: 0a 09 09 09 20 22 5c 6e 20 20 72 65 72 75 6e 73 .... "\n reruns
3f60: 3a 20 20 20 20 20 20 22 20 72 65 72 75 6e 73 29 : " reruns)
3f70: 0a 0a 09 20 20 20 20 3b 3b 20 63 68 65 63 6b 20 ... ;; check
3f80: 66 6f 72 20 68 65 64 20 69 6e 20 77 61 69 74 6f for hed in waito
3f90: 6e 73 20 3d 3e 20 74 68 69 73 20 77 6f 75 6c 64 ns => this would
3fa0: 20 62 65 20 63 69 72 63 75 6c 61 72 2c 20 72 65 be circular, re
3fb0: 6d 6f 76 65 20 69 74 20 61 6e 64 20 69 73 73 75 move it and issu
3fc0: 65 20 61 6e 0a 09 20 20 20 20 3b 3b 20 65 72 72 e an.. ;; err
3fd0: 6f 72 0a 09 20 20 20 20 28 69 66 20 28 6d 65 6d or.. (if (mem
3fe0: 62 65 72 20 74 65 73 74 2d 6e 61 6d 65 20 77 61 ber test-name wa
3ff0: 69 74 6f 6e 73 29 0a 09 09 28 62 65 67 69 6e 0a itons)...(begin.
4000: 09 09 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 .. (debug:print
4010: 20 30 20 22 45 52 52 4f 52 3a 20 74 65 73 74 20 0 "ERROR: test
4020: 22 20 74 65 73 74 2d 6e 61 6d 65 20 22 20 68 61 " test-name " ha
4030: 73 20 6c 69 73 74 65 64 20 69 74 73 65 6c 66 20 s listed itself
4040: 61 73 20 61 20 77 61 69 74 6f 6e 2c 20 70 6c 65 as a waiton, ple
4050: 61 73 65 20 63 6f 72 72 65 63 74 20 74 68 69 73 ase correct this
4060: 21 22 29 0a 09 09 20 20 28 73 65 74 21 20 77 61 !")... (set! wa
4070: 69 74 6f 6e 20 28 66 69 6c 74 65 72 20 28 6c 61 iton (filter (la
4080: 6d 62 64 61 20 28 78 29 28 6e 6f 74 20 28 65 71 mbda (x)(not (eq
4090: 75 61 6c 3f 20 78 20 68 65 64 29 29 29 20 77 61 ual? x hed))) wa
40a0: 69 74 6f 6e 73 29 29 29 29 0a 0a 09 20 20 20 20 itons))))...
40b0: 28 63 6f 6e 64 20 3b 3b 20 4f 55 54 45 52 20 43 (cond ;; OUTER C
40c0: 4f 4e 44 0a 09 20 20 20 20 20 28 28 6e 6f 74 20 OND.. ((not
40d0: 69 74 65 6d 73 29 20 3b 3b 20 77 68 65 6e 20 66 items) ;; when f
40e0: 61 6c 73 65 20 74 68 65 20 74 65 73 74 20 69 73 alse the test is
40f0: 20 6f 6b 20 74 6f 20 62 65 20 68 61 6e 64 65 64 ok to be handed
4100: 20 6f 66 66 20 74 6f 20 6c 61 75 6e 63 68 20 28 off to launch (
4110: 62 75 74 20 6e 6f 74 20 62 65 66 6f 72 65 29 0a but not before).
4120: 09 20 20 20 20 20 20 28 6c 65 74 2a 20 28 28 72 . (let* ((r
4130: 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e 66 6f 20 20 un-limits-info
4140: 20 20 20 20 20 20 20 28 72 75 6e 73 3a 63 61 6e (runs:can
4150: 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 73 74 73 20 -run-more-tests
4160: 74 65 73 74 2d 72 65 63 6f 72 64 29 29 20 3b 3b test-record)) ;;
4170: 20 6c 6f 6f 6b 20 61 74 20 74 68 65 20 74 65 73 look at the tes
4180: 74 20 6a 6f 62 67 72 6f 75 70 20 61 6e 64 20 74 t jobgroup and t
4190: 6f 74 20 6a 6f 62 73 20 72 75 6e 6e 69 6e 67 0a ot jobs running.
41a0: 09 09 20 20 20 20 20 28 68 61 76 65 2d 72 65 73 .. (have-res
41b0: 6f 75 72 63 65 73 20 20 20 20 20 20 20 20 20 20 ources
41c0: 28 63 61 72 20 72 75 6e 2d 6c 69 6d 69 74 73 2d (car run-limits-
41d0: 69 6e 66 6f 29 29 0a 09 09 20 20 20 20 20 28 6e info))... (n
41e0: 75 6d 2d 72 75 6e 6e 69 6e 67 20 20 20 20 20 20 um-running
41f0: 20 20 20 20 20 20 20 28 6c 69 73 74 2d 72 65 66 (list-ref
4200: 20 72 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e 66 6f run-limits-info
4210: 20 31 29 29 0a 09 09 20 20 20 20 20 28 6e 75 6d 1))... (num
4220: 2d 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a 6f 62 67 -running-in-jobg
4230: 72 6f 75 70 20 28 6c 69 73 74 2d 72 65 66 20 72 roup (list-ref r
4240: 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e 66 6f 20 32 un-limits-info 2
4250: 29 29 0a 09 09 20 20 20 20 20 28 6d 61 78 2d 63 ))... (max-c
4260: 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 20 20 oncurrent-jobs
4270: 20 20 20 28 6c 69 73 74 2d 72 65 66 20 72 75 6e (list-ref run
4280: 2d 6c 69 6d 69 74 73 2d 69 6e 66 6f 20 33 29 29 -limits-info 3))
4290: 0a 09 09 20 20 20 20 20 28 6a 6f 62 2d 67 72 6f ... (job-gro
42a0: 75 70 2d 6c 69 6d 69 74 20 20 20 20 20 20 20 20 up-limit
42b0: 20 28 6c 69 73 74 2d 72 65 66 20 72 75 6e 2d 6c (list-ref run-l
42c0: 69 6d 69 74 73 2d 69 6e 66 6f 20 34 29 29 0a 09 imits-info 4))..
42d0: 09 20 20 20 20 20 28 70 72 65 72 65 71 73 2d 6e . (prereqs-n
42e0: 6f 74 2d 6d 65 74 20 20 20 20 20 20 20 20 20 28 ot-met (
42f0: 63 64 62 3a 72 65 6d 6f 74 65 2d 72 75 6e 20 64 cdb:remote-run d
4300: 62 3a 67 65 74 2d 70 72 65 72 65 71 73 2d 6e 6f b:get-prereqs-no
4310: 74 2d 6d 65 74 20 23 66 20 72 75 6e 2d 69 64 20 t-met #f run-id
4320: 77 61 69 74 6f 6e 73 20 69 74 65 6d 2d 70 61 74 waitons item-pat
4330: 68 20 6d 6f 64 65 3a 20 74 65 73 74 6d 6f 64 65 h mode: testmode
4340: 29 29 0a 09 09 20 20 20 20 20 28 66 61 69 6c 73 ))... (fails
4350: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
4360: 20 20 20 28 72 75 6e 73 3a 63 61 6c 63 2d 66 61 (runs:calc-fa
4370: 69 6c 73 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d ils prereqs-not-
4380: 6d 65 74 29 29 0a 09 09 20 20 20 20 20 28 6e 6f met))... (no
4390: 6e 2d 63 6f 6d 70 6c 65 74 65 64 20 20 20 20 20 n-completed
43a0: 20 20 20 20 20 20 28 72 75 6e 73 3a 63 61 6c 63 (runs:calc
43b0: 2d 6e 6f 74 2d 63 6f 6d 70 6c 65 74 65 64 20 70 -not-completed p
43c0: 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 29 rereqs-not-met))
43d0: 29 0a 09 09 28 64 65 62 75 67 3a 70 72 69 6e 74 )...(debug:print
43e0: 2d 69 6e 66 6f 20 38 20 22 68 61 76 65 2d 72 65 -info 8 "have-re
43f0: 73 6f 75 72 63 65 73 3a 20 22 20 68 61 76 65 2d sources: " have-
4400: 72 65 73 6f 75 72 63 65 73 20 22 20 70 72 65 72 resources " prer
4410: 65 71 73 2d 6e 6f 74 2d 6d 65 74 3a 20 22 20 0a eqs-not-met: " .
4420: 09 09 09 20 20 20 20 20 28 73 74 72 69 6e 67 2d ... (string-
4430: 69 6e 74 65 72 73 70 65 72 73 65 20 0a 09 09 09 intersperse ....
4440: 20 20 20 20 20 20 28 6d 61 70 20 28 6c 61 6d 62 (map (lamb
4450: 64 61 20 28 74 29 0a 09 09 09 09 20 20 20 20 20 da (t).....
4460: 28 69 66 20 28 76 65 63 74 6f 72 3f 20 74 29 0a (if (vector? t).
4470: 09 09 09 09 09 20 28 63 6f 6e 63 20 28 64 62 3a ..... (conc (db:
4480: 74 65 73 74 2d 67 65 74 2d 73 74 61 74 65 20 74 test-get-state t
4490: 29 20 22 2f 22 20 28 64 62 3a 74 65 73 74 2d 67 ) "/" (db:test-g
44a0: 65 74 2d 73 74 61 74 75 73 20 74 29 29 0a 09 09 et-status t))...
44b0: 09 09 09 20 28 63 6f 6e 63 20 22 20 57 41 52 4e ... (conc " WARN
44c0: 49 4e 47 3a 20 74 20 69 73 20 6e 6f 74 20 61 20 ING: t is not a
44d0: 76 65 63 74 6f 72 3d 22 20 74 20 29 29 29 0a 09 vector=" t )))..
44e0: 09 09 09 20 20 20 70 72 65 72 65 71 73 2d 6e 6f ... prereqs-no
44f0: 74 2d 6d 65 74 29 20 22 2c 20 22 29 20 22 20 66 t-met) ", ") " f
4500: 61 69 6c 73 3a 20 22 20 66 61 69 6c 73 29 0a 09 ails: " fails)..
4510: 09 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e .(debug:print-in
4520: 66 6f 20 34 20 22 68 65 64 3d 22 20 68 65 64 20 fo 4 "hed=" hed
4530: 22 5c 6e 20 20 74 65 73 74 2d 72 65 63 6f 72 64 "\n test-record
4540: 3d 22 20 74 65 73 74 2d 72 65 63 6f 72 64 20 22 =" test-record "
4550: 5c 6e 20 20 74 65 73 74 2d 6e 61 6d 65 3a 20 22 \n test-name: "
4560: 20 74 65 73 74 2d 6e 61 6d 65 20 22 5c 6e 20 20 test-name "\n
4570: 69 74 65 6d 2d 70 61 74 68 3a 20 22 20 69 74 65 item-path: " ite
4580: 6d 2d 70 61 74 68 20 22 5c 6e 20 20 74 65 73 74 m-path "\n test
4590: 2d 70 61 74 74 73 3a 20 22 20 74 65 73 74 2d 70 -patts: " test-p
45a0: 61 74 74 73 29 0a 0a 09 09 3b 3b 20 44 6f 6e 27 atts)....;; Don'
45b0: 74 20 6b 6e 6f 77 20 61 74 20 74 68 69 73 20 74 t know at this t
45c0: 69 6d 65 20 69 66 20 74 68 65 20 74 65 73 74 20 ime if the test
45d0: 68 61 76 65 20 62 65 65 6e 20 6c 61 75 6e 63 68 have been launch
45e0: 65 64 20 61 74 20 73 6f 6d 65 20 74 69 6d 65 20 ed at some time
45f0: 69 6e 20 74 68 65 20 70 61 73 74 0a 09 09 3b 3b in the past...;;
4600: 20 69 2e 65 2e 20 69 73 20 74 68 69 73 20 61 20 i.e. is this a
4610: 72 65 2d 6c 61 75 6e 63 68 3f 0a 09 09 28 64 65 re-launch?...(de
4620: 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 34 bug:print-info 4
4630: 20 22 72 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e 66 "run-limits-inf
4640: 6f 20 3d 20 22 20 72 75 6e 2d 6c 69 6d 69 74 73 o = " run-limits
4650: 2d 69 6e 66 6f 29 0a 09 09 28 63 6f 6e 64 20 3b -info)...(cond ;
4660: 3b 20 49 4e 4e 45 52 20 43 4f 4e 44 20 23 31 20 ; INNER COND #1
4670: 66 6f 72 20 61 20 6c 61 75 6e 63 68 61 62 6c 65 for a launchable
4680: 20 74 65 73 74 0a 09 09 20 3b 3b 20 43 68 65 63 test... ;; Chec
4690: 6b 20 69 74 65 6d 20 70 61 74 68 20 61 67 61 69 k item path agai
46a0: 6e 73 74 20 69 74 65 6d 2d 70 61 74 74 73 0a 09 nst item-patts..
46b0: 09 20 28 28 6e 6f 74 20 28 74 65 73 74 73 3a 6d . ((not (tests:m
46c0: 61 74 63 68 20 74 65 73 74 2d 70 61 74 74 73 20 atch test-patts
46d0: 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 (tests:testqueue
46e0: 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 74 65 -get-testname te
46f0: 73 74 2d 72 65 63 6f 72 64 29 20 69 74 65 6d 2d st-record) item-
4700: 70 61 74 68 29 29 20 3b 3b 20 54 68 69 73 20 74 path)) ;; This t
4710: 65 73 74 2f 69 74 65 6d 70 61 74 68 20 69 73 20 est/itempath is
4720: 6e 6f 74 20 74 6f 20 62 65 20 72 75 6e 0a 09 09 not to be run...
4730: 20 20 3b 3b 20 65 6c 73 65 20 74 68 65 20 72 75 ;; else the ru
4740: 6e 20 69 73 20 73 74 75 63 6b 2c 20 74 65 6d 70 n is stuck, temp
4750: 6f 72 61 72 69 6c 79 20 6f 72 20 70 65 72 6d 61 orarily or perma
4760: 6e 65 6e 74 6c 79 0a 09 09 20 20 3b 3b 20 62 75 nently... ;; bu
4770: 74 20 73 68 6f 75 6c 64 20 63 68 65 63 6b 20 69 t should check i
4780: 66 20 69 74 20 69 73 20 64 75 65 20 74 6f 20 6c f it is due to l
4790: 61 63 6b 20 6f 66 20 72 65 73 6f 75 72 63 65 73 ack of resources
47a0: 20 76 73 2e 20 70 72 65 72 65 71 75 69 73 69 74 vs. prerequisit
47b0: 65 73 0a 09 09 20 20 28 64 65 62 75 67 3a 70 72 es... (debug:pr
47c0: 69 6e 74 2d 69 6e 66 6f 20 31 20 22 53 6b 69 70 int-info 1 "Skip
47d0: 70 69 6e 67 20 22 20 28 74 65 73 74 73 3a 74 65 ping " (tests:te
47e0: 73 74 71 75 65 75 65 2d 67 65 74 2d 74 65 73 74 stqueue-get-test
47f0: 6e 61 6d 65 20 74 65 73 74 2d 72 65 63 6f 72 64 name test-record
4800: 29 20 22 20 22 20 69 74 65 6d 2d 70 61 74 68 20 ) " " item-path
4810: 22 20 61 73 20 69 74 20 64 6f 65 73 6e 27 74 20 " as it doesn't
4820: 6d 61 74 63 68 20 22 20 74 65 73 74 2d 70 61 74 match " test-pat
4830: 74 73 29 0a 09 09 20 20 3b 3b 20 28 74 68 72 65 ts)... ;; (thre
4840: 61 64 2d 73 6c 65 65 70 21 20 2a 67 6c 6f 62 61 ad-sleep! *globa
4850: 6c 2d 64 65 6c 74 61 2a 29 0a 09 09 20 20 28 69 l-delta*)... (i
4860: 66 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 61 f (not (null? ta
4870: 6c 29 29 0a 09 09 20 20 20 20 20 20 28 6c 6f 6f l))... (loo
4880: 70 20 28 63 61 72 20 74 61 6c 29 28 63 64 72 20 p (car tal)(cdr
4890: 74 61 6c 29 20 72 65 72 75 6e 73 29 29 29 0a 09 tal) reruns)))..
48a0: 09 20 3b 3b 20 52 65 67 69 73 74 65 72 79 20 68 . ;; Registery h
48b0: 61 73 20 62 65 65 6e 20 73 74 61 72 74 65 64 20 as been started
48c0: 66 6f 72 20 74 68 69 73 20 74 65 73 74 20 62 75 for this test bu
48d0: 74 20 68 61 73 20 6e 6f 74 20 79 65 74 20 63 6f t has not yet co
48e0: 6d 70 6c 65 74 65 64 0a 09 09 20 3b 3b 20 74 68 mpleted... ;; th
48f0: 69 73 20 73 68 6f 75 6c 64 20 62 65 20 72 61 72 is should be rar
4900: 65 2c 20 74 68 65 20 63 61 73 65 20 77 68 65 72 e, the case wher
4910: 65 20 74 68 65 72 65 20 61 72 65 20 6f 6e 6c 79 e there are only
4920: 20 61 20 63 6f 75 70 6c 65 20 6f 66 20 74 65 73 a couple of tes
4930: 74 73 20 61 6e 64 20 74 68 65 20 64 62 20 69 73 ts and the db is
4940: 20 73 6c 6f 77 0a 09 09 20 3b 3b 20 64 65 6c 61 slow... ;; dela
4950: 79 20 61 20 73 68 6f 72 74 20 77 68 69 6c 65 20 y a short while
4960: 61 6e 64 20 63 6f 6e 74 69 6e 75 65 0a 09 09 20 and continue...
4970: 3b 3b 20 28 28 65 71 3f 20 28 68 61 73 68 2d 74 ;; ((eq? (hash-t
4980: 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 able-ref/default
4990: 20 74 65 73 74 2d 72 65 67 69 73 74 65 72 79 20 test-registery
49a0: 28 72 75 6e 73 3a 6d 61 6b 65 2d 66 75 6c 6c 2d (runs:make-full-
49b0: 74 65 73 74 2d 6e 61 6d 65 20 74 65 73 74 2d 6e test-name test-n
49c0: 61 6d 65 20 69 74 65 6d 2d 70 61 74 68 29 20 23 ame item-path) #
49d0: 66 29 20 27 73 74 61 72 74 29 0a 09 09 20 3b 3b f) 'start)... ;;
49e0: 20 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 (thread-sleep!
49f0: 20 30 2e 30 31 29 0a 09 09 20 3b 3b 20 20 28 6c 0.01)... ;; (l
4a00: 6f 6f 70 20 28 63 61 72 20 6e 65 77 74 61 6c 29 oop (car newtal)
4a10: 28 63 64 72 20 6e 65 77 74 61 6c 29 20 72 65 72 (cdr newtal) rer
4a20: 75 6e 73 29 29 0a 09 09 20 3b 3b 20 63 6f 75 6e uns))... ;; coun
4a30: 74 20 6e 75 6d 62 65 72 20 6f 66 20 27 64 6f 6e t number of 'don
4a40: 65 2c 20 69 66 20 6d 6f 72 65 20 74 68 61 6e 20 e, if more than
4a50: 31 30 30 20 74 68 65 6e 20 73 6b 69 70 20 6f 6e 100 then skip on
4a60: 20 74 68 72 6f 75 67 68 2e 0a 09 09 20 28 3b 3b through.... (;;
4a70: 20 28 61 6e 64 20 28 3c 20 28 6c 65 6e 67 74 68 (and (< (length
4a80: 20 28 66 69 6c 74 65 72 20 28 6c 61 6d 62 64 61 (filter (lambda
4a90: 20 28 78 29 28 65 71 3f 20 78 20 27 64 6f 6e 65 (x)(eq? x 'done
4aa0: 29 29 28 68 61 73 68 2d 74 61 62 6c 65 2d 76 61 ))(hash-table-va
4ab0: 6c 75 65 73 20 74 65 73 74 2d 72 65 67 69 73 74 lues test-regist
4ac0: 65 72 79 29 29 29 20 31 30 30 29 20 3b 3b 20 77 ery))) 100) ;; w
4ad0: 68 79 20 67 65 74 20 6d 6f 72 65 20 74 68 61 6e hy get more than
4ae0: 20 32 30 30 20 61 68 65 61 64 3f 0a 09 09 20 20 200 ahead?...
4af0: 28 6e 6f 74 20 28 68 61 73 68 2d 74 61 62 6c 65 (not (hash-table
4b00: 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 74 65 73 -ref/default tes
4b10: 74 2d 72 65 67 69 73 74 65 72 79 20 28 72 75 6e t-registery (run
4b20: 73 3a 6d 61 6b 65 2d 66 75 6c 6c 2d 74 65 73 74 s:make-full-test
4b30: 2d 6e 61 6d 65 20 74 65 73 74 2d 6e 61 6d 65 20 -name test-name
4b40: 69 74 65 6d 2d 70 61 74 68 29 20 23 66 29 29 20 item-path) #f))
4b50: 3b 3b 20 29 20 3b 3b 20 74 6f 6f 20 6d 61 6e 79 ;; ) ;; too many
4b60: 20 63 68 61 6e 67 65 73 20 72 65 71 75 69 72 65 changes require
4b70: 64 2e 20 49 6d 70 6c 65 6d 65 6e 74 20 6c 61 74 d. Implement lat
4b80: 65 72 2e 0a 09 09 20 20 28 64 65 62 75 67 3a 70 er.... (debug:p
4b90: 72 69 6e 74 2d 69 6e 66 6f 20 34 20 22 50 72 65 rint-info 4 "Pre
4ba0: 2d 72 65 67 69 73 74 65 72 69 6e 67 20 74 65 73 -registering tes
4bb0: 74 20 22 20 74 65 73 74 2d 6e 61 6d 65 20 22 2f t " test-name "/
4bc0: 22 20 69 74 65 6d 2d 70 61 74 68 20 22 20 74 6f " item-path " to
4bd0: 20 63 72 65 61 74 65 20 70 6c 61 63 65 68 6f 6c create placehol
4be0: 64 65 72 22 20 29 0a 09 09 20 20 3b 3b 20 4e 45 der" )... ;; NE
4bf0: 45 44 20 54 4f 20 54 48 52 45 41 44 49 46 59 20 ED TO THREADIFY
4c00: 54 48 49 53 0a 09 09 20 20 28 6c 65 74 20 28 28 THIS... (let ((
4c10: 74 68 20 28 6d 61 6b 65 2d 74 68 72 65 61 64 20 th (make-thread
4c20: 28 6c 61 6d 62 64 61 20 28 29 0a 09 09 20 20 20 (lambda ()...
4c30: 20 20 20 20 20 09 09 20 20 20 28 6d 75 74 65 78 .. (mutex
4c40: 2d 6c 6f 63 6b 21 20 72 65 67 69 73 74 65 72 79 -lock! registery
4c50: 2d 6d 75 74 65 78 29 0a 09 09 20 20 20 20 20 20 -mutex)...
4c60: 20 20 09 09 20 20 20 28 68 61 73 68 2d 74 61 62 .. (hash-tab
4c70: 6c 65 2d 73 65 74 21 20 74 65 73 74 2d 72 65 67 le-set! test-reg
4c80: 69 73 74 65 72 79 20 28 72 75 6e 73 3a 6d 61 6b istery (runs:mak
4c90: 65 2d 66 75 6c 6c 2d 74 65 73 74 2d 6e 61 6d 65 e-full-test-name
4ca0: 20 74 65 73 74 2d 6e 61 6d 65 20 69 74 65 6d 2d test-name item-
4cb0: 70 61 74 68 29 20 27 73 74 61 72 74 29 0a 09 09 path) 'start)...
4cc0: 20 20 20 20 20 20 20 20 09 09 20 20 20 28 6d 75 .. (mu
4cd0: 74 65 78 2d 75 6e 6c 6f 63 6b 21 20 72 65 67 69 tex-unlock! regi
4ce0: 73 74 65 72 79 2d 6d 75 74 65 78 29 0a 09 09 09 stery-mutex)....
4cf0: 09 09 20 20 20 3b 3b 20 49 66 20 68 61 76 65 6e .. ;; If haven
4d00: 27 74 20 64 6f 6e 65 20 69 74 20 62 65 66 6f 72 't done it befor
4d10: 65 20 72 65 67 69 73 74 65 72 20 61 20 74 6f 70 e register a top
4d20: 20 6c 65 76 65 6c 20 74 65 73 74 20 69 66 20 74 level test if t
4d30: 68 69 73 20 69 73 20 61 6e 20 69 74 65 6d 69 7a his is an itemiz
4d40: 65 64 20 74 65 73 74 0a 09 09 09 09 09 20 20 20 ed test......
4d50: 28 69 66 20 28 6e 6f 74 20 28 65 71 3f 20 28 68 (if (not (eq? (h
4d60: 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 ash-table-ref/de
4d70: 66 61 75 6c 74 20 74 65 73 74 2d 72 65 67 69 73 fault test-regis
4d80: 74 65 72 79 20 28 72 75 6e 73 3a 6d 61 6b 65 2d tery (runs:make-
4d90: 66 75 6c 6c 2d 74 65 73 74 2d 6e 61 6d 65 20 74 full-test-name t
4da0: 65 73 74 2d 6e 61 6d 65 20 22 22 29 20 23 66 29 est-name "") #f)
4db0: 20 27 64 6f 6e 65 29 29 0a 09 09 09 09 09 20 20 'done))......
4dc0: 20 20 20 20 20 28 63 64 62 3a 74 65 73 74 73 2d (cdb:tests-
4dd0: 72 65 67 69 73 74 65 72 2d 74 65 73 74 20 2a 72 register-test *r
4de0: 75 6e 72 65 6d 6f 74 65 2a 20 72 75 6e 2d 69 64 unremote* run-id
4df0: 20 74 65 73 74 2d 6e 61 6d 65 20 22 22 29 29 0a test-name "")).
4e00: 09 09 09 09 09 20 20 20 28 63 64 62 3a 74 65 73 ..... (cdb:tes
4e10: 74 73 2d 72 65 67 69 73 74 65 72 2d 74 65 73 74 ts-register-test
4e20: 20 2a 72 75 6e 72 65 6d 6f 74 65 2a 20 72 75 6e *runremote* run
4e30: 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 74 -id test-name it
4e40: 65 6d 2d 70 61 74 68 29 0a 09 09 20 20 20 20 20 em-path)...
4e50: 20 20 20 09 09 20 20 20 28 6d 75 74 65 78 2d 6c .. (mutex-l
4e60: 6f 63 6b 21 20 72 65 67 69 73 74 65 72 79 2d 6d ock! registery-m
4e70: 75 74 65 78 29 0a 09 09 09 09 09 20 20 20 28 68 utex)...... (h
4e80: 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 74 ash-table-set! t
4e90: 65 73 74 2d 72 65 67 69 73 74 65 72 79 20 28 72 est-registery (r
4ea0: 75 6e 73 3a 6d 61 6b 65 2d 66 75 6c 6c 2d 74 65 uns:make-full-te
4eb0: 73 74 2d 6e 61 6d 65 20 74 65 73 74 2d 6e 61 6d st-name test-nam
4ec0: 65 20 69 74 65 6d 2d 70 61 74 68 29 20 27 64 6f e item-path) 'do
4ed0: 6e 65 29 0a 09 09 20 20 20 20 20 20 20 20 09 09 ne)... ..
4ee0: 20 20 20 28 6d 75 74 65 78 2d 75 6e 6c 6f 63 6b (mutex-unlock
4ef0: 21 20 72 65 67 69 73 74 65 72 79 2d 6d 75 74 65 ! registery-mute
4f00: 78 29 29 0a 09 09 20 20 20 20 20 20 20 20 09 09 x))... ..
4f10: 20 28 63 6f 6e 63 20 74 65 73 74 2d 6e 61 6d 65 (conc test-name
4f20: 20 22 2f 22 20 69 74 65 6d 2d 70 61 74 68 29 29 "/" item-path))
4f30: 29 29 0a 09 09 20 20 20 20 28 74 68 72 65 61 64 ))... (thread
4f40: 2d 73 74 61 72 74 21 20 74 68 29 29 0a 09 09 20 -start! th))...
4f50: 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 20 (thread-sleep!
4f60: 2a 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 0a *global-delta*).
4f70: 09 09 20 20 28 72 75 6e 73 3a 73 68 72 69 6e 6b .. (runs:shrink
4f80: 2d 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 -can-run-more-te
4f90: 73 74 73 2d 64 65 6c 61 79 29 20 20 20 3b 3b 20 sts-delay) ;;
4fa0: 44 45 4c 41 59 20 54 57 45 41 4b 45 52 20 28 73 DELAY TWEAKER (s
4fb0: 74 69 6c 6c 20 6e 65 65 64 65 64 3f 29 0a 09 09 till needed?)...
4fc0: 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 (loop (car new
4fd0: 74 61 6c 29 28 63 64 72 20 6e 65 77 74 61 6c 29 tal)(cdr newtal)
4fe0: 20 72 65 72 75 6e 73 29 29 0a 09 09 20 3b 3b 20 reruns))... ;;
4ff0: 41 74 20 74 68 69 73 20 70 6f 69 6e 74 20 2a 61 At this point *a
5000: 6c 6c 2a 20 74 65 73 74 20 72 65 67 69 73 74 72 ll* test registr
5010: 61 74 69 6f 6e 73 20 6d 75 73 74 20 62 65 20 63 ations must be c
5020: 6f 6d 70 6c 65 74 65 64 2e 0a 09 09 20 28 28 6e ompleted.... ((n
5030: 6f 74 20 28 6e 75 6c 6c 3f 20 28 66 69 6c 74 65 ot (null? (filte
5040: 72 20 28 6c 61 6d 62 64 61 20 28 78 29 28 65 71 r (lambda (x)(eq
5050: 3f 20 27 73 74 61 72 74 20 78 29 29 28 68 61 73 ? 'start x))(has
5060: 68 2d 74 61 62 6c 65 2d 76 61 6c 75 65 73 20 74 h-table-values t
5070: 65 73 74 2d 72 65 67 69 73 74 65 72 79 29 29 29 est-registery)))
5080: 29 0a 09 09 20 20 28 64 65 62 75 67 3a 70 72 69 )... (debug:pri
5090: 6e 74 2d 69 6e 66 6f 20 30 20 22 57 61 69 74 69 nt-info 0 "Waiti
50a0: 6e 67 20 6f 6e 20 74 65 73 74 20 72 65 67 69 73 ng on test regis
50b0: 74 72 61 74 69 6f 6e 73 3a 20 22 20 28 73 74 72 trations: " (str
50c0: 69 6e 67 2d 69 6e 74 65 72 73 70 65 72 73 65 20 ing-intersperse
50d0: 0a 09 09 09 09 09 09 09 09 09 20 28 66 69 6c 74 .......... (filt
50e0: 65 72 20 28 6c 61 6d 62 64 61 20 28 78 29 0a 09 er (lambda (x)..
50f0: 09 09 09 09 09 09 09 09 09 20 20 20 28 65 71 3f ......... (eq?
5100: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 (hash-table-ref
5110: 2f 64 65 66 61 75 6c 74 20 74 65 73 74 2d 72 65 /default test-re
5120: 67 69 73 74 65 72 79 20 78 20 23 66 29 20 27 73 gistery x #f) 's
5130: 74 61 72 74 29 29 0a 09 09 09 09 09 09 09 09 09 tart))..........
5140: 09 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 6b 65 . (hash-table-ke
5150: 79 73 20 74 65 73 74 2d 72 65 67 69 73 74 65 72 ys test-register
5160: 79 29 29 0a 09 09 09 09 09 09 09 09 09 20 22 2c y)).......... ",
5170: 20 22 29 29 0a 09 09 20 20 28 74 68 72 65 61 64 "))... (thread
5180: 2d 73 6c 65 65 70 21 20 30 2e 31 29 0a 09 09 20 -sleep! 0.1)...
5190: 20 28 6c 6f 6f 70 20 68 65 64 20 74 61 6c 20 72 (loop hed tal r
51a0: 65 72 75 6e 73 29 29 0a 09 09 20 28 28 6e 6f 74 eruns))... ((not
51b0: 20 68 61 76 65 2d 72 65 73 6f 75 72 63 65 73 29 have-resources)
51c0: 20 3b 3b 20 73 69 6d 70 6c 79 20 74 72 79 20 61 ;; simply try a
51d0: 67 61 69 6e 20 61 66 74 65 72 20 77 61 69 74 69 gain after waiti
51e0: 6e 67 20 61 20 73 65 63 6f 6e 64 0a 09 09 20 20 ng a second...
51f0: 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 (debug:print-inf
5200: 6f 20 31 20 22 6e 6f 20 72 65 73 6f 75 72 63 65 o 1 "no resource
5210: 73 20 74 6f 20 72 75 6e 20 6e 65 77 20 74 65 73 s to run new tes
5220: 74 73 2c 20 77 61 69 74 69 6e 67 20 2e 2e 2e 22 ts, waiting ..."
5230: 29 0a 09 09 20 20 3b 3b 20 28 74 68 72 65 61 64 )... ;; (thread
5240: 2d 73 6c 65 65 70 21 20 28 2b 20 32 20 2a 67 6c -sleep! (+ 2 *gl
5250: 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 29 0a 09 09 obal-delta*))...
5260: 20 20 3b 3b 20 63 6f 75 6c 64 20 68 61 76 65 20 ;; could have
5270: 64 6f 6e 65 20 68 65 64 20 74 61 6c 20 68 65 72 done hed tal her
5280: 65 20 62 75 74 20 64 6f 69 6e 67 20 63 61 72 2f e but doing car/
5290: 63 64 72 20 6f 66 20 6e 65 77 74 61 6c 20 74 6f cdr of newtal to
52a0: 20 72 6f 74 61 74 65 20 74 65 73 74 73 0a 09 09 rotate tests...
52b0: 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 (loop (car new
52c0: 74 61 6c 29 28 63 64 72 20 6e 65 77 74 61 6c 29 tal)(cdr newtal)
52d0: 20 72 65 72 75 6e 73 29 29 0a 09 09 20 28 28 61 reruns))... ((a
52e0: 6e 64 20 68 61 76 65 2d 72 65 73 6f 75 72 63 65 nd have-resource
52f0: 73 0a 09 09 20 20 20 20 20 20 20 28 6f 72 20 28 s... (or (
5300: 6e 75 6c 6c 3f 20 70 72 65 72 65 71 73 2d 6e 6f null? prereqs-no
5310: 74 2d 6d 65 74 29 0a 09 09 09 20 20 20 28 61 6e t-met).... (an
5320: 64 20 28 65 71 3f 20 74 65 73 74 6d 6f 64 65 20 d (eq? testmode
5330: 27 74 6f 70 6c 65 76 65 6c 29 0a 09 09 09 09 28 'toplevel).....(
5340: 6e 75 6c 6c 3f 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 null? non-comple
5350: 74 65 64 29 29 29 29 0a 09 09 20 20 28 72 75 6e ted))))... (run
5360: 3a 74 65 73 74 20 72 75 6e 2d 69 64 20 72 75 6e :test run-id run
5370: 6e 61 6d 65 20 6b 65 79 76 61 6c 6c 73 74 20 74 name keyvallst t
5380: 65 73 74 2d 72 65 63 6f 72 64 20 66 6c 61 67 73 est-record flags
5390: 20 23 66 29 0a 09 09 20 20 28 68 61 73 68 2d 74 #f)... (hash-t
53a0: 61 62 6c 65 2d 73 65 74 21 20 74 65 73 74 2d 72 able-set! test-r
53b0: 65 67 69 73 74 65 72 79 20 28 72 75 6e 73 3a 6d egistery (runs:m
53c0: 61 6b 65 2d 66 75 6c 6c 2d 74 65 73 74 2d 6e 61 ake-full-test-na
53d0: 6d 65 20 74 65 73 74 2d 6e 61 6d 65 20 69 74 65 me test-name ite
53e0: 6d 2d 70 61 74 68 29 20 27 72 75 6e 6e 69 6e 67 m-path) 'running
53f0: 29 0a 09 09 20 20 28 72 75 6e 73 3a 73 68 72 69 )... (runs:shri
5400: 6e 6b 2d 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d nk-can-run-more-
5410: 74 65 73 74 73 2d 64 65 6c 61 79 29 20 20 3b 3b tests-delay) ;;
5420: 20 44 45 4c 41 59 20 54 57 45 41 4b 45 52 20 28 DELAY TWEAKER (
5430: 73 74 69 6c 6c 20 6e 65 65 64 65 64 3f 29 0a 09 still needed?)..
5440: 09 20 20 3b 3b 20 28 74 68 72 65 61 64 2d 73 6c . ;; (thread-sl
5450: 65 65 70 21 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c eep! *global-del
5460: 74 61 2a 29 0a 09 09 20 20 28 69 66 20 28 6e 6f ta*)... (if (no
5470: 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 29 0a 09 t (null? tal))..
5480: 09 20 20 20 20 20 20 28 6c 6f 6f 70 20 28 63 61 . (loop (ca
5490: 72 20 74 61 6c 29 28 63 64 72 20 74 61 6c 29 20 r tal)(cdr tal)
54a0: 72 65 72 75 6e 73 29 29 29 0a 09 09 20 28 65 6c reruns)))... (el
54b0: 73 65 20 3b 3b 20 6d 75 73 74 20 62 65 20 77 65 se ;; must be we
54c0: 20 68 61 76 65 20 75 6e 6d 65 74 20 70 72 65 72 have unmet prer
54d0: 65 71 75 69 73 69 74 65 73 0a 09 09 20 20 20 20 equisites...
54e0: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 22 (debug:print 4 "
54f0: 46 41 49 4c 53 3a 20 22 20 66 61 69 6c 73 29 0a FAILS: " fails).
5500: 09 09 20 20 20 20 3b 3b 20 49 66 20 6f 6e 65 20 .. ;; If one
5510: 6f 72 20 6d 6f 72 65 20 6f 66 20 74 68 65 20 70 or more of the p
5520: 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 20 61 rereqs-not-met a
5530: 72 65 20 46 41 49 4c 20 74 68 65 6e 20 77 65 20 re FAIL then we
5540: 63 61 6e 20 69 73 73 75 65 0a 09 09 20 20 20 20 can issue...
5550: 3b 3b 20 61 20 6d 65 73 73 61 67 65 20 61 6e 64 ;; a message and
5560: 20 64 72 6f 70 20 68 65 64 20 66 72 6f 6d 20 74 drop hed from t
5570: 68 65 20 69 74 65 6d 73 20 74 6f 20 62 65 20 70 he items to be p
5580: 72 6f 63 65 73 73 65 64 2e 0a 09 09 20 20 20 20 rocessed....
5590: 28 69 66 20 28 6e 75 6c 6c 3f 20 66 61 69 6c 73 (if (null? fails
55a0: 29 0a 09 09 09 28 62 65 67 69 6e 0a 09 09 09 20 )....(begin....
55b0: 20 3b 3b 20 63 6f 75 6c 64 6e 27 74 20 72 75 6e ;; couldn't run
55c0: 2c 20 74 61 6b 65 20 61 20 62 72 65 61 74 68 65 , take a breathe
55d0: 72 0a 09 09 09 20 20 28 64 65 62 75 67 3a 70 72 r.... (debug:pr
55e0: 69 6e 74 2d 69 6e 66 6f 20 34 20 22 53 68 6f 75 int-info 4 "Shou
55f0: 6c 64 6e 27 74 20 72 65 61 6c 6c 79 20 67 65 74 ldn't really get
5600: 20 68 65 72 65 2c 20 72 61 63 65 20 63 6f 6e 64 here, race cond
5610: 69 74 69 6f 6e 3f 20 55 6e 61 62 6c 65 20 74 6f ition? Unable to
5620: 20 6c 61 75 6e 63 68 20 6d 6f 72 65 20 74 65 73 launch more tes
5630: 74 73 20 61 74 20 74 68 69 73 20 6d 6f 6d 65 6e ts at this momen
5640: 74 2c 20 6b 69 6c 6c 69 6e 67 20 74 69 6d 65 20 t, killing time
5650: 2e 2e 2e 22 29 0a 09 09 09 20 20 3b 3b 20 28 74 ...").... ;; (t
5660: 68 72 65 61 64 2d 73 6c 65 65 70 21 20 28 2b 20 hread-sleep! (+
5670: 30 2e 30 31 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c 0.01 *global-del
5680: 74 61 2a 29 29 20 3b 3b 20 6c 6f 6e 67 20 73 6c ta*)) ;; long sl
5690: 65 65 70 20 68 65 72 65 20 2d 20 6e 6f 20 72 65 eep here - no re
56a0: 73 6f 75 72 63 65 73 2c 20 6d 61 79 20 61 73 20 sources, may as
56b0: 77 65 6c 6c 20 62 65 20 70 61 74 69 65 6e 74 0a well be patient.
56c0: 09 09 09 20 20 3b 3b 20 77 65 20 6d 61 64 65 20 ... ;; we made
56d0: 6e 65 77 20 74 61 6c 20 62 79 20 73 74 69 63 6b new tal by stick
56e0: 69 6e 67 20 68 65 64 20 61 74 20 74 68 65 20 62 ing hed at the b
56f0: 61 63 6b 20 6f 66 20 74 68 65 20 6c 69 73 74 0a ack of the list.
5700: 09 09 09 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 ... (loop (car
5710: 6e 65 77 74 61 6c 29 28 63 64 72 20 6e 65 77 74 newtal)(cdr newt
5720: 61 6c 29 20 72 65 72 75 6e 73 29 29 0a 09 09 09 al) reruns))....
5730: 3b 3b 20 74 68 65 20 77 61 69 74 6f 6e 20 69 73 ;; the waiton is
5740: 20 46 41 49 4c 20 73 6f 20 6e 6f 20 70 6f 69 6e FAIL so no poin
5750: 74 20 69 6e 20 74 72 79 69 6e 67 20 74 6f 20 72 t in trying to r
5760: 75 6e 20 68 65 64 20 65 76 65 72 20 61 67 61 69 un hed ever agai
5770: 6e 0a 09 09 09 28 69 66 20 28 6e 6f 74 20 28 6e n....(if (not (n
5780: 75 6c 6c 3f 20 74 61 6c 29 29 0a 09 09 09 20 20 ull? tal))....
5790: 20 20 28 69 66 20 28 76 65 63 74 6f 72 3f 20 68 (if (vector? h
57a0: 65 64 29 0a 09 09 09 09 28 62 65 67 69 6e 20 0a ed).....(begin .
57b0: 09 09 09 09 20 20 28 64 65 62 75 67 3a 70 72 69 .... (debug:pri
57c0: 6e 74 20 31 20 22 57 41 52 4e 3a 20 44 72 6f 70 nt 1 "WARN: Drop
57d0: 70 69 6e 67 20 74 65 73 74 20 22 20 28 64 62 3a ping test " (db:
57e0: 74 65 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d test-get-testnam
57f0: 65 20 68 65 64 29 20 22 2f 22 20 28 64 62 3a 74 e hed) "/" (db:t
5800: 65 73 74 2d 67 65 74 2d 69 74 65 6d 2d 70 61 74 est-get-item-pat
5810: 68 20 68 65 64 29 0a 09 09 09 09 09 20 20 20 20 h hed)......
5820: 20 20 20 22 20 66 72 6f 6d 20 74 68 65 20 6c 61 " from the la
5830: 75 6e 63 68 20 6c 69 73 74 20 61 73 20 69 74 20 unch list as it
5840: 68 61 73 20 70 72 65 72 65 71 75 69 73 74 65 73 has prerequistes
5850: 20 74 68 61 74 20 61 72 65 20 46 41 49 4c 22 29 that are FAIL")
5860: 0a 09 09 09 09 20 20 28 72 75 6e 73 3a 73 68 72 ..... (runs:shr
5870: 69 6e 6b 2d 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 ink-can-run-more
5880: 2d 74 65 73 74 73 2d 64 65 6c 61 79 29 20 3b 3b -tests-delay) ;;
5890: 20 44 45 4c 41 59 20 54 57 45 41 4b 45 52 20 28 DELAY TWEAKER (
58a0: 73 74 69 6c 6c 20 6e 65 65 64 65 64 3f 29 0a 09 still needed?)..
58b0: 09 09 09 20 20 3b 3b 20 28 74 68 72 65 61 64 2d ... ;; (thread-
58c0: 73 6c 65 65 70 21 20 2a 67 6c 6f 62 61 6c 2d 64 sleep! *global-d
58d0: 65 6c 74 61 2a 29 0a 09 09 09 09 20 20 28 68 61 elta*)..... (ha
58e0: 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 74 65 sh-table-set! te
58f0: 73 74 2d 72 65 67 69 73 74 65 72 79 20 28 72 75 st-registery (ru
5900: 6e 73 3a 6d 61 6b 65 2d 66 75 6c 6c 2d 74 65 73 ns:make-full-tes
5910: 74 2d 6e 61 6d 65 20 74 65 73 74 2d 6e 61 6d 65 t-name test-name
5920: 20 69 74 65 6d 2d 70 61 74 68 29 20 27 72 65 6d item-path) 'rem
5930: 6f 76 65 64 29 0a 09 09 09 09 20 20 28 6c 6f 6f oved)..... (loo
5940: 70 20 28 63 61 72 20 74 61 6c 29 28 63 64 72 20 p (car tal)(cdr
5950: 74 61 6c 29 20 28 63 6f 6e 73 20 68 65 64 20 72 tal) (cons hed r
5960: 65 72 75 6e 73 29 29 29 0a 09 09 09 09 28 62 65 eruns))).....(be
5970: 67 69 6e 0a 09 09 09 09 20 20 28 64 65 62 75 67 gin..... (debug
5980: 3a 70 72 69 6e 74 20 31 20 22 57 41 52 4e 3a 20 :print 1 "WARN:
5990: 54 65 73 74 20 6e 6f 74 20 70 72 6f 63 65 73 73 Test not process
59a0: 65 64 20 63 6f 72 72 65 63 74 6c 79 2e 20 43 6f ed correctly. Co
59b0: 75 6c 64 20 62 65 20 61 20 72 61 63 65 20 63 6f uld be a race co
59c0: 6e 64 69 74 69 6f 6e 20 69 6e 20 79 6f 75 72 20 ndition in your
59d0: 74 65 73 74 20 69 6d 70 6c 65 6d 65 6e 74 61 74 test implementat
59e0: 69 6f 6e 3f 20 22 20 68 65 64 29 20 3b 3b 20 20 ion? " hed) ;;
59f0: 22 20 61 73 20 69 74 20 68 61 73 20 70 72 65 72 " as it has prer
5a00: 65 71 75 69 73 74 65 73 20 74 68 61 74 20 61 72 equistes that ar
5a10: 65 20 46 41 49 4c 2e 20 28 4e 4f 54 45 3a 20 68 e FAIL. (NOTE: h
5a20: 65 64 20 69 73 20 6e 6f 74 20 61 20 76 65 63 74 ed is not a vect
5a30: 6f 72 29 22 29 0a 09 09 09 09 20 20 28 72 75 6e or)")..... (run
5a40: 73 3a 73 68 72 69 6e 6b 2d 63 61 6e 2d 72 75 6e s:shrink-can-run
5a50: 2d 6d 6f 72 65 2d 74 65 73 74 73 2d 64 65 6c 61 -more-tests-dela
5a60: 79 29 20 3b 3b 20 44 45 4c 41 59 20 54 57 45 41 y) ;; DELAY TWEA
5a70: 4b 45 52 20 28 73 74 69 6c 6c 20 6e 65 65 64 65 KER (still neede
5a80: 64 3f 29 0a 09 09 09 09 20 20 3b 3b 20 28 74 68 d?)..... ;; (th
5a90: 72 65 61 64 2d 73 6c 65 65 70 21 20 28 2b 20 30 read-sleep! (+ 0
5aa0: 2e 30 31 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c 74 .01 *global-delt
5ab0: 61 2a 29 29 0a 09 09 09 09 20 20 28 6c 6f 6f 70 a*))..... (loop
5ac0: 20 68 65 64 20 74 61 6c 20 72 65 72 75 6e 73 29 hed tal reruns)
5ad0: 29 29 29 29 29 29 29 29 20 3b 3b 20 45 4e 44 20 )))))))) ;; END
5ae0: 4f 46 20 49 4e 4e 45 52 20 43 4f 4e 44 0a 09 20 OF INNER COND..
5af0: 20 20 20 20 0a 09 20 20 20 20 20 3b 3b 20 63 61 .. ;; ca
5b00: 73 65 20 77 68 65 72 65 20 61 6e 20 69 74 65 6d se where an item
5b10: 73 20 63 61 6d 65 20 69 6e 20 61 73 20 61 20 6c s came in as a l
5b20: 69 73 74 20 62 65 65 6e 20 70 72 6f 63 65 73 73 ist been process
5b30: 65 64 0a 09 20 20 20 20 20 28 28 61 6e 64 20 28 ed.. ((and (
5b40: 6c 69 73 74 3f 20 69 74 65 6d 73 29 20 20 20 20 list? items)
5b50: 20 3b 3b 20 74 68 75 73 20 77 65 20 6b 6e 6f 77 ;; thus we know
5b60: 20 6f 75 72 20 69 74 65 6d 73 20 61 72 65 20 61 our items are a
5b70: 6c 72 65 61 64 79 20 63 61 6c 63 75 6c 61 74 65 lready calculate
5b80: 64 0a 09 09 20 20 20 28 6e 6f 74 20 20 20 69 74 d... (not it
5b90: 65 6d 64 61 74 29 29 20 3b 3b 20 61 6e 64 20 6e emdat)) ;; and n
5ba0: 6f 74 20 79 65 74 20 65 78 70 61 6e 64 65 64 20 ot yet expanded
5bb0: 69 6e 74 6f 20 74 68 65 20 6c 69 73 74 20 6f 66 into the list of
5bc0: 20 74 68 69 6e 67 73 20 74 6f 20 62 65 20 64 6f things to be do
5bd0: 6e 65 0a 09 20 20 20 20 20 20 28 69 66 20 28 61 ne.. (if (a
5be0: 6e 64 20 28 64 65 62 75 67 3a 64 65 62 75 67 2d nd (debug:debug-
5bf0: 6d 6f 64 65 20 31 29 20 3b 3b 20 28 3e 3d 20 2a mode 1) ;; (>= *
5c00: 76 65 72 62 6f 73 69 74 79 2a 20 31 29 0a 09 09 verbosity* 1)...
5c10: 20 20 20 20 20 20 20 28 3e 20 28 6c 65 6e 67 74 (> (lengt
5c20: 68 20 69 74 65 6d 73 29 20 30 29 0a 09 09 20 20 h items) 0)...
5c30: 20 20 20 20 20 28 3e 20 28 6c 65 6e 67 74 68 20 (> (length
5c40: 28 63 61 72 20 69 74 65 6d 73 29 29 20 30 29 29 (car items)) 0))
5c50: 0a 09 09 20 20 28 70 70 20 69 74 65 6d 73 29 29 ... (pp items))
5c60: 0a 09 20 20 20 20 20 20 28 66 6f 72 2d 65 61 63 .. (for-eac
5c70: 68 0a 09 20 20 20 20 20 20 20 28 6c 61 6d 62 64 h.. (lambd
5c80: 61 20 28 6d 79 2d 69 74 65 6d 64 61 74 29 0a 09 a (my-itemdat)..
5c90: 09 20 28 6c 65 74 2a 20 28 28 6e 65 77 2d 74 65 . (let* ((new-te
5ca0: 73 74 2d 72 65 63 6f 72 64 20 28 6c 65 74 20 28 st-record (let (
5cb0: 28 6e 65 77 72 65 63 20 28 6d 61 6b 65 2d 74 65 (newrec (make-te
5cc0: 73 74 73 3a 74 65 73 74 71 75 65 75 65 29 29 29 sts:testqueue)))
5cd0: 0a 09 09 09 09 09 20 20 20 28 76 65 63 74 6f 72 ...... (vector
5ce0: 2d 63 6f 70 79 21 20 74 65 73 74 2d 72 65 63 6f -copy! test-reco
5cf0: 72 64 20 6e 65 77 72 65 63 29 0a 09 09 09 09 09 rd newrec)......
5d00: 20 20 20 6e 65 77 72 65 63 29 29 0a 09 09 09 28 newrec))....(
5d10: 6d 79 2d 69 74 65 6d 2d 70 61 74 68 20 28 69 74 my-item-path (it
5d20: 65 6d 2d 6c 69 73 74 2d 3e 70 61 74 68 20 6d 79 em-list->path my
5d30: 2d 69 74 65 6d 64 61 74 29 29 29 0a 09 09 20 20 -itemdat)))...
5d40: 20 28 69 66 20 28 74 65 73 74 73 3a 6d 61 74 63 (if (tests:matc
5d50: 68 20 74 65 73 74 2d 70 61 74 74 73 20 68 65 64 h test-patts hed
5d60: 20 6d 79 2d 69 74 65 6d 2d 70 61 74 68 29 20 3b my-item-path) ;
5d70: 3b 20 28 70 61 74 74 2d 6c 69 73 74 2d 6d 61 74 ; (patt-list-mat
5d80: 63 68 20 6d 79 2d 69 74 65 6d 2d 70 61 74 68 20 ch my-item-path
5d90: 69 74 65 6d 2d 70 61 74 74 73 29 20 20 20 20 20 item-patts)
5da0: 20 20 20 20 20 20 3b 3b 20 79 65 73 2c 20 77 65 ;; yes, we
5db0: 20 77 61 6e 74 20 74 6f 20 70 72 6f 63 65 73 73 want to process
5dc0: 20 74 68 69 73 20 69 74 65 6d 2c 20 4e 4f 54 45 this item, NOTE
5dd0: 3a 20 53 68 6f 75 6c 64 20 6e 6f 74 20 6e 65 65 : Should not nee
5de0: 64 20 74 68 69 73 20 63 68 65 63 6b 20 68 65 72 d this check her
5df0: 65 21 0a 09 09 20 20 20 20 20 20 20 28 6c 65 74 e!... (let
5e00: 20 28 28 6e 65 77 74 65 73 74 6e 61 6d 65 20 28 ((newtestname (
5e10: 72 75 6e 73 3a 6d 61 6b 65 2d 66 75 6c 6c 2d 74 runs:make-full-t
5e20: 65 73 74 2d 6e 61 6d 65 20 68 65 64 20 6d 79 2d est-name hed my-
5e30: 69 74 65 6d 2d 70 61 74 68 29 29 29 20 20 20 20 item-path)))
5e40: 3b 3b 20 74 65 73 74 20 6e 61 6d 65 73 20 61 72 ;; test names ar
5e50: 65 20 75 6e 69 71 75 65 20 6f 6e 20 74 65 73 74 e unique on test
5e60: 6e 61 6d 65 2f 69 74 65 6d 2d 70 61 74 68 0a 09 name/item-path..
5e70: 09 09 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 .. (tests:testqu
5e80: 65 75 65 2d 73 65 74 2d 69 74 65 6d 73 21 20 20 eue-set-items!
5e90: 20 20 20 6e 65 77 2d 74 65 73 74 2d 72 65 63 6f new-test-reco
5ea0: 72 64 20 23 66 29 0a 09 09 09 20 28 74 65 73 74 rd #f).... (test
5eb0: 73 3a 74 65 73 74 71 75 65 75 65 2d 73 65 74 2d s:testqueue-set-
5ec0: 69 74 65 6d 64 61 74 21 20 20 20 6e 65 77 2d 74 itemdat! new-t
5ed0: 65 73 74 2d 72 65 63 6f 72 64 20 6d 79 2d 69 74 est-record my-it
5ee0: 65 6d 64 61 74 29 0a 09 09 09 20 28 74 65 73 74 emdat).... (test
5ef0: 73 3a 74 65 73 74 71 75 65 75 65 2d 73 65 74 2d s:testqueue-set-
5f00: 69 74 65 6d 5f 70 61 74 68 21 20 6e 65 77 2d 74 item_path! new-t
5f10: 65 73 74 2d 72 65 63 6f 72 64 20 6d 79 2d 69 74 est-record my-it
5f20: 65 6d 2d 70 61 74 68 29 0a 09 09 09 20 28 68 61 em-path).... (ha
5f30: 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 74 65 sh-table-set! te
5f40: 73 74 2d 72 65 63 6f 72 64 73 20 6e 65 77 74 65 st-records newte
5f50: 73 74 6e 61 6d 65 20 6e 65 77 2d 74 65 73 74 2d stname new-test-
5f60: 72 65 63 6f 72 64 29 0a 09 09 09 20 28 73 65 74 record).... (set
5f70: 21 20 74 61 6c 20 28 63 6f 6e 73 20 6e 65 77 74 ! tal (cons newt
5f80: 65 73 74 6e 61 6d 65 20 74 61 6c 29 29 29 29 29 estname tal)))))
5f90: 29 20 3b 3b 20 73 69 6e 63 65 20 74 68 65 73 65 ) ;; since these
5fa0: 20 61 72 65 20 69 74 65 6d 69 7a 65 64 20 63 72 are itemized cr
5fb0: 65 61 74 65 20 6e 65 77 20 74 65 73 74 20 6e 61 eate new test na
5fc0: 6d 65 73 20 74 65 73 74 6e 61 6d 65 2f 69 74 65 mes testname/ite
5fd0: 6d 70 61 74 68 0a 09 20 20 20 20 20 20 20 69 74 mpath.. it
5fe0: 65 6d 73 29 0a 09 20 20 20 20 20 20 28 69 66 20 ems).. (if
5ff0: 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 (not (null? tal)
6000: 29 0a 09 09 20 20 28 62 65 67 69 6e 0a 09 09 20 )... (begin...
6010: 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d (debug:print-
6020: 69 6e 66 6f 20 34 20 22 45 6e 64 20 6f 66 20 69 info 4 "End of i
6030: 74 65 6d 73 20 6c 69 73 74 2c 20 6c 6f 6f 70 69 tems list, loopi
6040: 6e 67 20 77 69 74 68 20 6e 65 78 74 20 61 66 74 ng with next aft
6050: 65 72 20 73 68 6f 72 74 20 64 65 6c 61 79 22 29 er short delay")
6060: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
6070: 20 20 20 20 20 3b 3b 20 28 74 68 72 65 61 64 2d ;; (thread-
6080: 73 6c 65 65 70 21 20 28 2b 20 30 2e 30 31 20 2a sleep! (+ 0.01 *
6090: 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 29 0a global-delta*)).
60a0: 09 09 20 20 20 20 28 6c 6f 6f 70 20 28 63 61 72 .. (loop (car
60b0: 20 74 61 6c 29 28 63 64 72 20 74 61 6c 29 20 72 tal)(cdr tal) r
60c0: 65 72 75 6e 73 29 29 29 29 0a 0a 09 20 20 20 20 eruns))))...
60d0: 20 3b 3b 20 69 66 20 69 74 65 6d 73 20 69 73 20 ;; if items is
60e0: 61 20 70 72 6f 63 20 74 68 65 6e 20 6e 65 65 64 a proc then need
60f0: 20 74 6f 20 72 75 6e 20 69 74 65 6d 73 3a 67 65 to run items:ge
6100: 74 2d 69 74 65 6d 73 2d 66 72 6f 6d 2d 63 6f 6e t-items-from-con
6110: 66 69 67 2c 20 67 65 74 20 74 68 65 20 6c 69 73 fig, get the lis
6120: 74 20 61 6e 64 20 6c 6f 6f 70 20 0a 09 20 20 20 t and loop ..
6130: 20 20 3b 3b 20 20 20 20 2d 20 62 75 74 20 6f 6e ;; - but on
6140: 6c 79 20 64 6f 20 74 68 61 74 20 69 66 20 72 65 ly do that if re
6150: 73 6f 75 72 63 65 73 20 65 78 69 73 74 20 74 6f sources exist to
6160: 20 6b 69 63 6b 20 6f 66 66 20 74 68 65 20 6a 6f kick off the jo
6170: 62 0a 09 20 20 20 20 20 28 28 6f 72 20 28 70 72 b.. ((or (pr
6180: 6f 63 65 64 75 72 65 3f 20 69 74 65 6d 73 29 28 ocedure? items)(
6190: 65 71 3f 20 69 74 65 6d 73 20 27 68 61 76 65 2d eq? items 'have-
61a0: 70 72 6f 63 65 64 75 72 65 29 29 0a 09 20 20 20 procedure))..
61b0: 20 20 20 28 6c 65 74 20 28 28 63 61 6e 2d 72 75 (let ((can-ru
61c0: 6e 2d 6d 6f 72 65 20 20 20 20 28 72 75 6e 73 3a n-more (runs:
61d0: 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 73 can-run-more-tes
61e0: 74 73 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 ts test-record))
61f0: 29 0a 09 09 28 69 66 20 28 61 6e 64 20 28 6c 69 )...(if (and (li
6200: 73 74 3f 20 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 st? can-run-more
6210: 29 0a 09 09 09 20 28 63 61 72 20 63 61 6e 2d 72 ).... (car can-r
6220: 75 6e 2d 6d 6f 72 65 29 29 0a 09 09 20 20 20 20 un-more))...
6230: 28 6c 65 74 2a 20 28 28 70 72 65 72 65 71 73 2d (let* ((prereqs-
6240: 6e 6f 74 2d 6d 65 74 20 28 6f 70 65 6e 2d 72 75 not-met (open-ru
6250: 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d 70 n-close db:get-p
6260: 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 20 23 rereqs-not-met #
6270: 66 20 72 75 6e 2d 69 64 20 77 61 69 74 6f 6e 73 f run-id waitons
6280: 20 69 74 65 6d 2d 70 61 74 68 20 6d 6f 64 65 3a item-path mode:
6290: 20 74 65 73 74 6d 6f 64 65 29 29 0a 09 09 09 20 testmode))....
62a0: 20 20 28 66 61 69 6c 73 20 20 20 20 20 20 20 20 (fails
62b0: 20 20 20 28 72 75 6e 73 3a 63 61 6c 63 2d 66 61 (runs:calc-fa
62c0: 69 6c 73 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d ils prereqs-not-
62d0: 6d 65 74 29 29 0a 09 09 09 20 20 20 28 6e 6f 6e met)).... (non
62e0: 2d 63 6f 6d 70 6c 65 74 65 64 20 20 20 28 72 75 -completed (ru
62f0: 6e 73 3a 63 61 6c 63 2d 6e 6f 74 2d 63 6f 6d 70 ns:calc-not-comp
6300: 6c 65 74 65 64 20 70 72 65 72 65 71 73 2d 6e 6f leted prereqs-no
6310: 74 2d 6d 65 74 29 29 29 0a 09 09 20 20 20 20 20 t-met)))...
6320: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e (debug:print-in
6330: 66 6f 20 38 20 22 63 61 6e 2d 72 75 6e 2d 6d 6f fo 8 "can-run-mo
6340: 72 65 3a 20 22 20 63 61 6e 2d 72 75 6e 2d 6d 6f re: " can-run-mo
6350: 72 65 0a 09 09 09 09 20 20 20 22 5c 6e 20 74 65 re..... "\n te
6360: 73 74 6e 61 6d 65 3a 20 20 20 20 20 20 20 20 22 stname: "
6370: 20 68 65 64 0a 09 09 09 09 20 20 20 22 5c 6e 20 hed..... "\n
6380: 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 3a prereqs-not-met:
6390: 20 22 20 28 72 75 6e 73 3a 70 72 65 74 74 79 2d " (runs:pretty-
63a0: 73 74 72 69 6e 67 20 70 72 65 72 65 71 73 2d 6e string prereqs-n
63b0: 6f 74 2d 6d 65 74 29 0a 09 09 09 09 20 20 20 22 ot-met)..... "
63c0: 5c 6e 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 74 65 64 \n non-completed
63d0: 3a 20 20 20 22 20 28 72 75 6e 73 3a 70 72 65 74 : " (runs:pret
63e0: 74 79 2d 73 74 72 69 6e 67 20 6e 6f 6e 2d 63 6f ty-string non-co
63f0: 6d 70 6c 65 74 65 64 29 20 0a 09 09 09 09 20 20 mpleted) .....
6400: 20 22 5c 6e 20 66 61 69 6c 73 3a 20 20 20 20 20 "\n fails:
6410: 20 20 20 20 20 20 22 20 28 72 75 6e 73 3a 70 72 " (runs:pr
6420: 65 74 74 79 2d 73 74 72 69 6e 67 20 66 61 69 6c etty-string fail
6430: 73 29 0a 09 09 09 09 20 20 20 22 5c 6e 20 74 65 s)..... "\n te
6440: 73 74 6d 6f 64 65 3a 20 20 20 20 20 20 20 20 22 stmode: "
6450: 20 74 65 73 74 6d 6f 64 65 0a 09 09 09 09 20 20 testmode.....
6460: 20 22 5c 6e 20 6e 75 6d 2d 72 65 74 72 69 65 73 "\n num-retries
6470: 3a 20 20 20 20 20 22 20 6e 75 6d 2d 72 65 74 72 : " num-retr
6480: 69 65 73 0a 09 09 09 09 20 20 20 22 5c 6e 20 28 ies..... "\n (
6490: 65 71 3f 20 74 65 73 74 6d 6f 64 65 20 27 74 6f eq? testmode 'to
64a0: 70 6c 65 76 65 6c 29 3a 20 22 20 28 65 71 3f 20 plevel): " (eq?
64b0: 74 65 73 74 6d 6f 64 65 20 27 74 6f 70 6c 65 76 testmode 'toplev
64c0: 65 6c 29 0a 09 09 09 09 20 20 20 22 5c 6e 20 28 el)..... "\n (
64d0: 6e 75 6c 6c 3f 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 null? non-comple
64e0: 74 65 64 29 3a 20 20 20 20 22 20 28 6e 75 6c 6c ted): " (null
64f0: 3f 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 74 65 64 29 ? non-completed)
6500: 0a 09 09 09 09 20 20 20 22 5c 6e 20 72 65 72 75 ..... "\n reru
6510: 6e 73 3a 20 20 20 20 20 20 20 20 20 20 22 20 72 ns: " r
6520: 65 72 75 6e 73 0a 09 09 09 09 20 20 20 22 5c 6e eruns..... "\n
6530: 20 69 74 65 6d 73 3a 20 20 20 20 20 20 20 20 20 items:
6540: 20 20 22 20 69 74 65 6d 73 0a 09 09 09 09 20 20 " items.....
6550: 20 22 5c 6e 20 63 61 6e 2d 72 75 6e 2d 6d 6f 72 "\n can-run-mor
6560: 65 3a 20 20 20 20 22 20 63 61 6e 2d 72 75 6e 2d e: " can-run-
6570: 6d 6f 72 65 29 0a 09 09 20 20 20 20 20 20 3b 3b more)... ;;
6580: 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 20 (thread-sleep!
6590: 28 2b 20 30 2e 30 31 20 2a 67 6c 6f 62 61 6c 2d (+ 0.01 *global-
65a0: 64 65 6c 74 61 2a 29 29 0a 09 09 20 20 20 20 20 delta*))...
65b0: 20 28 63 6f 6e 64 20 3b 3b 20 49 4e 4e 45 52 20 (cond ;; INNER
65c0: 43 4f 4e 44 20 23 32 0a 09 09 20 20 20 20 20 20 COND #2...
65d0: 20 28 28 6f 72 20 28 6e 75 6c 6c 3f 20 70 72 65 ((or (null? pre
65e0: 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 20 3b 3b reqs-not-met) ;;
65f0: 20 61 6c 6c 20 70 72 65 72 65 71 73 20 6d 65 74 all prereqs met
6600: 2c 20 66 69 72 65 20 6f 66 66 20 74 68 65 20 74 , fire off the t
6610: 65 73 74 0a 09 09 09 20 20 20 20 3b 3b 20 6f 72 est.... ;; or
6620: 2c 20 69 66 20 69 74 20 69 73 20 61 20 27 74 6f , if it is a 'to
6630: 70 6c 65 76 65 6c 20 74 65 73 74 20 61 6e 64 20 plevel test and
6640: 61 6c 6c 20 70 72 65 72 65 71 73 20 6e 6f 74 20 all prereqs not
6650: 6d 65 74 20 61 72 65 20 43 4f 4d 50 4c 45 54 45 met are COMPLETE
6660: 44 20 74 68 65 6e 20 6c 61 75 6e 63 68 0a 09 09 D then launch...
6670: 09 20 20 20 20 28 61 6e 64 20 28 65 71 3f 20 74 . (and (eq? t
6680: 65 73 74 6d 6f 64 65 20 27 74 6f 70 6c 65 76 65 estmode 'topleve
6690: 6c 29 0a 09 09 09 09 20 28 6e 75 6c 6c 3f 20 6e l)..... (null? n
66a0: 6f 6e 2d 63 6f 6d 70 6c 65 74 65 64 29 29 29 0a on-completed))).
66b0: 09 09 09 28 6c 65 74 20 28 28 74 65 73 74 2d 6e ...(let ((test-n
66c0: 61 6d 65 20 28 74 65 73 74 73 3a 74 65 73 74 71 ame (tests:testq
66d0: 75 65 75 65 2d 67 65 74 2d 74 65 73 74 6e 61 6d ueue-get-testnam
66e0: 65 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 29 e test-record)))
66f0: 0a 09 09 09 20 20 28 73 65 74 65 6e 76 20 22 4d .... (setenv "M
6700: 54 5f 54 45 53 54 5f 4e 41 4d 45 22 20 74 65 73 T_TEST_NAME" tes
6710: 74 2d 6e 61 6d 65 29 20 3b 3b 20 0a 09 09 09 20 t-name) ;; ....
6720: 20 28 73 65 74 65 6e 76 20 22 4d 54 5f 52 55 4e (setenv "MT_RUN
6730: 4e 41 4d 45 22 20 20 20 72 75 6e 6e 61 6d 65 29 NAME" runname)
6740: 0a 09 09 09 20 20 28 73 65 74 2d 6d 65 67 61 74 .... (set-megat
6750: 65 73 74 2d 65 6e 76 2d 76 61 72 73 20 72 75 6e est-env-vars run
6760: 2d 69 64 29 20 3b 3b 20 74 68 65 73 65 20 6d 61 -id) ;; these ma
6770: 79 20 62 65 20 6e 65 65 64 65 64 20 62 79 20 74 y be needed by t
6780: 68 65 20 6c 61 75 6e 63 68 69 6e 67 20 70 72 6f he launching pro
6790: 63 65 73 73 0a 09 09 09 20 20 28 6c 65 74 20 28 cess.... (let (
67a0: 28 69 74 65 6d 73 2d 6c 69 73 74 20 28 69 74 65 (items-list (ite
67b0: 6d 73 3a 67 65 74 2d 69 74 65 6d 73 2d 66 72 6f ms:get-items-fro
67c0: 6d 2d 63 6f 6e 66 69 67 20 74 63 6f 6e 66 69 67 m-config tconfig
67d0: 29 29 29 0a 09 09 09 20 20 20 20 28 69 66 20 28 ))).... (if (
67e0: 6c 69 73 74 3f 20 69 74 65 6d 73 2d 6c 69 73 74 list? items-list
67f0: 29 0a 09 09 09 09 28 62 65 67 69 6e 0a 09 09 09 ).....(begin....
6800: 09 20 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 . (tests:testqu
6810: 65 75 65 2d 73 65 74 2d 69 74 65 6d 73 21 20 74 eue-set-items! t
6820: 65 73 74 2d 72 65 63 6f 72 64 20 69 74 65 6d 73 est-record items
6830: 2d 6c 69 73 74 29 0a 09 09 09 09 20 20 3b 3b 20 -list)..... ;;
6840: 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 20 2a (thread-sleep! *
6850: 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 0a 09 global-delta*)..
6860: 09 09 09 20 20 28 6c 6f 6f 70 20 68 65 64 20 74 ... (loop hed t
6870: 61 6c 20 72 65 72 75 6e 73 29 29 0a 09 09 09 09 al reruns)).....
6880: 28 62 65 67 69 6e 0a 09 09 09 09 20 20 28 64 65 (begin..... (de
6890: 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 bug:print 0 "ERR
68a0: 4f 52 3a 20 54 68 65 20 70 72 6f 63 20 66 72 6f OR: The proc fro
68b0: 6d 20 72 65 61 64 69 6e 67 20 74 68 65 20 73 65 m reading the se
68c0: 74 75 70 20 64 69 64 20 6e 6f 74 20 79 69 65 6c tup did not yiel
68d0: 64 20 61 20 6c 69 73 74 20 2d 20 70 6c 65 61 73 d a list - pleas
68e0: 65 20 72 65 70 6f 72 74 20 74 68 69 73 22 29 0a e report this").
68f0: 09 09 09 09 20 20 28 65 78 69 74 20 31 29 29 29 .... (exit 1)))
6900: 29 29 29 0a 09 09 20 20 20 20 20 20 20 28 28 6e )))... ((n
6910: 75 6c 6c 3f 20 66 61 69 6c 73 29 0a 09 09 09 28 ull? fails)....(
6920: 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f debug:print-info
6930: 20 34 20 22 66 61 69 6c 73 20 69 73 20 6e 75 6c 4 "fails is nul
6940: 6c 2c 20 6d 6f 76 69 6e 67 20 6f 6e 20 69 6e 20 l, moving on in
6950: 74 68 65 20 71 75 65 75 65 20 62 75 74 20 6b 65 the queue but ke
6960: 65 70 69 6e 67 20 22 20 68 65 64 20 22 20 66 6f eping " hed " fo
6970: 72 20 6e 6f 77 22 29 0a 09 09 09 3b 3b 20 6f 6e r now")....;; on
6980: 6c 79 20 69 6e 63 72 65 6d 65 6e 74 20 6e 75 6d ly increment num
6990: 2d 72 65 74 72 69 65 73 20 77 68 65 6e 20 74 68 -retries when th
69a0: 65 72 65 20 61 72 65 20 6e 6f 20 74 65 73 74 73 ere are no tests
69b0: 20 72 75 6e 69 6e 67 0a 09 09 09 28 69 66 20 28 runing....(if (
69c0: 65 71 3f 20 30 20 28 6c 69 73 74 2d 72 65 66 20 eq? 0 (list-ref
69d0: 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 20 31 29 29 can-run-more 1))
69e0: 0a 09 09 09 20 20 20 20 28 62 65 67 69 6e 0a 09 .... (begin..
69f0: 09 09 20 20 20 20 20 20 28 69 66 20 28 3e 20 6e .. (if (> n
6a00: 75 6d 2d 72 65 74 72 69 65 73 20 31 30 30 29 20 um-retries 100)
6a10: 3b 3b 20 66 69 72 73 74 20 31 30 30 20 72 65 74 ;; first 100 ret
6a20: 72 69 65 73 20 61 72 65 20 6c 6f 77 20 74 69 6d ries are low tim
6a30: 65 20 63 6f 73 74 0a 09 09 09 09 20 20 28 74 68 e cost..... (th
6a40: 72 65 61 64 2d 73 6c 65 65 70 21 20 28 2b 20 32 read-sleep! (+ 2
6a50: 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 *global-delta*)
6a60: 29 0a 09 09 09 09 20 20 28 74 68 72 65 61 64 2d )..... (thread-
6a70: 73 6c 65 65 70 21 20 28 2b 20 30 2e 30 31 20 2a sleep! (+ 0.01 *
6a80: 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 29 29 global-delta*)))
6a90: 0a 09 09 09 20 20 20 20 20 20 28 73 65 74 21 20 .... (set!
6aa0: 6e 75 6d 2d 72 65 74 72 69 65 73 20 28 2b 20 6e num-retries (+ n
6ab0: 75 6d 2d 72 65 74 72 69 65 73 20 31 29 29 29 29 um-retries 1))))
6ac0: 0a 09 09 09 28 69 66 20 28 3e 20 6e 75 6d 2d 72 ....(if (> num-r
6ad0: 65 74 72 69 65 73 20 20 6d 61 78 2d 72 65 74 72 etries max-retr
6ae0: 69 65 73 29 0a 09 09 09 20 20 20 20 28 69 66 20 ies).... (if
6af0: 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 (not (null? tal)
6b00: 29 0a 09 09 09 09 28 6c 6f 6f 70 20 28 63 61 72 ).....(loop (car
6b10: 20 74 61 6c 29 28 63 64 72 20 74 61 6c 29 20 72 tal)(cdr tal) r
6b20: 65 72 75 6e 73 29 29 0a 09 09 09 20 20 20 20 28 eruns)).... (
6b30: 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 74 61 6c loop (car newtal
6b40: 29 28 63 64 72 20 6e 65 77 74 61 6c 29 20 72 65 )(cdr newtal) re
6b50: 72 75 6e 73 29 29 29 20 3b 3b 20 61 6e 20 69 73 runs))) ;; an is
6b60: 73 75 65 20 77 69 74 68 20 70 72 65 72 65 71 73 sue with prereqs
6b70: 20 6e 6f 74 20 79 65 74 20 6d 65 74 3f 0a 09 09 not yet met?...
6b80: 20 20 20 20 20 20 20 28 28 61 6e 64 20 28 6e 6f ((and (no
6b90: 74 20 28 6e 75 6c 6c 3f 20 66 61 69 6c 73 29 29 t (null? fails))
6ba0: 28 65 71 3f 20 74 65 73 74 6d 6f 64 65 20 27 6e (eq? testmode 'n
6bb0: 6f 72 6d 61 6c 29 29 0a 09 09 09 28 64 65 62 75 ormal))....(debu
6bc0: 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 31 20 22 g:print-info 1 "
6bd0: 74 65 73 74 20 22 20 20 68 65 64 20 22 20 28 6d test " hed " (m
6be0: 6f 64 65 3d 22 20 74 65 73 74 6d 6f 64 65 20 22 ode=" testmode "
6bf0: 29 20 68 61 73 20 66 61 69 6c 65 64 20 70 72 65 ) has failed pre
6c00: 72 65 71 75 69 73 69 74 65 28 73 29 3b 20 22 0a requisite(s); ".
6c10: 09 09 09 09 20 20 20 20 20 28 73 74 72 69 6e 67 .... (string
6c20: 2d 69 6e 74 65 72 73 70 65 72 73 65 20 28 6d 61 -intersperse (ma
6c30: 70 20 28 6c 61 6d 62 64 61 20 28 74 29 28 63 6f p (lambda (t)(co
6c40: 6e 63 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d nc (db:test-get-
6c50: 74 65 73 74 6e 61 6d 65 20 74 29 20 22 3a 22 20 testname t) ":"
6c60: 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 73 74 61 (db:test-get-sta
6c70: 74 65 20 74 29 22 2f 22 28 64 62 3a 74 65 73 74 te t)"/"(db:test
6c80: 2d 67 65 74 2d 73 74 61 74 75 73 20 74 29 29 29 -get-status t)))
6c90: 20 66 61 69 6c 73 29 20 22 2c 20 22 29 0a 09 09 fails) ", ")...
6ca0: 09 09 20 20 20 20 20 22 2c 20 72 65 6d 6f 76 69 .. ", removi
6cb0: 6e 67 20 69 74 20 66 72 6f 6d 20 74 6f 2d 64 6f ng it from to-do
6cc0: 20 6c 69 73 74 22 29 0a 09 09 09 28 69 66 20 28 list")....(if (
6cd0: 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 29 not (null? tal))
6ce0: 0a 09 09 09 20 20 20 20 28 62 65 67 69 6e 0a 20 .... (begin.
6cf0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
6d00: 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 3b 20 ;;
6d10: 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 20 2a (thread-sleep! *
6d20: 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 0a 09 global-delta*)..
6d30: 09 09 20 20 20 20 20 20 28 6c 6f 6f 70 20 28 63 .. (loop (c
6d40: 61 72 20 74 61 6c 29 28 63 64 72 20 74 61 6c 29 ar tal)(cdr tal)
6d50: 28 63 6f 6e 73 20 68 65 64 20 72 65 72 75 6e 73 (cons hed reruns
6d60: 29 29 29 29 29 0a 09 09 20 20 20 20 20 20 20 28 )))))... (
6d70: 65 6c 73 65 0a 09 09 09 28 64 65 62 75 67 3a 70 else....(debug:p
6d80: 72 69 6e 74 20 38 20 22 45 52 52 4f 52 3a 20 4e rint 8 "ERROR: N
6d90: 6f 20 68 61 6e 64 6c 65 72 20 66 6f 72 20 74 68 o handler for th
6da0: 69 73 20 63 6f 6e 64 69 74 69 6f 6e 2e 22 29 0a is condition.").
6db0: 09 09 09 28 74 68 72 65 61 64 2d 73 6c 65 65 70 ...(thread-sleep
6dc0: 21 20 28 2b 20 31 20 2a 67 6c 6f 62 61 6c 2d 64 ! (+ 1 *global-d
6dd0: 65 6c 74 61 2a 29 29 0a 09 09 09 28 6c 6f 6f 70 elta*))....(loop
6de0: 20 28 63 61 72 20 6e 65 77 74 61 6c 29 28 63 64 (car newtal)(cd
6df0: 72 20 6e 65 77 74 61 6c 29 20 72 65 72 75 6e 73 r newtal) reruns
6e00: 29 29 29 29 20 3b 3b 20 45 4e 44 20 4f 46 20 49 )))) ;; END OF I
6e10: 46 20 43 41 4e 20 52 55 4e 20 4d 4f 52 45 0a 0a F CAN RUN MORE..
6e20: 09 09 20 20 20 20 3b 3b 20 69 66 20 63 61 6e 27 .. ;; if can'
6e30: 74 20 72 75 6e 20 6d 6f 72 65 20 6a 75 73 74 20 t run more just
6e40: 6c 6f 6f 70 20 77 69 74 68 20 6e 65 78 74 20 70 loop with next p
6e50: 6f 73 73 69 62 6c 65 20 74 65 73 74 0a 09 09 20 ossible test...
6e60: 20 20 20 28 62 65 67 69 6e 0a 09 09 20 20 20 20 (begin...
6e70: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 (debug:print-i
6e80: 6e 66 6f 20 34 20 22 70 72 6f 63 65 73 73 69 6e nfo 4 "processin
6e90: 67 20 74 68 65 20 63 61 73 65 20 77 69 74 68 20 g the case with
6ea0: 61 20 6c 61 6d 62 64 61 20 66 6f 72 20 69 74 65 a lambda for ite
6eb0: 6d 73 20 6f 72 20 27 68 61 76 65 2d 70 72 6f 63 ms or 'have-proc
6ec0: 65 64 75 72 65 2e 20 4d 6f 76 69 6e 67 20 74 68 edure. Moving th
6ed0: 72 6f 75 67 68 20 74 68 65 20 71 75 65 75 65 20 rough the queue
6ee0: 77 69 74 68 6f 75 74 20 64 72 6f 70 70 69 6e 67 without dropping
6ef0: 20 22 20 68 65 64 29 0a 09 09 20 20 20 20 20 20 " hed)...
6f00: 3b 3b 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 ;; (thread-sleep
6f10: 21 20 28 2b 20 32 20 2a 67 6c 6f 62 61 6c 2d 64 ! (+ 2 *global-d
6f20: 65 6c 74 61 2a 29 29 0a 09 09 20 20 20 20 20 20 elta*))...
6f30: 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 74 61 (loop (car newta
6f40: 6c 29 28 63 64 72 20 6e 65 77 74 61 6c 29 20 72 l)(cdr newtal) r
6f50: 65 72 75 6e 73 29 29 29 29 29 20 3b 3b 20 45 4e eruns))))) ;; EN
6f60: 44 20 4f 46 20 28 6f 72 20 28 70 72 6f 63 65 64 D OF (or (proced
6f70: 75 72 65 3f 20 69 74 65 6d 73 29 28 65 71 3f 20 ure? items)(eq?
6f80: 69 74 65 6d 73 20 27 68 61 76 65 2d 70 72 6f 63 items 'have-proc
6f90: 65 64 75 72 65 29 29 0a 09 20 20 20 20 20 0a 09 edure)).. ..
6fa0: 20 20 20 20 20 3b 3b 20 74 68 69 73 20 63 61 73 ;; this cas
6fb0: 65 20 73 68 6f 75 6c 64 20 6e 6f 74 20 68 61 70 e should not hap
6fc0: 70 65 6e 2c 20 61 64 64 65 64 20 74 6f 20 68 65 pen, added to he
6fd0: 6c 70 20 63 61 74 63 68 20 61 6e 79 20 62 75 67 lp catch any bug
6fe0: 73 0a 09 20 20 20 20 20 28 28 61 6e 64 20 28 6c s.. ((and (l
6ff0: 69 73 74 3f 20 69 74 65 6d 73 29 20 69 74 65 6d ist? items) item
7000: 64 61 74 29 0a 09 20 20 20 20 20 20 28 64 65 62 dat).. (deb
7010: 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f ug:print 0 "ERRO
7020: 52 3a 20 53 68 6f 75 6c 64 20 6e 6f 74 20 68 61 R: Should not ha
7030: 76 65 20 61 20 6c 69 73 74 20 6f 66 20 69 74 65 ve a list of ite
7040: 6d 73 20 69 6e 20 61 20 74 65 73 74 20 61 6e 64 ms in a test and
7050: 20 74 68 65 20 69 74 65 6d 73 70 61 74 68 20 73 the itemspath s
7060: 65 74 20 2d 20 70 6c 65 61 73 65 20 72 65 70 6f et - please repo
7070: 72 74 20 74 68 69 73 22 29 0a 09 20 20 20 20 20 rt this")..
7080: 20 28 65 78 69 74 20 31 29 29 0a 09 20 20 20 20 (exit 1))..
7090: 20 28 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 72 65 ((not (null? re
70a0: 72 75 6e 73 29 29 0a 09 20 20 20 20 20 20 28 6c runs)).. (l
70b0: 65 74 2a 20 28 28 6e 65 77 6c 73 74 20 28 74 65 et* ((newlst (te
70c0: 73 74 73 3a 66 69 6c 74 65 72 2d 6e 6f 6e 2d 72 sts:filter-non-r
70d0: 75 6e 6e 61 62 6c 65 20 72 75 6e 2d 69 64 20 74 unnable run-id t
70e0: 61 6c 20 74 65 73 74 2d 72 65 63 6f 72 64 73 29 al test-records)
70f0: 29 20 3b 3b 20 69 2e 65 2e 20 6e 6f 74 20 46 41 ) ;; i.e. not FA
7100: 49 4c 2c 20 57 41 49 56 45 44 2c 20 49 4e 43 4f IL, WAIVED, INCO
7110: 4d 50 4c 45 54 45 2c 20 50 41 53 53 2c 20 4b 49 MPLETE, PASS, KI
7120: 4c 4c 45 44 2c 0a 09 09 20 20 20 20 20 28 6a 75 LLED,... (ju
7130: 6e 6b 65 64 20 28 6c 73 65 74 2d 64 69 66 66 65 nked (lset-diffe
7140: 72 65 6e 63 65 20 65 71 75 61 6c 3f 20 74 61 6c rence equal? tal
7150: 20 6e 65 77 6c 73 74 29 29 29 0a 09 09 28 64 65 newlst)))...(de
7160: 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 34 bug:print-info 4
7170: 20 22 66 75 6c 6c 20 64 72 6f 70 20 74 68 72 6f "full drop thro
7180: 75 67 68 2c 20 69 66 20 72 65 72 75 6e 73 20 69 ugh, if reruns i
7190: 73 20 6c 65 73 73 20 74 68 61 6e 20 31 30 30 20 s less than 100
71a0: 77 65 20 77 69 6c 6c 20 66 6f 72 63 65 20 72 65 we will force re
71b0: 74 72 79 20 74 68 65 6d 2c 20 72 65 72 75 6e 73 try them, reruns
71c0: 3d 22 20 72 65 72 75 6e 73 20 22 2c 20 74 61 6c =" reruns ", tal
71d0: 3d 22 20 74 61 6c 29 0a 09 09 28 69 66 20 28 3c =" tal)...(if (<
71e0: 20 6e 75 6d 2d 72 65 74 72 69 65 73 20 6d 61 78 num-retries max
71f0: 2d 72 65 74 72 69 65 73 29 0a 09 09 20 20 20 20 -retries)...
7200: 28 73 65 74 21 20 6e 65 77 6c 73 74 20 28 61 70 (set! newlst (ap
7210: 70 65 6e 64 20 72 65 72 75 6e 73 20 6e 65 77 6c pend reruns newl
7220: 73 74 29 29 29 0a 09 09 28 73 65 74 21 20 6e 75 st)))...(set! nu
7230: 6d 2d 72 65 74 72 69 65 73 20 28 2b 20 6e 75 6d m-retries (+ num
7240: 2d 72 65 74 72 69 65 73 20 31 29 29 0a 09 09 3b -retries 1))...;
7250: 3b 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 ; (thread-sleep!
7260: 20 28 2b 20 31 20 2a 67 6c 6f 62 61 6c 2d 64 65 (+ 1 *global-de
7270: 6c 74 61 2a 29 29 0a 09 09 28 69 66 20 28 6e 6f lta*))...(if (no
7280: 74 20 28 6e 75 6c 6c 3f 20 6e 65 77 6c 73 74 29 t (null? newlst)
7290: 29 0a 09 09 20 20 20 20 3b 3b 20 73 69 6e 63 65 )... ;; since
72a0: 20 72 65 72 75 6e 73 20 68 61 76 65 20 62 65 65 reruns have bee
72b0: 6e 20 74 61 63 6b 65 64 20 6f 6e 20 74 6f 20 6e n tacked on to n
72c0: 65 77 6c 73 74 20 63 72 65 61 74 65 20 6e 65 77 ewlst create new
72d0: 20 72 65 72 75 6e 73 20 66 72 6f 6d 20 6a 75 6e reruns from jun
72e0: 6b 65 64 0a 09 09 20 20 20 20 28 6c 6f 6f 70 20 ked... (loop
72f0: 28 63 61 72 20 6e 65 77 6c 73 74 29 28 63 64 72 (car newlst)(cdr
7300: 20 6e 65 77 6c 73 74 29 28 64 65 6c 65 74 65 2d newlst)(delete-
7310: 64 75 70 6c 69 63 61 74 65 73 20 6a 75 6e 6b 65 duplicates junke
7320: 64 29 29 29 29 29 0a 09 20 20 20 20 20 28 28 6e d))))).. ((n
7330: 6f 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 29 0a ot (null? tal)).
7340: 09 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 . (debug:pr
7350: 69 6e 74 2d 69 6e 66 6f 20 34 20 22 49 27 6d 20 int-info 4 "I'm
7360: 70 72 65 74 74 79 20 73 75 72 65 20 49 20 73 68 pretty sure I sh
7370: 6f 75 6c 64 6e 27 74 20 67 65 74 20 68 65 72 65 ouldn't get here
7380: 2e 22 29 29 0a 09 20 20 20 20 20 28 65 6c 73 65 .")).. (else
7390: 0a 09 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 .. (debug:p
73a0: 72 69 6e 74 2d 69 6e 66 6f 20 34 20 22 45 78 69 rint-info 4 "Exi
73b0: 74 69 6e 67 20 6c 6f 6f 70 20 77 69 74 68 2e 2e ting loop with..
73c0: 2e 5c 6e 20 20 68 65 64 3d 22 20 68 65 64 20 22 .\n hed=" hed "
73d0: 5c 6e 20 20 74 61 6c 3d 22 20 74 61 6c 20 22 5c \n tal=" tal "\
73e0: 6e 20 20 72 65 72 75 6e 73 3d 22 20 72 65 72 75 n reruns=" reru
73f0: 6e 73 29 29 0a 09 20 20 20 20 20 29 29 29 29 20 ns)).. ))))
7400: 3b 3b 20 4c 45 54 2a 20 28 28 74 65 73 74 2d 72 ;; LET* ((test-r
7410: 65 63 6f 72 64 0a 0a 20 20 20 20 3b 3b 20 77 65 ecord.. ;; we
7420: 20 67 65 74 20 68 65 72 65 20 6f 6e 20 22 64 72 get here on "dr
7430: 6f 70 20 74 68 72 6f 75 67 68 22 20 2d 20 6c 6f op through" - lo
7440: 6f 70 20 66 6f 72 20 6e 65 78 74 20 74 65 73 74 op for next test
7450: 20 69 6e 20 71 75 65 75 65 0a 20 20 20 20 3b 3b in queue. ;;
7460: 20 46 49 58 4d 45 21 21 21 21 20 54 48 49 53 20 FIXME!!!! THIS
7470: 53 48 4f 55 4c 44 20 4e 4f 54 20 52 45 51 55 49 SHOULD NOT REQUI
7480: 52 45 20 41 4e 20 45 58 49 54 21 21 21 21 21 21 RE AN EXIT!!!!!!
7490: 21 0a 20 20 20 20 0a 20 20 20 20 28 64 65 62 75 !. . (debu
74a0: 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 31 20 22 g:print-info 1 "
74b0: 41 6c 6c 20 74 65 73 74 73 20 6c 61 75 6e 63 68 All tests launch
74c0: 65 64 22 29 0a 20 20 20 20 28 74 68 72 65 61 64 ed"). (thread
74d0: 2d 73 6c 65 65 70 21 20 30 2e 35 29 0a 20 20 20 -sleep! 0.5).
74e0: 20 3b 3b 20 46 49 58 4d 45 21 20 54 68 69 73 20 ;; FIXME! This
74f0: 68 61 72 73 68 20 65 78 69 74 20 73 68 6f 75 6c harsh exit shoul
7500: 64 20 6e 6f 74 20 62 65 20 6e 65 63 65 73 73 61 d not be necessa
7510: 72 79 2e 2e 2e 2e 0a 20 20 20 20 3b 3b 20 28 69 ry..... ;; (i
7520: 66 20 28 6e 6f 74 20 2a 72 75 6e 72 65 6d 6f 74 f (not *runremot
7530: 65 2a 29 28 65 78 69 74 29 29 20 3b 3b 20 0a 20 e*)(exit)) ;; .
7540: 20 20 20 23 66 29 29 20 3b 3b 20 72 65 74 75 72 #f)) ;; retur
7550: 6e 20 61 20 23 66 20 61 73 20 61 20 68 69 6e 74 n a #f as a hint
7560: 20 74 68 61 74 20 77 65 20 61 72 65 20 64 6f 6e that we are don
7570: 65 0a 20 20 3b 3b 20 48 65 72 65 20 77 65 20 6e e. ;; Here we n
7580: 65 65 64 20 74 6f 20 63 68 65 63 6b 20 74 68 61 eed to check tha
7590: 74 20 61 6c 6c 20 74 68 65 20 74 65 73 74 73 20 t all the tests
75a0: 72 65 6d 61 69 6e 69 6e 67 20 74 6f 20 62 65 20 remaining to be
75b0: 72 75 6e 20 61 72 65 20 65 6c 69 67 69 62 6c 65 run are eligible
75c0: 20 74 6f 20 72 75 6e 0a 20 20 3b 3b 20 61 6e 64 to run. ;; and
75d0: 20 61 72 65 20 6e 6f 74 20 62 6c 6f 63 6b 65 64 are not blocked
75e0: 20 62 79 20 66 61 69 6c 65 64 0a 20 20 0a 0a 3b by failed. ..;
75f0: 3b 20 70 61 72 65 6e 74 2d 74 65 73 74 20 69 73 ; parent-test is
7600: 20 74 68 65 72 65 20 61 73 20 61 20 70 6c 61 63 there as a plac
7610: 65 68 6f 6c 64 65 72 20 66 6f 72 20 77 68 65 6e eholder for when
7620: 20 70 61 72 65 6e 74 2d 74 65 73 74 73 20 63 61 parent-tests ca
7630: 6e 20 62 65 20 72 75 6e 20 61 73 20 61 20 73 65 n be run as a se
7640: 74 75 70 20 73 74 65 70 0a 28 64 65 66 69 6e 65 tup step.(define
7650: 20 28 72 75 6e 3a 74 65 73 74 20 72 75 6e 2d 69 (run:test run-i
7660: 64 20 72 75 6e 6e 61 6d 65 20 6b 65 79 76 61 6c d runname keyval
7670: 6c 73 74 20 74 65 73 74 2d 72 65 63 6f 72 64 20 lst test-record
7680: 66 6c 61 67 73 20 70 61 72 65 6e 74 2d 74 65 73 flags parent-tes
7690: 74 29 0a 20 20 3b 3b 20 41 6c 6c 20 74 68 65 73 t). ;; All thes
76a0: 65 20 76 61 72 73 20 6d 69 67 68 74 20 62 65 20 e vars might be
76b0: 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 74 68 referenced by th
76c0: 65 20 74 65 73 74 63 6f 6e 66 69 67 20 66 69 6c e testconfig fil
76d0: 65 20 72 65 61 64 65 72 0a 20 20 28 6c 65 74 2a e reader. (let*
76e0: 20 28 28 74 65 73 74 2d 6e 61 6d 65 20 20 20 20 ((test-name
76f0: 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 (tests:testqueue
7700: 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 20 20 -get-testname
7710: 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 20 test-record))..
7720: 28 74 65 73 74 2d 77 61 69 74 6f 6e 73 20 28 74 (test-waitons (t
7730: 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 ests:testqueue-g
7740: 65 74 2d 77 61 69 74 6f 6e 73 20 20 20 20 74 65 et-waitons te
7750: 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 20 28 74 st-record)).. (t
7760: 65 73 74 2d 63 6f 6e 66 20 20 20 20 28 74 65 73 est-conf (tes
7770: 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 ts:testqueue-get
7780: 2d 74 65 73 74 63 6f 6e 66 69 67 20 74 65 73 74 -testconfig test
7790: 2d 72 65 63 6f 72 64 29 29 0a 09 20 28 69 74 65 -record)).. (ite
77a0: 6d 64 61 74 20 20 20 20 20 20 28 74 65 73 74 73 mdat (tests
77b0: 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d 69 :testqueue-get-i
77c0: 74 65 6d 64 61 74 20 20 20 20 74 65 73 74 2d 72 temdat test-r
77d0: 65 63 6f 72 64 29 29 0a 09 20 28 74 65 73 74 2d ecord)).. (test-
77e0: 70 61 74 68 20 20 20 20 28 63 6f 6e 63 20 2a 74 path (conc *t
77f0: 6f 70 70 61 74 68 2a 20 22 2f 74 65 73 74 73 2f oppath* "/tests/
7800: 22 20 74 65 73 74 2d 6e 61 6d 65 29 29 20 3b 3b " test-name)) ;;
7810: 20 63 6f 75 6c 64 20 75 73 65 20 74 65 73 74 73 could use tests
7820: 3a 67 65 74 2d 74 65 73 74 63 6f 6e 66 69 67 20 :get-testconfig
7830: 68 65 72 65 20 2e 2e 2e 0a 09 20 28 66 6f 72 63 here ..... (forc
7840: 65 20 20 20 20 20 20 20 20 28 68 61 73 68 2d 74 e (hash-t
7850: 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 able-ref/default
7860: 20 66 6c 61 67 73 20 22 2d 66 6f 72 63 65 22 20 flags "-force"
7870: 23 66 29 29 0a 09 20 28 72 65 72 75 6e 20 20 20 #f)).. (rerun
7880: 20 20 20 20 20 28 68 61 73 68 2d 74 61 62 6c 65 (hash-table
7890: 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 66 6c 61 -ref/default fla
78a0: 67 73 20 22 2d 72 65 72 75 6e 22 20 23 66 29 29 gs "-rerun" #f))
78b0: 0a 09 20 28 6b 65 65 70 67 6f 69 6e 67 20 20 20 .. (keepgoing
78c0: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 (hash-table-ref
78d0: 2f 64 65 66 61 75 6c 74 20 66 6c 61 67 73 20 22 /default flags "
78e0: 2d 6b 65 65 70 67 6f 69 6e 67 22 20 23 66 29 29 -keepgoing" #f))
78f0: 0a 09 20 28 69 74 65 6d 2d 70 61 74 68 20 20 20 .. (item-path
7900: 20 20 22 22 29 0a 09 20 28 64 62 20 20 20 20 20 "").. (db
7910: 20 20 20 20 20 20 23 66 29 29 0a 20 20 20 20 28 #f)). (
7920: 64 65 62 75 67 3a 70 72 69 6e 74 20 34 0a 09 09 debug:print 4...
7930: 20 22 74 65 73 74 2d 63 6f 6e 66 69 67 3a 20 22 "test-config: "
7940: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 3e 61 6c (hash-table->al
7950: 69 73 74 20 74 65 73 74 2d 63 6f 6e 66 29 0a 09 ist test-conf)..
7960: 09 20 22 5c 6e 20 20 20 69 74 65 6d 64 61 74 3a . "\n itemdat:
7970: 20 22 20 69 74 65 6d 64 61 74 0a 09 09 20 29 0a " itemdat... ).
7980: 20 20 20 20 3b 3b 20 73 65 74 74 69 6e 67 20 69 ;; setting i
7990: 74 65 6d 64 61 74 20 74 6f 20 61 20 6c 69 73 74 temdat to a list
79a0: 20 69 66 20 69 74 20 69 73 20 23 66 0a 20 20 20 if it is #f.
79b0: 20 28 69 66 20 28 6e 6f 74 20 69 74 65 6d 64 61 (if (not itemda
79c0: 74 29 28 73 65 74 21 20 69 74 65 6d 64 61 74 20 t)(set! itemdat
79d0: 27 28 29 29 29 0a 20 20 20 20 28 73 65 74 21 20 '())). (set!
79e0: 69 74 65 6d 2d 70 61 74 68 20 28 69 74 65 6d 2d item-path (item-
79f0: 6c 69 73 74 2d 3e 70 61 74 68 20 69 74 65 6d 64 list->path itemd
7a00: 61 74 29 29 0a 20 20 20 20 28 64 65 62 75 67 3a at)). (debug:
7a10: 70 72 69 6e 74 20 32 20 22 41 74 74 65 6d 70 74 print 2 "Attempt
7a20: 69 6e 67 20 74 6f 20 6c 61 75 6e 63 68 20 74 65 ing to launch te
7a30: 73 74 20 22 20 74 65 73 74 2d 6e 61 6d 65 20 28 st " test-name (
7a40: 69 66 20 28 65 71 75 61 6c 3f 20 69 74 65 6d 2d if (equal? item-
7a50: 70 61 74 68 20 22 2f 22 29 20 22 2f 22 20 69 74 path "/") "/" it
7a60: 65 6d 2d 70 61 74 68 29 29 0a 20 20 20 20 28 73 em-path)). (s
7a70: 65 74 65 6e 76 20 22 4d 54 5f 54 45 53 54 5f 4e etenv "MT_TEST_N
7a80: 41 4d 45 22 20 74 65 73 74 2d 6e 61 6d 65 29 20 AME" test-name)
7a90: 3b 3b 20 0a 20 20 20 20 28 73 65 74 65 6e 76 20 ;; . (setenv
7aa0: 22 4d 54 5f 52 55 4e 4e 41 4d 45 22 20 20 20 72 "MT_RUNNAME" r
7ab0: 75 6e 6e 61 6d 65 29 0a 20 20 20 20 28 73 65 74 unname). (set
7ac0: 2d 6d 65 67 61 74 65 73 74 2d 65 6e 76 2d 76 61 -megatest-env-va
7ad0: 72 73 20 72 75 6e 2d 69 64 29 20 3b 3b 20 74 68 rs run-id) ;; th
7ae0: 65 73 65 20 6d 61 79 20 62 65 20 6e 65 65 64 65 ese may be neede
7af0: 64 20 62 79 20 74 68 65 20 6c 61 75 6e 63 68 69 d by the launchi
7b00: 6e 67 20 70 72 6f 63 65 73 73 0a 20 20 20 20 28 ng process. (
7b10: 63 68 61 6e 67 65 2d 64 69 72 65 63 74 6f 72 79 change-directory
7b20: 20 2a 74 6f 70 70 61 74 68 2a 29 0a 0a 20 20 20 *toppath*)..
7b30: 20 3b 3b 20 48 65 72 65 20 69 73 20 77 68 65 72 ;; Here is wher
7b40: 65 20 74 68 65 20 74 65 73 74 5f 6d 65 74 61 20 e the test_meta
7b50: 74 61 62 6c 65 20 69 73 20 62 65 73 74 20 75 70 table is best up
7b60: 64 61 74 65 64 0a 20 20 20 20 3b 3b 20 59 65 73 dated. ;; Yes
7b70: 2c 20 61 6e 6f 74 68 65 72 20 75 73 65 20 6f 66 , another use of
7b80: 20 61 20 67 6c 6f 62 61 6c 20 66 6f 72 20 63 61 a global for ca
7b90: 63 68 69 6e 67 2e 20 4e 65 65 64 20 61 20 62 65 ching. Need a be
7ba0: 74 74 65 72 20 77 61 79 3f 0a 20 20 20 20 28 69 tter way?. (i
7bb0: 66 20 28 6e 6f 74 20 28 68 61 73 68 2d 74 61 62 f (not (hash-tab
7bc0: 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 2a le-ref/default *
7bd0: 74 65 73 74 2d 6d 65 74 61 2d 75 70 64 61 74 65 test-meta-update
7be0: 64 2a 20 74 65 73 74 2d 6e 61 6d 65 20 23 66 29 d* test-name #f)
7bf0: 29 0a 20 20 20 20 20 20 20 20 28 62 65 67 69 6e ). (begin
7c00: 0a 09 20 20 20 28 68 61 73 68 2d 74 61 62 6c 65 .. (hash-table
7c10: 2d 73 65 74 21 20 2a 74 65 73 74 2d 6d 65 74 61 -set! *test-meta
7c20: 2d 75 70 64 61 74 65 64 2a 20 74 65 73 74 2d 6e -updated* test-n
7c30: 61 6d 65 20 23 74 29 0a 20 20 20 20 20 20 20 20 ame #t).
7c40: 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f (open-run-clo
7c50: 73 65 20 72 75 6e 73 3a 75 70 64 61 74 65 2d 74 se runs:update-t
7c60: 65 73 74 5f 6d 65 74 61 20 64 62 20 74 65 73 74 est_meta db test
7c70: 2d 6e 61 6d 65 20 74 65 73 74 2d 63 6f 6e 66 29 -name test-conf)
7c80: 29 29 0a 20 20 20 20 0a 20 20 20 20 3b 3b 20 28 )). . ;; (
7c90: 6c 61 6d 62 64 61 20 28 69 74 65 6d 64 61 74 29 lambda (itemdat)
7ca0: 20 3b 3b 3b 20 28 28 72 69 70 65 6e 65 73 73 20 ;;; ((ripeness
7cb0: 22 6f 76 65 72 72 69 70 65 22 29 20 28 74 65 6d "overripe") (tem
7cc0: 70 65 72 61 74 75 72 65 20 22 63 6f 6f 6c 22 29 perature "cool")
7cd0: 20 28 73 65 61 73 6f 6e 20 22 73 75 6d 6d 65 72 (season "summer
7ce0: 22 29 29 0a 20 20 20 20 28 6c 65 74 2a 20 28 28 ")). (let* ((
7cf0: 6e 65 77 2d 74 65 73 74 2d 70 61 74 68 20 28 73 new-test-path (s
7d00: 74 72 69 6e 67 2d 69 6e 74 65 72 73 70 65 72 73 tring-interspers
7d10: 65 20 28 63 6f 6e 73 20 74 65 73 74 2d 70 61 74 e (cons test-pat
7d20: 68 20 28 6d 61 70 20 63 61 64 72 20 69 74 65 6d h (map cadr item
7d30: 64 61 74 29 29 20 22 2f 22 29 29 0a 09 20 20 20 dat)) "/"))..
7d40: 28 6e 65 77 2d 74 65 73 74 2d 6e 61 6d 65 20 28 (new-test-name (
7d50: 69 66 20 28 65 71 75 61 6c 3f 20 69 74 65 6d 2d if (equal? item-
7d60: 70 61 74 68 20 22 22 29 20 74 65 73 74 2d 6e 61 path "") test-na
7d70: 6d 65 20 28 63 6f 6e 63 20 74 65 73 74 2d 6e 61 me (conc test-na
7d80: 6d 65 20 22 2f 22 20 69 74 65 6d 2d 70 61 74 68 me "/" item-path
7d90: 29 29 29 20 3b 3b 20 6a 75 73 74 20 6e 65 65 64 ))) ;; just need
7da0: 20 69 74 20 74 6f 20 62 65 20 75 6e 69 71 75 65 it to be unique
7db0: 0a 09 20 20 20 28 74 65 73 74 2d 69 64 20 20 20 .. (test-id
7dc0: 20 20 20 20 28 63 64 62 3a 72 65 6d 6f 74 65 2d (cdb:remote-
7dd0: 72 75 6e 20 64 62 3a 67 65 74 2d 74 65 73 74 2d run db:get-test-
7de0: 69 64 20 23 66 20 20 72 75 6e 2d 69 64 20 74 65 id #f run-id te
7df0: 73 74 2d 6e 61 6d 65 20 69 74 65 6d 2d 70 61 74 st-name item-pat
7e00: 68 29 29 0a 09 20 20 20 28 74 65 73 74 64 61 74 h)).. (testdat
7e10: 20 20 20 20 20 20 20 28 63 64 62 3a 67 65 74 2d (cdb:get-
7e20: 74 65 73 74 2d 69 6e 66 6f 2d 62 79 2d 69 64 20 test-info-by-id
7e30: 2a 72 75 6e 72 65 6d 6f 74 65 2a 20 74 65 73 74 *runremote* test
7e40: 2d 69 64 29 29 29 0a 20 20 20 20 20 20 28 69 66 -id))). (if
7e50: 20 28 6e 6f 74 20 74 65 73 74 64 61 74 29 0a 09 (not testdat)..
7e60: 20 20 28 62 65 67 69 6e 0a 09 20 20 20 20 3b 3b (begin.. ;;
7e70: 20 65 6e 73 75 72 65 20 74 68 61 74 20 74 68 65 ensure that the
7e80: 20 70 61 74 68 20 65 78 69 73 74 73 20 62 65 66 path exists bef
7e90: 6f 72 65 20 72 65 67 69 73 74 65 72 69 6e 67 20 ore registering
7ea0: 74 68 65 20 74 65 73 74 0a 09 20 20 20 20 3b 3b the test.. ;;
7eb0: 20 4e 4f 50 45 3a 20 43 61 6e 6e 6f 74 21 20 44 NOPE: Cannot! D
7ec0: 6f 6e 27 74 20 6b 6e 6f 77 20 79 65 74 20 77 68 on't know yet wh
7ed0: 69 63 68 20 64 69 73 6b 20 61 72 65 61 20 77 69 ich disk area wi
7ee0: 6c 6c 20 62 65 20 61 73 73 69 67 6e 65 64 2e 2e ll be assigned..
7ef0: 2e 2e 0a 09 20 20 20 20 3b 3b 20 28 73 79 73 74 .... ;; (syst
7f00: 65 6d 20 28 63 6f 6e 63 20 22 6d 6b 64 69 72 20 em (conc "mkdir
7f10: 2d 70 20 22 20 6e 65 77 2d 74 65 73 74 2d 70 61 -p " new-test-pa
7f20: 74 68 29 29 0a 09 20 20 20 20 3b 3b 0a 09 20 20 th)).. ;;..
7f30: 20 20 3b 3b 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 ;; (open-run-c
7f40: 6c 6f 73 65 20 74 65 73 74 73 3a 72 65 67 69 73 lose tests:regis
7f50: 74 65 72 2d 74 65 73 74 20 64 62 20 72 75 6e 2d ter-test db run-
7f60: 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 74 65 id test-name ite
7f70: 6d 2d 70 61 74 68 29 0a 09 20 20 20 20 3b 3b 0a m-path).. ;;.
7f80: 09 20 20 20 20 3b 3b 20 4e 42 2f 2f 20 66 6f 72 . ;; NB// for
7f90: 20 74 68 65 20 61 62 6f 76 65 20 6c 69 6e 65 2e the above line.
7fa0: 20 49 20 77 61 6e 74 20 74 68 65 20 74 65 73 74 I want the test
7fb0: 20 74 6f 20 62 65 20 72 65 67 69 73 74 65 72 65 to be registere
7fc0: 64 20 6c 6f 6e 67 20 62 65 66 6f 72 65 20 74 68 d long before th
7fd0: 69 73 20 72 6f 75 74 69 6e 65 20 67 65 74 73 20 is routine gets
7fe0: 63 61 6c 6c 65 64 21 0a 09 20 20 20 20 3b 3b 0a called!.. ;;.
7ff0: 09 20 20 20 20 28 73 65 74 21 20 74 65 73 74 2d . (set! test-
8000: 69 64 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f id (open-run-clo
8010: 73 65 20 64 62 3a 67 65 74 2d 74 65 73 74 2d 69 se db:get-test-i
8020: 64 20 64 62 20 72 75 6e 2d 69 64 20 74 65 73 74 d db run-id test
8030: 2d 6e 61 6d 65 20 69 74 65 6d 2d 70 61 74 68 29 -name item-path)
8040: 29 0a 09 20 20 20 20 28 69 66 20 28 6e 6f 74 20 ).. (if (not
8050: 74 65 73 74 2d 69 64 29 0a 09 09 28 62 65 67 69 test-id)...(begi
8060: 6e 0a 09 09 20 20 28 64 65 62 75 67 3a 70 72 69 n... (debug:pri
8070: 6e 74 20 32 20 22 57 41 52 4e 3a 20 54 65 73 74 nt 2 "WARN: Test
8080: 20 6e 6f 74 20 70 72 65 2d 63 72 65 61 74 65 64 not pre-created
8090: 3f 20 74 65 73 74 2d 6e 61 6d 65 3d 22 20 74 65 ? test-name=" te
80a0: 73 74 2d 6e 61 6d 65 20 22 2c 20 69 74 65 6d 2d st-name ", item-
80b0: 70 61 74 68 3d 22 20 69 74 65 6d 2d 70 61 74 68 path=" item-path
80c0: 20 22 2c 20 72 75 6e 2d 69 64 3d 22 20 72 75 6e ", run-id=" run
80d0: 2d 69 64 29 0a 09 09 20 20 28 63 64 62 3a 74 65 -id)... (cdb:te
80e0: 73 74 73 2d 72 65 67 69 73 74 65 72 2d 74 65 73 sts-register-tes
80f0: 74 20 2a 72 75 6e 72 65 6d 6f 74 65 2a 20 72 75 t *runremote* ru
8100: 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 n-id test-name i
8110: 74 65 6d 2d 70 61 74 68 29 0a 09 09 20 20 28 73 tem-path)... (s
8120: 65 74 21 20 74 65 73 74 2d 69 64 20 28 6f 70 65 et! test-id (ope
8130: 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 n-run-close db:g
8140: 65 74 2d 74 65 73 74 2d 69 64 20 64 62 20 72 75 et-test-id db ru
8150: 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 n-id test-name i
8160: 74 65 6d 2d 70 61 74 68 29 29 29 29 0a 09 20 20 tem-path))))..
8170: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 (debug:print-i
8180: 6e 66 6f 20 34 20 22 74 65 73 74 2d 69 64 3d 22 nfo 4 "test-id="
8190: 20 74 65 73 74 2d 69 64 20 22 2c 20 72 75 6e 2d test-id ", run-
81a0: 69 64 3d 22 20 72 75 6e 2d 69 64 20 22 2c 20 74 id=" run-id ", t
81b0: 65 73 74 2d 6e 61 6d 65 3d 22 20 74 65 73 74 2d est-name=" test-
81c0: 6e 61 6d 65 20 22 2c 20 69 74 65 6d 2d 70 61 74 name ", item-pat
81d0: 68 3d 5c 22 22 20 69 74 65 6d 2d 70 61 74 68 20 h=\"" item-path
81e0: 22 5c 22 22 29 0a 09 20 20 20 20 28 73 65 74 21 "\"").. (set!
81f0: 20 74 65 73 74 64 61 74 20 28 63 64 62 3a 67 65 testdat (cdb:ge
8200: 74 2d 74 65 73 74 2d 69 6e 66 6f 2d 62 79 2d 69 t-test-info-by-i
8210: 64 20 2a 72 75 6e 72 65 6d 6f 74 65 2a 20 74 65 d *runremote* te
8220: 73 74 2d 69 64 29 29 29 29 0a 20 20 20 20 20 20 st-id)))).
8230: 28 73 65 74 21 20 74 65 73 74 2d 69 64 20 28 64 (set! test-id (d
8240: 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 b:test-get-id te
8250: 73 74 64 61 74 29 29 0a 20 20 20 20 20 20 28 63 stdat)). (c
8260: 68 61 6e 67 65 2d 64 69 72 65 63 74 6f 72 79 20 hange-directory
8270: 74 65 73 74 2d 70 61 74 68 29 0a 20 20 20 20 20 test-path).
8280: 20 28 63 61 73 65 20 28 69 66 20 66 6f 72 63 65 (case (if force
8290: 20 3b 3b 20 28 61 72 67 73 3a 67 65 74 2d 61 72 ;; (args:get-ar
82a0: 67 20 22 2d 66 6f 72 63 65 22 29 0a 09 09 27 4e g "-force")...'N
82b0: 4f 54 5f 53 54 41 52 54 45 44 0a 09 09 28 69 66 OT_STARTED...(if
82c0: 20 74 65 73 74 64 61 74 0a 09 09 20 20 20 20 28 testdat... (
82d0: 73 74 72 69 6e 67 2d 3e 73 79 6d 62 6f 6c 20 28 string->symbol (
82e0: 74 65 73 74 3a 67 65 74 2d 73 74 61 74 65 20 74 test:get-state t
82f0: 65 73 74 64 61 74 29 29 0a 09 09 20 20 20 20 27 estdat))... '
8300: 66 61 69 6c 65 64 2d 74 6f 2d 69 6e 73 65 72 74 failed-to-insert
8310: 29 29 0a 09 28 28 66 61 69 6c 65 64 2d 74 6f 2d ))..((failed-to-
8320: 69 6e 73 65 72 74 29 0a 09 20 28 64 65 62 75 67 insert).. (debug
8330: 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a :print 0 "ERROR:
8340: 20 46 61 69 6c 65 64 20 74 6f 20 69 6e 73 65 72 Failed to inser
8350: 74 20 74 68 65 20 72 65 63 6f 72 64 20 69 6e 74 t the record int
8360: 6f 20 74 68 65 20 64 62 22 29 29 0a 09 28 28 4e o the db"))..((N
8370: 4f 54 5f 53 54 41 52 54 45 44 20 43 4f 4d 50 4c OT_STARTED COMPL
8380: 45 54 45 44 20 44 45 4c 45 54 45 44 29 0a 09 20 ETED DELETED)..
8390: 28 6c 65 74 20 28 28 72 75 6e 66 6c 61 67 20 23 (let ((runflag #
83a0: 66 29 29 0a 09 20 20 20 28 63 6f 6e 64 0a 09 20 f)).. (cond..
83b0: 20 20 20 3b 3b 20 2d 66 6f 72 63 65 2c 20 72 75 ;; -force, ru
83c0: 6e 20 6e 6f 20 6d 61 74 74 65 72 20 77 68 61 74 n no matter what
83d0: 0a 09 20 20 20 20 28 66 6f 72 63 65 20 28 73 65 .. (force (se
83e0: 74 21 20 72 75 6e 66 6c 61 67 20 23 74 29 29 0a t! runflag #t)).
83f0: 09 20 20 20 20 3b 3b 20 4e 4f 54 5f 53 54 41 52 . ;; NOT_STAR
8400: 54 45 44 2c 20 72 75 6e 20 6e 6f 20 6d 61 74 74 TED, run no matt
8410: 65 72 20 77 68 61 74 0a 09 20 20 20 20 28 28 6d er what.. ((m
8420: 65 6d 62 65 72 20 28 74 65 73 74 3a 67 65 74 2d ember (test:get-
8430: 73 74 61 74 65 20 74 65 73 74 64 61 74 29 20 27 state testdat) '
8440: 28 22 44 45 4c 45 54 45 44 22 20 22 4e 4f 54 5f ("DELETED" "NOT_
8450: 53 54 41 52 54 45 44 22 29 29 28 73 65 74 21 20 STARTED"))(set!
8460: 72 75 6e 66 6c 61 67 20 23 74 29 29 0a 09 20 20 runflag #t))..
8470: 20 20 3b 3b 20 6e 6f 74 20 2d 72 65 72 75 6e 20 ;; not -rerun
8480: 61 6e 64 20 50 41 53 53 2c 20 57 41 52 4e 20 6f and PASS, WARN o
8490: 72 20 43 48 45 43 4b 2c 20 64 6f 20 6e 6f 20 72 r CHECK, do no r
84a0: 75 6e 0a 09 20 20 20 20 28 28 61 6e 64 20 28 6f un.. ((and (o
84b0: 72 20 28 6e 6f 74 20 72 65 72 75 6e 29 0a 09 09 r (not rerun)...
84c0: 20 20 20 20 20 20 6b 65 65 70 67 6f 69 6e 67 29 keepgoing)
84d0: 0a 09 09 20 20 3b 3b 20 52 65 71 75 69 72 65 20 ... ;; Require
84e0: 74 6f 20 66 6f 72 63 65 20 72 65 2d 72 75 6e 20 to force re-run
84f0: 66 6f 72 20 43 4f 4d 50 4c 45 54 45 44 20 6f 72 for COMPLETED or
8500: 20 2a 61 6e 79 74 68 69 6e 67 2a 20 2b 20 50 41 *anything* + PA
8510: 53 53 2c 57 41 52 4e 20 6f 72 20 43 48 45 43 4b SS,WARN or CHECK
8520: 0a 09 09 20 20 28 6f 72 20 28 6d 65 6d 62 65 72 ... (or (member
8530: 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 75 (test:get-statu
8540: 73 20 74 65 73 74 64 61 74 29 20 27 28 22 50 41 s testdat) '("PA
8550: 53 53 22 20 22 57 41 52 4e 22 20 22 43 48 45 43 SS" "WARN" "CHEC
8560: 4b 22 20 22 53 4b 49 50 22 29 29 0a 09 09 20 20 K" "SKIP"))...
8570: 20 20 20 20 28 6d 65 6d 62 65 72 20 28 74 65 73 (member (tes
8580: 74 3a 67 65 74 2d 73 74 61 74 65 20 20 74 65 73 t:get-state tes
8590: 74 64 61 74 29 20 27 28 22 43 4f 4d 50 4c 45 54 tdat) '("COMPLET
85a0: 45 44 22 29 29 29 29 20 0a 09 20 20 20 20 20 28 ED")))) .. (
85b0: 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f debug:print-info
85c0: 20 32 20 22 72 75 6e 6e 69 6e 67 20 74 65 73 74 2 "running test
85d0: 20 22 20 74 65 73 74 2d 6e 61 6d 65 20 22 2f 22 " test-name "/"
85e0: 20 69 74 65 6d 2d 70 61 74 68 20 22 20 73 75 70 item-path " sup
85f0: 70 72 65 73 73 65 64 20 61 73 20 69 74 20 69 73 pressed as it is
8600: 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 " (test:get-sta
8610: 74 65 20 74 65 73 74 64 61 74 29 20 22 20 61 6e te testdat) " an
8620: 64 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 d " (test:get-st
8630: 61 74 75 73 20 74 65 73 74 64 61 74 29 29 0a 09 atus testdat))..
8640: 20 20 20 20 20 28 73 65 74 21 20 72 75 6e 66 6c (set! runfl
8650: 61 67 20 23 66 29 29 0a 09 20 20 20 20 3b 3b 20 ag #f)).. ;;
8660: 2d 72 65 72 75 6e 20 61 6e 64 20 73 74 61 74 75 -rerun and statu
8670: 73 20 69 73 20 6f 6e 65 20 6f 66 20 74 68 65 20 s is one of the
8680: 73 70 65 63 69 66 65 64 2c 20 72 75 6e 20 69 74 specifed, run it
8690: 0a 09 20 20 20 20 28 28 61 6e 64 20 72 65 72 75 .. ((and reru
86a0: 6e 0a 09 09 20 20 28 6c 65 74 2a 20 28 28 72 65 n... (let* ((re
86b0: 72 75 6e 6c 73 74 20 20 20 28 73 74 72 69 6e 67 runlst (string
86c0: 2d 73 70 6c 69 74 20 72 65 72 75 6e 20 22 2c 22 -split rerun ","
86d0: 29 29 0a 09 09 09 20 28 6d 75 73 74 2d 72 65 72 )).... (must-rer
86e0: 75 6e 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 un (member (test
86f0: 3a 67 65 74 2d 73 74 61 74 75 73 20 74 65 73 74 :get-status test
8700: 64 61 74 29 20 72 65 72 75 6e 6c 73 74 29 29 29 dat) rerunlst)))
8710: 0a 09 09 20 20 20 20 28 64 65 62 75 67 3a 70 72 ... (debug:pr
8720: 69 6e 74 2d 69 6e 66 6f 20 33 20 22 2d 72 65 72 int-info 3 "-rer
8730: 75 6e 20 6c 69 73 74 3a 20 22 20 72 65 72 75 6e un list: " rerun
8740: 20 22 2c 20 74 65 73 74 2d 73 74 61 74 75 73 3a ", test-status:
8750: 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 " (test:get-sta
8760: 74 75 73 20 74 65 73 74 64 61 74 29 22 2c 20 6d tus testdat)", m
8770: 75 73 74 2d 72 65 72 75 6e 3a 20 22 20 6d 75 73 ust-rerun: " mus
8780: 74 2d 72 65 72 75 6e 29 0a 09 09 20 20 20 20 6d t-rerun)... m
8790: 75 73 74 2d 72 65 72 75 6e 29 29 0a 09 20 20 20 ust-rerun))..
87a0: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 (debug:print-i
87b0: 6e 66 6f 20 32 20 22 52 65 72 75 6e 20 66 6f 72 nfo 2 "Rerun for
87c0: 63 65 64 20 66 6f 72 20 74 65 73 74 20 22 20 74 ced for test " t
87d0: 65 73 74 2d 6e 61 6d 65 20 22 2f 22 20 69 74 65 est-name "/" ite
87e0: 6d 2d 70 61 74 68 29 0a 09 20 20 20 20 20 28 73 m-path).. (s
87f0: 65 74 21 20 72 75 6e 66 6c 61 67 20 23 74 29 29 et! runflag #t))
8800: 0a 09 20 20 20 20 3b 3b 20 2d 6b 65 65 70 67 6f .. ;; -keepgo
8810: 69 6e 67 2c 20 64 6f 20 6e 6f 74 20 72 65 72 75 ing, do not reru
8820: 6e 20 46 41 49 4c 0a 09 20 20 20 20 28 28 61 6e n FAIL.. ((an
8830: 64 20 6b 65 65 70 67 6f 69 6e 67 0a 09 09 20 20 d keepgoing...
8840: 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a 67 65 (member (test:ge
8850: 74 2d 73 74 61 74 75 73 20 74 65 73 74 64 61 74 t-status testdat
8860: 29 20 27 28 22 46 41 49 4c 22 29 29 29 0a 09 20 ) '("FAIL")))..
8870: 20 20 20 20 28 73 65 74 21 20 72 75 6e 66 6c 61 (set! runfla
8880: 67 20 23 66 29 29 0a 09 20 20 20 20 28 28 61 6e g #f)).. ((an
8890: 64 20 28 6e 6f 74 20 72 65 72 75 6e 29 0a 09 09 d (not rerun)...
88a0: 20 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a (member (test:
88b0: 67 65 74 2d 73 74 61 74 75 73 20 74 65 73 74 64 get-status testd
88c0: 61 74 29 20 27 28 22 46 41 49 4c 22 20 22 6e 2f at) '("FAIL" "n/
88d0: 61 22 29 29 29 0a 09 20 20 20 20 20 28 73 65 74 a"))).. (set
88e0: 21 20 72 75 6e 66 6c 61 67 20 23 74 29 29 0a 09 ! runflag #t))..
88f0: 20 20 20 20 28 65 6c 73 65 20 28 73 65 74 21 20 (else (set!
8900: 72 75 6e 66 6c 61 67 20 23 66 29 29 29 0a 09 20 runflag #f)))..
8910: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 36 (debug:print 6
8920: 20 22 52 55 4e 4e 49 4e 47 20 3d 3e 20 72 75 6e "RUNNING => run
8930: 66 6c 61 67 3a 20 22 20 72 75 6e 66 6c 61 67 20 flag: " runflag
8940: 22 20 53 54 41 54 45 3a 20 22 20 28 74 65 73 74 " STATE: " (test
8950: 3a 67 65 74 2d 73 74 61 74 65 20 74 65 73 74 64 :get-state testd
8960: 61 74 29 20 22 20 53 54 41 54 55 53 3a 20 22 20 at) " STATUS: "
8970: 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 75 73 (test:get-status
8980: 20 74 65 73 74 64 61 74 29 29 0a 09 20 20 20 28 testdat)).. (
8990: 69 66 20 28 6e 6f 74 20 72 75 6e 66 6c 61 67 29 if (not runflag)
89a0: 0a 09 20 20 20 20 20 20 20 28 69 66 20 28 6e 6f .. (if (no
89b0: 74 20 70 61 72 65 6e 74 2d 74 65 73 74 29 0a 09 t parent-test)..
89c0: 09 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 . (debug:print
89d0: 20 31 20 22 4e 4f 54 45 3a 20 4e 6f 74 20 73 74 1 "NOTE: Not st
89e0: 61 72 74 69 6e 67 20 74 65 73 74 20 22 20 6e 65 arting test " ne
89f0: 77 2d 74 65 73 74 2d 6e 61 6d 65 20 22 20 61 73 w-test-name " as
8a00: 20 69 74 20 69 73 20 73 74 61 74 65 20 5c 22 22 it is state \""
8a10: 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 65 (test:get-state
8a20: 20 74 65 73 74 64 61 74 29 20 0a 09 09 09 09 22 testdat) ....."
8a30: 5c 22 20 61 6e 64 20 73 74 61 74 75 73 20 5c 22 \" and status \"
8a40: 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 " (test:get-stat
8a50: 75 73 20 74 65 73 74 64 61 74 29 20 22 5c 22 2c us testdat) "\",
8a60: 20 75 73 65 20 2d 72 65 72 75 6e 20 5c 22 22 20 use -rerun \""
8a70: 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 75 73 (test:get-status
8a80: 20 74 65 73 74 64 61 74 29 0a 20 20 20 20 20 20 testdat).
8a90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8aa0: 20 20 20 20 20 20 20 20 20 20 22 5c 22 20 6f 72 "\" or
8ab0: 20 2d 66 6f 72 63 65 20 74 6f 20 6f 76 65 72 72 -force to overr
8ac0: 69 64 65 22 29 29 0a 09 20 20 20 20 20 20 20 3b ide")).. ;
8ad0: 3b 20 4e 4f 54 45 3a 20 4e 6f 20 6c 6f 6e 67 65 ; NOTE: No longe
8ae0: 72 20 62 65 20 63 68 65 63 6b 69 6e 67 20 70 72 r be checking pr
8af0: 65 72 65 71 75 69 73 69 74 65 73 20 68 65 72 65 erequisites here
8b00: 21 20 57 69 6c 6c 20 6e 65 76 65 72 20 67 65 74 ! Will never get
8b10: 20 68 65 72 65 20 75 6e 6c 65 73 73 20 70 72 65 here unless pre
8b20: 72 65 71 73 20 61 72 65 0a 09 20 20 20 20 20 20 reqs are..
8b30: 20 3b 3b 20 20 20 20 20 20 20 61 6c 72 65 61 64 ;; alread
8b40: 79 20 6d 65 74 2e 0a 09 20 20 20 20 20 20 20 3b y met... ;
8b50: 3b 20 54 68 69 73 20 77 6f 75 6c 64 20 62 65 20 ; This would be
8b60: 61 20 67 72 65 61 74 20 70 6c 61 63 65 20 74 6f a great place to
8b70: 20 64 6f 20 74 68 65 20 70 72 6f 63 65 73 73 2d do the process-
8b80: 66 6f 72 6b 0a 09 20 20 20 20 20 20 20 28 69 66 fork.. (if
8b90: 20 28 6e 6f 74 20 28 6c 61 75 6e 63 68 2d 74 65 (not (launch-te
8ba0: 73 74 20 23 66 20 72 75 6e 2d 69 64 20 72 75 6e st #f run-id run
8bb0: 6e 61 6d 65 20 74 65 73 74 2d 63 6f 6e 66 20 6b name test-conf k
8bc0: 65 79 76 61 6c 6c 73 74 20 74 65 73 74 2d 6e 61 eyvallst test-na
8bd0: 6d 65 20 74 65 73 74 2d 70 61 74 68 20 69 74 65 me test-path ite
8be0: 6d 64 61 74 20 66 6c 61 67 73 29 29 0a 09 09 20 mdat flags))...
8bf0: 20 20 28 62 65 67 69 6e 0a 09 09 20 20 20 20 20 (begin...
8c00: 28 70 72 69 6e 74 20 22 45 52 52 4f 52 3a 20 46 (print "ERROR: F
8c10: 61 69 6c 65 64 20 74 6f 20 6c 61 75 6e 63 68 20 ailed to launch
8c20: 74 68 65 20 74 65 73 74 2e 20 45 78 69 74 69 6e the test. Exitin
8c30: 67 20 61 73 20 73 6f 6f 6e 20 61 73 20 70 6f 73 g as soon as pos
8c40: 73 69 62 6c 65 22 29 0a 09 09 20 20 20 20 20 28 sible")... (
8c50: 73 65 74 21 20 2a 67 6c 6f 62 61 6c 65 78 69 74 set! *globalexit
8c60: 73 74 61 74 75 73 2a 20 31 29 20 3b 3b 20 0a 09 status* 1) ;; ..
8c70: 09 20 20 20 20 20 28 70 72 6f 63 65 73 73 2d 73 . (process-s
8c80: 69 67 6e 61 6c 20 28 63 75 72 72 65 6e 74 2d 70 ignal (current-p
8c90: 72 6f 63 65 73 73 2d 69 64 29 20 73 69 67 6e 61 rocess-id) signa
8ca0: 6c 2f 6b 69 6c 6c 29 29 29 29 29 29 0a 09 28 28 l/kill))))))..((
8cb0: 4b 49 4c 4c 45 44 29 20 0a 09 20 28 64 65 62 75 KILLED) .. (debu
8cc0: 67 3a 70 72 69 6e 74 20 31 20 22 4e 4f 54 45 3a g:print 1 "NOTE:
8cd0: 20 22 20 6e 65 77 2d 74 65 73 74 2d 6e 61 6d 65 " new-test-name
8ce0: 20 22 20 69 73 20 61 6c 72 65 61 64 79 20 72 75 " is already ru
8cf0: 6e 6e 69 6e 67 20 6f 72 20 77 61 73 20 65 78 70 nning or was exp
8d00: 6c 69 63 74 6c 79 20 6b 69 6c 6c 65 64 2c 20 75 lictly killed, u
8d10: 73 65 20 2d 66 6f 72 63 65 20 74 6f 20 6c 61 75 se -force to lau
8d20: 6e 63 68 20 69 74 2e 22 29 29 0a 09 28 28 4c 41 nch it."))..((LA
8d30: 55 4e 43 48 45 44 20 52 45 4d 4f 54 45 48 4f 53 UNCHED REMOTEHOS
8d40: 54 53 54 41 52 54 20 52 55 4e 4e 49 4e 47 29 20 TSTART RUNNING)
8d50: 20 0a 09 20 28 69 66 20 28 3e 20 28 2d 20 28 63 .. (if (> (- (c
8d60: 75 72 72 65 6e 74 2d 73 65 63 6f 6e 64 73 29 28 urrent-seconds)(
8d70: 2b 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 65 + (db:test-get-e
8d80: 76 65 6e 74 5f 74 69 6d 65 20 74 65 73 74 64 61 vent_time testda
8d90: 74 29 0a 09 09 09 09 20 20 20 20 20 20 20 28 64 t)..... (d
8da0: 62 3a 74 65 73 74 2d 67 65 74 2d 72 75 6e 5f 64 b:test-get-run_d
8db0: 75 72 61 74 69 6f 6e 20 74 65 73 74 64 61 74 29 uration testdat)
8dc0: 29 29 0a 09 09 36 30 30 29 20 3b 3b 20 69 2e 65 ))...600) ;; i.e
8dd0: 2e 20 6e 6f 20 75 70 64 61 74 65 20 66 6f 72 20 . no update for
8de0: 6d 6f 72 65 20 74 68 61 6e 20 36 30 30 20 73 65 more than 600 se
8df0: 63 6f 6e 64 73 0a 09 20 20 20 20 20 28 62 65 67 conds.. (beg
8e00: 69 6e 0a 09 20 20 20 20 20 20 20 28 64 65 62 75 in.. (debu
8e10: 67 3a 70 72 69 6e 74 20 30 20 22 57 41 52 4e 49 g:print 0 "WARNI
8e20: 4e 47 3a 20 54 65 73 74 20 22 20 74 65 73 74 2d NG: Test " test-
8e30: 6e 61 6d 65 20 22 20 61 70 70 65 61 72 73 20 74 name " appears t
8e40: 6f 20 62 65 20 64 65 61 64 2e 20 46 6f 72 63 69 o be dead. Forci
8e50: 6e 67 20 69 74 20 74 6f 20 73 74 61 74 65 20 49 ng it to state I
8e60: 4e 43 4f 4d 50 4c 45 54 45 20 61 6e 64 20 73 74 NCOMPLETE and st
8e70: 61 74 75 73 20 53 54 55 43 4b 2f 44 45 41 44 22 atus STUCK/DEAD"
8e80: 29 0a 09 20 20 20 20 20 20 20 28 74 65 73 74 73 ).. (tests
8e90: 3a 74 65 73 74 2d 73 65 74 2d 73 74 61 74 75 73 :test-set-status
8ea0: 21 20 74 65 73 74 2d 69 64 20 22 49 4e 43 4f 4d ! test-id "INCOM
8eb0: 50 4c 45 54 45 22 20 22 53 54 55 43 4b 2f 44 45 PLETE" "STUCK/DE
8ec0: 41 44 22 20 22 54 65 73 74 20 69 73 20 73 74 75 AD" "Test is stu
8ed0: 63 6b 20 6f 72 20 64 65 61 64 22 20 23 66 29 29 ck or dead" #f))
8ee0: 0a 09 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 .. (debug:pr
8ef0: 69 6e 74 20 32 20 22 4e 4f 54 45 3a 20 22 20 74 int 2 "NOTE: " t
8f00: 65 73 74 2d 6e 61 6d 65 20 22 20 69 73 20 61 6c est-name " is al
8f10: 72 65 61 64 79 20 72 75 6e 6e 69 6e 67 22 29 29 ready running"))
8f20: 29 0a 09 28 65 6c 73 65 20 20 20 20 20 20 20 28 )..(else (
8f30: 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 debug:print 0 "E
8f40: 52 52 4f 52 3a 20 46 61 69 6c 65 64 20 74 6f 20 RROR: Failed to
8f50: 6c 61 75 6e 63 68 20 74 65 73 74 20 22 20 6e 65 launch test " ne
8f60: 77 2d 74 65 73 74 2d 6e 61 6d 65 20 22 2e 20 55 w-test-name ". U
8f70: 6e 72 65 63 6f 67 6e 69 73 65 64 20 73 74 61 74 nrecognised stat
8f80: 65 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 e " (test:get-st
8f90: 61 74 65 20 74 65 73 74 64 61 74 29 29 29 29 29 ate testdat)))))
8fa0: 29 29 0a 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ))..;;==========
8fb0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8fc0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8fd0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8fe0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 ============.;;
8ff0: 45 4e 44 20 4f 46 20 4e 45 57 20 53 54 55 46 46 END OF NEW STUFF
9000: 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d .;;=============
9010: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a 28 64 65 66 69 =========..(defi
9050: 6e 65 20 28 67 65 74 2d 64 69 72 2d 75 70 2d 6e ne (get-dir-up-n
9060: 20 64 69 72 20 2e 20 70 61 72 61 6d 73 29 20 0a dir . params) .
9070: 20 20 28 6c 65 74 20 28 28 64 70 61 72 74 73 20 (let ((dparts
9080: 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 20 64 (string-split d
9090: 69 72 20 22 2f 22 29 29 0a 09 28 63 6f 75 6e 74 ir "/"))..(count
90a0: 20 20 20 28 69 66 20 28 6e 75 6c 6c 3f 20 70 61 (if (null? pa
90b0: 72 61 6d 73 29 20 31 20 28 63 61 72 20 70 61 72 rams) 1 (car par
90c0: 61 6d 73 29 29 29 29 0a 20 20 20 20 28 63 6f 6e ams)))). (con
90d0: 63 20 22 2f 22 20 28 73 74 72 69 6e 67 2d 69 6e c "/" (string-in
90e0: 74 65 72 73 70 65 72 73 65 20 0a 09 20 20 20 20 tersperse ..
90f0: 20 20 20 28 74 61 6b 65 20 64 70 61 72 74 73 20 (take dparts
9100: 28 2d 20 28 6c 65 6e 67 74 68 20 64 70 61 72 74 (- (length dpart
9110: 73 29 20 63 6f 75 6e 74 29 29 0a 09 20 20 20 20 s) count))..
9120: 20 20 20 22 2f 22 29 29 29 29 0a 3b 3b 20 52 65 "/")))).;; Re
9130: 6d 6f 76 65 20 72 75 6e 73 0a 3b 3b 20 66 69 65 move runs.;; fie
9140: 6c 64 73 20 61 72 65 20 70 61 73 73 69 6e 67 20 lds are passing
9150: 69 6e 20 74 68 72 6f 75 67 68 20 0a 3b 3b 20 61 in through .;; a
9160: 63 74 69 6f 6e 3a 0a 3b 3b 20 20 20 20 27 72 65 ction:.;; 're
9170: 6d 6f 76 65 2d 72 75 6e 73 0a 3b 3b 20 20 20 20 move-runs.;;
9180: 27 73 65 74 2d 73 74 61 74 65 2d 73 74 61 74 75 'set-state-statu
9190: 73 0a 3b 3b 0a 3b 3b 20 4e 42 2f 2f 20 73 68 6f s.;;.;; NB// sho
91a0: 75 6c 64 20 70 61 73 73 20 69 6e 20 6b 65 79 73 uld pass in keys
91b0: 3f 0a 3b 3b 0a 28 64 65 66 69 6e 65 20 28 72 75 ?.;;.(define (ru
91c0: 6e 73 3a 6f 70 65 72 61 74 65 2d 6f 6e 20 61 63 ns:operate-on ac
91d0: 74 69 6f 6e 20 72 75 6e 6e 61 6d 65 70 61 74 74 tion runnamepatt
91e0: 20 74 65 73 74 70 61 74 74 20 23 21 6b 65 79 20 testpatt #!key
91f0: 28 73 74 61 74 65 20 23 66 29 28 73 74 61 74 75 (state #f)(statu
9200: 73 20 23 66 29 28 6e 65 77 2d 73 74 61 74 65 2d s #f)(new-state-
9210: 73 74 61 74 75 73 20 23 66 29 29 0a 20 20 28 63 status #f)). (c
9220: 6f 6d 6d 6f 6e 3a 63 6c 65 61 72 2d 63 61 63 68 ommon:clear-cach
9230: 65 73 29 20 3b 3b 20 63 6c 65 61 72 20 61 6c 6c es) ;; clear all
9240: 20 63 61 63 68 65 73 0a 20 20 28 6c 65 74 2a 20 caches. (let*
9250: 28 28 64 62 20 20 20 20 20 20 20 20 20 20 20 23 ((db #
9260: 66 29 0a 09 20 28 6b 65 79 73 20 20 20 20 20 20 f).. (keys
9270: 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f (open-run-clo
9280: 73 65 20 64 62 3a 67 65 74 2d 6b 65 79 73 20 64 se db:get-keys d
9290: 62 29 29 0a 09 20 28 72 75 6e 64 61 74 20 20 20 b)).. (rundat
92a0: 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c (open-run-cl
92b0: 6f 73 65 20 72 75 6e 73 3a 67 65 74 2d 72 75 6e ose runs:get-run
92c0: 73 2d 62 79 2d 70 61 74 74 20 64 62 20 6b 65 79 s-by-patt db key
92d0: 73 20 72 75 6e 6e 61 6d 65 70 61 74 74 29 29 0a s runnamepatt)).
92e0: 09 20 28 68 65 61 64 65 72 20 20 20 20 20 20 20 . (header
92f0: 28 76 65 63 74 6f 72 2d 72 65 66 20 72 75 6e 64 (vector-ref rund
9300: 61 74 20 30 29 29 0a 09 20 28 72 75 6e 73 20 20 at 0)).. (runs
9310: 20 20 20 20 20 20 20 28 76 65 63 74 6f 72 2d 72 (vector-r
9320: 65 66 20 72 75 6e 64 61 74 20 31 29 29 0a 09 20 ef rundat 1))..
9330: 28 73 74 61 74 65 73 20 20 20 20 20 20 20 28 69 (states (i
9340: 66 20 73 74 61 74 65 20 20 28 73 74 72 69 6e 67 f state (string
9350: 2d 73 70 6c 69 74 20 73 74 61 74 65 20 20 22 2c -split state ",
9360: 22 29 20 27 28 29 29 29 0a 09 20 28 73 74 61 74 ") '())).. (stat
9370: 75 73 65 73 20 20 20 20 20 28 69 66 20 73 74 61 uses (if sta
9380: 74 75 73 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 tus (string-spli
9390: 74 20 73 74 61 74 75 73 20 22 2c 22 29 20 27 28 t status ",") '(
93a0: 29 29 29 0a 09 20 28 73 74 61 74 65 2d 73 74 61 ))).. (state-sta
93b0: 74 75 73 20 28 69 66 20 28 73 74 72 69 6e 67 3f tus (if (string?
93c0: 20 6e 65 77 2d 73 74 61 74 65 2d 73 74 61 74 75 new-state-statu
93d0: 73 29 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 s) (string-split
93e0: 20 6e 65 77 2d 73 74 61 74 65 2d 73 74 61 74 75 new-state-statu
93f0: 73 20 22 2c 22 29 20 27 28 23 66 20 23 66 29 29 s ",") '(#f #f))
9400: 29 29 0a 20 20 20 20 28 64 65 62 75 67 3a 70 72 )). (debug:pr
9410: 69 6e 74 2d 69 6e 66 6f 20 34 20 22 72 75 6e 73 int-info 4 "runs
9420: 3a 6f 70 65 72 61 74 65 2d 6f 6e 20 3d 3e 20 48 :operate-on => H
9430: 65 61 64 65 72 3a 20 22 20 68 65 61 64 65 72 20 eader: " header
9440: 22 20 61 63 74 69 6f 6e 3a 20 22 20 61 63 74 69 " action: " acti
9450: 6f 6e 20 22 20 6e 65 77 2d 73 74 61 74 65 2d 73 on " new-state-s
9460: 74 61 74 75 73 3a 20 22 20 6e 65 77 2d 73 74 61 tatus: " new-sta
9470: 74 65 2d 73 74 61 74 75 73 29 0a 20 20 20 20 28 te-status). (
9480: 69 66 20 28 3e 20 32 20 28 6c 65 6e 67 74 68 20 if (> 2 (length
9490: 73 74 61 74 65 2d 73 74 61 74 75 73 29 29 0a 09 state-status))..
94a0: 28 62 65 67 69 6e 0a 09 20 20 28 64 65 62 75 67 (begin.. (debug
94b0: 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a :print 0 "ERROR:
94c0: 20 74 68 65 20 70 61 72 61 6d 65 74 65 72 20 74 the parameter t
94d0: 6f 20 2d 73 65 74 2d 73 74 61 74 65 2d 73 74 61 o -set-state-sta
94e0: 74 75 73 20 69 73 20 61 20 63 6f 6d 6d 61 20 64 tus is a comma d
94f0: 65 6c 69 6d 69 74 65 64 20 73 74 72 69 6e 67 2e elimited string.
9500: 20 45 2e 67 2e 20 43 4f 4d 50 4c 45 54 45 44 2c E.g. COMPLETED,
9510: 46 41 49 4c 22 29 0a 09 20 20 28 65 78 69 74 29 FAIL").. (exit)
9520: 29 29 0a 20 20 20 20 28 66 6f 72 2d 65 61 63 68 )). (for-each
9530: 0a 20 20 20 20 20 28 6c 61 6d 62 64 61 20 28 72 . (lambda (r
9540: 75 6e 29 0a 20 20 20 20 20 20 20 28 6c 65 74 20 un). (let
9550: 28 28 72 75 6e 6b 65 79 20 28 73 74 72 69 6e 67 ((runkey (string
9560: 2d 69 6e 74 65 72 73 70 65 72 73 65 20 28 6d 61 -intersperse (ma
9570: 70 20 28 6c 61 6d 62 64 61 20 28 6b 29 0a 09 09 p (lambda (k)...
9580: 09 09 09 09 28 64 62 3a 67 65 74 2d 76 61 6c 75 ....(db:get-valu
9590: 65 2d 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 e-by-header run
95a0: 68 65 61 64 65 72 20 28 76 65 63 74 6f 72 2d 72 header (vector-r
95b0: 65 66 20 6b 20 30 29 29 29 20 6b 65 79 73 29 20 ef k 0))) keys)
95c0: 22 2f 22 29 29 0a 09 20 20 20 20 20 28 64 69 72 "/")).. (dir
95d0: 73 2d 74 6f 2d 72 65 6d 6f 76 65 20 28 6d 61 6b s-to-remove (mak
95e0: 65 2d 68 61 73 68 2d 74 61 62 6c 65 29 29 29 0a e-hash-table))).
95f0: 09 20 28 6c 65 74 2a 20 28 28 72 75 6e 2d 69 64 . (let* ((run-id
9600: 20 20 20 20 28 64 62 3a 67 65 74 2d 76 61 6c 75 (db:get-valu
9610: 65 2d 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 e-by-header run
9620: 68 65 61 64 65 72 20 22 69 64 22 29 29 0a 09 09 header "id"))...
9630: 28 72 75 6e 2d 73 74 61 74 65 20 28 64 62 3a 67 (run-state (db:g
9640: 65 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 et-value-by-head
9650: 65 72 20 72 75 6e 20 68 65 61 64 65 72 20 22 73 er run header "s
9660: 74 61 74 65 22 29 29 0a 09 09 28 74 65 73 74 73 tate"))...(tests
9670: 20 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 65 (if (not (e
9680: 71 75 61 6c 3f 20 72 75 6e 2d 73 74 61 74 65 20 qual? run-state
9690: 22 6c 6f 63 6b 65 64 22 29 29 0a 09 09 09 20 20 "locked"))....
96a0: 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 (open-run-c
96b0: 6c 6f 73 65 20 64 62 3a 67 65 74 2d 74 65 73 74 lose db:get-test
96c0: 73 2d 66 6f 72 2d 72 75 6e 20 64 62 20 72 75 6e s-for-run db run
96d0: 2d 69 64 0a 09 09 09 09 09 09 20 20 20 20 20 20 -id.......
96e0: 74 65 73 74 70 61 74 74 20 73 74 61 74 65 73 20 testpatt states
96f0: 73 74 61 74 75 73 65 73 0a 09 09 09 09 09 09 20 statuses.......
9700: 20 20 20 20 20 6e 6f 74 2d 69 6e 3a 20 20 23 66 not-in: #f
9710: 0a 09 09 09 09 09 09 20 20 20 20 20 20 73 6f 72 ....... sor
9720: 74 2d 62 79 3a 20 28 63 61 73 65 20 61 63 74 69 t-by: (case acti
9730: 6f 6e 0a 09 09 09 09 09 09 09 09 20 28 28 72 65 on......... ((re
9740: 6d 6f 76 65 2d 72 75 6e 73 29 20 27 72 75 6e 64 move-runs) 'rund
9750: 69 72 29 0a 09 09 09 09 09 09 09 09 20 28 65 6c ir)......... (el
9760: 73 65 20 20 20 20 20 20 20 20 20 20 27 65 76 65 se 'eve
9770: 6e 74 5f 74 69 6d 65 29 29 29 0a 09 09 09 20 20 nt_time)))....
9780: 20 20 20 20 20 27 28 29 29 29 0a 09 09 28 6c 61 '()))...(la
9790: 73 74 74 70 61 74 68 20 22 2f 64 6f 65 73 2f 6e sttpath "/does/n
97a0: 6f 74 2f 65 78 69 73 74 2f 49 2f 68 6f 70 65 22 ot/exist/I/hope"
97b0: 29 29 0a 09 20 20 20 28 64 65 62 75 67 3a 70 72 )).. (debug:pr
97c0: 69 6e 74 2d 69 6e 66 6f 20 34 20 22 72 75 6e 73 int-info 4 "runs
97d0: 3a 6f 70 65 72 61 74 65 2d 6f 6e 20 72 75 6e 3d :operate-on run=
97e0: 22 20 72 75 6e 20 22 2c 20 68 65 61 64 65 72 3d " run ", header=
97f0: 22 20 68 65 61 64 65 72 29 0a 09 20 20 20 28 69 " header).. (i
9800: 66 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 65 f (not (null? te
9810: 73 74 73 29 29 0a 09 20 20 20 20 20 20 20 28 62 sts)).. (b
9820: 65 67 69 6e 0a 09 09 20 28 63 61 73 65 20 61 63 egin... (case ac
9830: 74 69 6f 6e 0a 09 09 20 20 20 28 28 72 65 6d 6f tion... ((remo
9840: 76 65 2d 72 75 6e 73 29 0a 09 09 20 20 20 20 28 ve-runs)... (
9850: 64 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 52 debug:print 1 "R
9860: 65 6d 6f 76 69 6e 67 20 74 65 73 74 73 20 66 6f emoving tests fo
9870: 72 20 72 75 6e 3a 20 22 20 72 75 6e 6b 65 79 20 r run: " runkey
9880: 22 20 22 20 28 64 62 3a 67 65 74 2d 76 61 6c 75 " " (db:get-valu
9890: 65 2d 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 e-by-header run
98a0: 68 65 61 64 65 72 20 22 72 75 6e 6e 61 6d 65 22 header "runname"
98b0: 29 29 29 0a 09 09 20 20 20 28 28 73 65 74 2d 73 )))... ((set-s
98c0: 74 61 74 65 2d 73 74 61 74 75 73 29 0a 09 09 20 tate-status)...
98d0: 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 (debug:print
98e0: 31 20 22 4d 6f 64 69 66 79 69 6e 67 20 73 74 61 1 "Modifying sta
98f0: 74 65 20 61 6e 64 20 73 74 61 75 73 20 66 6f 72 te and staus for
9900: 20 74 65 73 74 73 20 66 6f 72 20 72 75 6e 3a 20 tests for run:
9910: 22 20 72 75 6e 6b 65 79 20 22 20 22 20 28 64 62 " runkey " " (db
9920: 3a 67 65 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 :get-value-by-he
9930: 61 64 65 72 20 72 75 6e 20 68 65 61 64 65 72 20 ader run header
9940: 22 72 75 6e 6e 61 6d 65 22 29 29 29 0a 09 09 20 "runname")))...
9950: 20 20 28 28 70 72 69 6e 74 2d 72 75 6e 29 0a 09 ((print-run)..
9960: 09 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e . (debug:prin
9970: 74 20 31 20 22 50 72 69 6e 74 69 6e 67 20 69 6e t 1 "Printing in
9980: 66 6f 20 66 6f 72 20 72 75 6e 20 22 20 72 75 6e fo for run " run
9990: 6b 65 79 20 22 2c 20 72 75 6e 3d 22 20 72 75 6e key ", run=" run
99a0: 20 22 2c 20 74 65 73 74 73 3d 22 20 74 65 73 74 ", tests=" test
99b0: 73 20 22 2c 20 68 65 61 64 65 72 3d 22 20 68 65 s ", header=" he
99c0: 61 64 65 72 29 0a 09 09 20 20 20 20 61 63 74 69 ader)... acti
99d0: 6f 6e 29 0a 09 09 20 20 20 28 65 6c 73 65 0a 09 on)... (else..
99e0: 09 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e . (debug:prin
99f0: 74 2d 69 6e 66 6f 20 30 20 22 61 63 74 69 6f 6e t-info 0 "action
9a00: 20 6e 6f 74 20 72 65 63 6f 67 6e 69 73 65 64 20 not recognised
9a10: 22 20 61 63 74 69 6f 6e 29 29 29 0a 09 09 20 28 " action)))... (
9a20: 66 6f 72 2d 65 61 63 68 0a 09 09 20 20 28 6c 61 for-each... (la
9a30: 6d 62 64 61 20 28 74 65 73 74 29 0a 09 09 20 20 mbda (test)...
9a40: 20 20 28 6c 65 74 2a 20 28 28 69 74 65 6d 2d 70 (let* ((item-p
9a50: 61 74 68 20 28 64 62 3a 74 65 73 74 2d 67 65 74 ath (db:test-get
9a60: 2d 69 74 65 6d 2d 70 61 74 68 20 74 65 73 74 29 -item-path test)
9a70: 29 0a 09 09 09 20 20 20 28 74 65 73 74 2d 6e 61 ).... (test-na
9a80: 6d 65 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d me (db:test-get-
9a90: 74 65 73 74 6e 61 6d 65 20 74 65 73 74 29 29 0a testname test)).
9aa0: 09 09 09 20 20 20 28 72 75 6e 2d 64 69 72 20 20 ... (run-dir
9ab0: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 72 75 (db:test-get-ru
9ac0: 6e 64 69 72 20 74 65 73 74 29 29 20 20 20 20 3b ndir test)) ;
9ad0: 3b 20 72 75 6e 20 64 69 72 20 69 73 20 66 72 6f ; run dir is fro
9ae0: 6d 20 74 68 65 20 6c 69 6e 6b 20 74 72 65 65 0a m the link tree.
9af0: 09 09 09 20 20 20 28 72 65 61 6c 2d 64 69 72 20 ... (real-dir
9b00: 20 28 69 66 20 28 66 69 6c 65 2d 65 78 69 73 74 (if (file-exist
9b10: 73 3f 20 72 75 6e 2d 64 69 72 29 0a 09 09 09 09 s? run-dir).....
9b20: 09 20 20 28 72 65 73 6f 6c 76 65 2d 70 61 74 68 . (resolve-path
9b30: 6e 61 6d 65 20 72 75 6e 2d 64 69 72 29 0a 09 09 name run-dir)...
9b40: 09 09 09 20 20 23 66 29 29 0a 09 09 09 20 20 20 ... #f))....
9b50: 28 74 65 73 74 2d 69 64 20 20 20 28 64 62 3a 74 (test-id (db:t
9b60: 65 73 74 2d 67 65 74 2d 69 64 20 74 65 73 74 29 est-get-id test)
9b70: 29 29 0a 09 09 20 20 20 20 20 20 3b 3b 20 20 20 ))... ;;
9b80: 28 74 64 62 20 20 20 20 20 20 20 28 64 62 3a 6f (tdb (db:o
9b90: 70 65 6e 2d 74 65 73 74 2d 64 62 20 72 75 6e 2d pen-test-db run-
9ba0: 64 69 72 29 29 29 0a 09 09 20 20 20 20 20 20 28 dir)))... (
9bb0: 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f debug:print-info
9bc0: 20 34 20 22 74 65 73 74 3d 22 20 74 65 73 74 29 4 "test=" test)
9bd0: 20 3b 3b 20 20 20 22 20 28 64 62 3a 74 65 73 74 ;; " (db:test
9be0: 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 74 65 -get-testname te
9bf0: 73 74 29 20 22 20 69 64 3a 20 22 20 28 64 62 3a st) " id: " (db:
9c00: 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 73 74 test-get-id test
9c10: 29 20 22 20 22 20 69 74 65 6d 2d 70 61 74 68 20 ) " " item-path
9c20: 22 20 61 63 74 69 6f 6e 3a 20 22 20 61 63 74 69 " action: " acti
9c30: 6f 6e 29 0a 09 09 20 20 20 20 20 20 28 63 61 73 on)... (cas
9c40: 65 20 61 63 74 69 6f 6e 0a 09 09 09 28 28 72 65 e action....((re
9c50: 6d 6f 76 65 2d 72 75 6e 73 29 20 3b 3b 20 74 68 move-runs) ;; th
9c60: 65 20 74 64 62 20 69 73 20 66 6f 72 20 66 75 74 e tdb is for fut
9c70: 75 72 65 20 70 6f 73 73 69 62 6c 65 2e 20 0a 09 ure possible. ..
9c80: 09 09 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f .. (open-run-clo
9c90: 73 65 20 64 62 3a 64 65 6c 65 74 65 2d 74 65 73 se db:delete-tes
9ca0: 74 2d 72 65 63 6f 72 64 73 20 64 62 20 23 66 20 t-records db #f
9cb0: 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 (db:test-get-id
9cc0: 74 65 73 74 29 29 0a 09 09 09 20 28 64 65 62 75 test)).... (debu
9cd0: 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 31 20 22 g:print-info 1 "
9ce0: 41 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 72 65 Attempting to re
9cf0: 6d 6f 76 65 20 22 20 28 69 66 20 72 65 61 6c 2d move " (if real-
9d00: 64 69 72 20 28 63 6f 6e 63 20 22 20 64 69 72 20 dir (conc " dir
9d10: 22 20 72 65 61 6c 2d 64 69 72 20 22 20 61 6e 64 " real-dir " and
9d20: 20 22 29 20 22 22 29 20 22 20 6c 69 6e 6b 20 22 ") "") " link "
9d30: 20 72 75 6e 2d 64 69 72 29 0a 09 09 09 20 28 69 run-dir).... (i
9d40: 66 20 28 61 6e 64 20 72 65 61 6c 2d 64 69 72 20 f (and real-dir
9d50: 0a 09 09 09 09 20 20 28 3e 20 28 73 74 72 69 6e ..... (> (strin
9d60: 67 2d 6c 65 6e 67 74 68 20 72 65 61 6c 2d 64 69 g-length real-di
9d70: 72 29 20 35 29 0a 09 09 09 09 20 20 28 66 69 6c r) 5)..... (fil
9d80: 65 2d 65 78 69 73 74 73 3f 20 72 65 61 6c 2d 64 e-exists? real-d
9d90: 69 72 29 29 20 3b 3b 20 62 61 64 20 68 65 75 72 ir)) ;; bad heur
9da0: 69 73 74 69 63 20 62 75 74 20 73 68 6f 75 6c 64 istic but should
9db0: 20 70 72 65 76 65 6e 74 20 2f 74 6d 70 20 2f 68 prevent /tmp /h
9dc0: 6f 6d 65 20 65 74 63 2e 0a 09 09 09 20 20 20 20 ome etc.....
9dd0: 20 28 62 65 67 69 6e 20 3b 3b 20 6c 65 74 2a 20 (begin ;; let*
9de0: 28 28 72 65 61 6c 70 61 74 68 20 28 72 65 73 6f ((realpath (reso
9df0: 6c 76 65 2d 70 61 74 68 6e 61 6d 65 20 72 75 6e lve-pathname run
9e00: 2d 64 69 72 29 29 29 0a 09 09 09 20 20 20 20 20 -dir)))....
9e10: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 2d 69 (debug:print-i
9e20: 6e 66 6f 20 31 20 22 52 65 63 75 72 73 69 76 65 nfo 1 "Recursive
9e30: 6c 79 20 72 65 6d 6f 76 69 6e 67 20 22 20 72 65 ly removing " re
9e40: 61 6c 2d 64 69 72 29 0a 09 09 09 20 20 20 20 20 al-dir)....
9e50: 20 20 28 69 66 20 28 66 69 6c 65 2d 65 78 69 73 (if (file-exis
9e60: 74 73 3f 20 72 65 61 6c 2d 64 69 72 29 0a 09 09 ts? real-dir)...
9e70: 09 09 20 20 20 28 69 66 20 28 3e 20 28 73 79 73 .. (if (> (sys
9e80: 74 65 6d 20 28 63 6f 6e 63 20 22 72 6d 20 2d 72 tem (conc "rm -r
9e90: 66 20 22 20 72 65 61 6c 2d 64 69 72 29 29 20 30 f " real-dir)) 0
9ea0: 29 0a 09 09 09 09 20 20 20 20 20 20 20 28 64 65 )..... (de
9eb0: 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 bug:print 0 "ERR
9ec0: 4f 52 3a 20 54 68 65 72 65 20 77 61 73 20 61 20 OR: There was a
9ed0: 70 72 6f 62 6c 65 6d 20 72 65 6d 6f 76 69 6e 67 problem removing
9ee0: 20 22 20 72 65 61 6c 2d 64 69 72 20 22 20 77 69 " real-dir " wi
9ef0: 74 68 20 72 6d 20 2d 66 22 29 29 0a 09 09 09 09 th rm -f")).....
9f00: 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 (debug:print
9f10: 30 20 22 57 41 52 4e 49 4e 47 3a 20 74 65 73 74 0 "WARNING: test
9f20: 20 64 69 72 20 22 20 72 65 61 6c 2d 64 69 72 20 dir " real-dir
9f30: 22 20 61 70 70 65 61 72 73 20 74 6f 20 6e 6f 74 " appears to not
9f40: 20 65 78 69 73 74 20 6f 72 20 69 73 20 6e 6f 74 exist or is not
9f50: 20 72 65 61 64 61 62 6c 65 22 29 29 29 0a 09 09 readable")))...
9f60: 09 20 20 20 20 20 28 69 66 20 72 65 61 6c 2d 64 . (if real-d
9f70: 69 72 20 0a 09 09 09 09 20 28 64 65 62 75 67 3a ir ..... (debug:
9f80: 70 72 69 6e 74 20 30 20 22 57 41 52 4e 49 4e 47 print 0 "WARNING
9f90: 3a 20 64 69 72 65 63 74 6f 72 79 20 22 20 72 65 : directory " re
9fa0: 61 6c 2d 64 69 72 20 22 20 64 6f 65 73 20 6e 6f al-dir " does no
9fb0: 74 20 65 78 69 73 74 22 29 0a 09 09 09 09 20 28 t exist")..... (
9fc0: 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 57 debug:print 0 "W
9fd0: 41 52 4e 49 4e 47 3a 20 6e 6f 20 72 65 61 6c 20 ARNING: no real
9fe0: 64 69 72 65 63 74 6f 72 79 20 63 6f 72 72 6f 73 directory corros
9ff0: 70 6f 6e 64 69 6e 67 20 74 6f 20 6c 69 6e 6b 20 ponding to link
a000: 22 20 72 75 6e 2d 64 69 72 20 22 2c 20 6e 6f 74 " run-dir ", not
a010: 68 69 6e 67 20 64 6f 6e 65 22 29 29 29 0a 09 09 hing done")))...
a020: 09 20 28 69 66 20 28 73 79 6d 62 6f 6c 69 63 2d . (if (symbolic-
a030: 6c 69 6e 6b 3f 20 72 75 6e 2d 64 69 72 29 0a 09 link? run-dir)..
a040: 09 09 20 20 20 20 20 28 62 65 67 69 6e 0a 09 09 .. (begin...
a050: 09 20 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 . (debug:p
a060: 72 69 6e 74 2d 69 6e 66 6f 20 31 20 22 52 65 6d rint-info 1 "Rem
a070: 6f 76 69 6e 67 20 73 79 6d 6c 69 6e 6b 20 22 20 oving symlink "
a080: 72 75 6e 2d 64 69 72 29 0a 09 09 09 20 20 20 20 run-dir)....
a090: 20 20 20 28 68 61 6e 64 6c 65 2d 65 78 63 65 70 (handle-excep
a0a0: 74 69 6f 6e 73 0a 09 09 09 09 65 78 6e 0a 09 09 tions.....exn...
a0b0: 09 09 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 ..(debug:print 0
a0c0: 20 22 45 52 52 4f 52 3a 20 20 46 61 69 6c 65 64 "ERROR: Failed
a0d0: 20 74 6f 20 72 65 6d 6f 76 65 20 73 79 6d 6c 69 to remove symli
a0e0: 6e 6b 20 22 20 72 75 6e 2d 64 69 72 20 28 28 63 nk " run-dir ((c
a0f0: 6f 6e 64 69 74 69 6f 6e 2d 70 72 6f 70 65 72 74 ondition-propert
a100: 79 2d 61 63 63 65 73 73 6f 72 20 27 65 78 6e 20 y-accessor 'exn
a110: 27 6d 65 73 73 61 67 65 29 20 65 78 6e 29 20 22 'message) exn) "
a120: 2c 20 61 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 , attempting to
a130: 63 6f 6e 74 69 6e 75 65 22 29 0a 09 09 09 09 28 continue").....(
a140: 64 65 6c 65 74 65 2d 66 69 6c 65 20 72 75 6e 2d delete-file run-
a150: 64 69 72 29 29 29 0a 09 09 09 20 20 20 20 20 28 dir))).... (
a160: 69 66 20 28 64 69 72 65 63 74 6f 72 79 3f 20 72 if (directory? r
a170: 75 6e 2d 64 69 72 29 0a 09 09 09 09 20 28 69 66 un-dir)..... (if
a180: 20 28 3e 20 28 64 69 72 65 63 74 6f 72 79 2d 66 (> (directory-f
a190: 6f 6c 64 20 28 6c 61 6d 62 64 61 20 28 66 20 78 old (lambda (f x
a1a0: 29 28 2b 20 31 20 78 29 29 20 30 20 72 75 6e 2d )(+ 1 x)) 0 run-
a1b0: 64 69 72 29 20 30 29 0a 09 09 09 09 20 20 20 20 dir) 0).....
a1c0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 (debug:print 0
a1d0: 22 57 41 52 4e 49 4e 47 3a 20 72 65 66 75 73 69 "WARNING: refusi
a1e0: 6e 67 20 74 6f 20 72 65 6d 6f 76 65 20 22 20 72 ng to remove " r
a1f0: 75 6e 2d 64 69 72 20 22 20 61 73 20 69 74 20 69 un-dir " as it i
a200: 73 20 6e 6f 74 20 65 6d 70 74 79 22 29 0a 09 09 s not empty")...
a210: 09 09 20 20 20 20 20 20 28 68 61 6e 64 6c 65 2d .. (handle-
a220: 65 78 63 65 70 74 69 6f 6e 73 0a 09 09 09 09 20 exceptions.....
a230: 20 20 20 20 20 20 65 78 6e 0a 09 09 09 09 20 20 exn.....
a240: 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e (debug:prin
a250: 74 20 30 20 22 45 52 52 4f 52 3a 20 20 46 61 69 t 0 "ERROR: Fai
a260: 6c 65 64 20 74 6f 20 72 65 6d 6f 76 65 20 64 69 led to remove di
a270: 72 65 63 74 6f 72 79 20 22 20 72 75 6e 2d 64 69 rectory " run-di
a280: 72 20 28 28 63 6f 6e 64 69 74 69 6f 6e 2d 70 72 r ((condition-pr
a290: 6f 70 65 72 74 79 2d 61 63 63 65 73 73 6f 72 20 operty-accessor
a2a0: 27 65 78 6e 20 27 6d 65 73 73 61 67 65 29 20 65 'exn 'message) e
a2b0: 78 6e 29 20 22 2c 20 61 74 74 65 6d 70 74 69 6e xn) ", attemptin
a2c0: 67 20 74 6f 20 63 6f 6e 74 69 6e 75 65 22 29 0a g to continue").
a2d0: 09 09 09 09 20 20 20 20 20 20 20 28 64 65 6c 65 .... (dele
a2e0: 74 65 2d 64 69 72 65 63 74 6f 72 79 20 72 75 6e te-directory run
a2f0: 2d 64 69 72 29 29 29 0a 09 09 09 09 20 28 69 66 -dir)))..... (if
a300: 20 72 75 6e 2d 64 69 72 0a 09 09 09 09 20 20 20 run-dir.....
a310: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 (debug:print 0
a320: 20 22 57 41 52 4e 49 4e 47 3a 20 6e 6f 74 20 72 "WARNING: not r
a330: 65 6d 6f 76 69 6e 67 20 22 20 72 75 6e 2d 64 69 emoving " run-di
a340: 72 20 22 20 61 73 20 69 74 20 65 69 74 68 65 72 r " as it either
a350: 20 64 6f 65 73 6e 27 74 20 65 78 69 73 74 20 6f doesn't exist o
a360: 72 20 69 73 20 6e 6f 74 20 61 20 73 79 6d 6c 69 r is not a symli
a370: 6e 6b 22 29 0a 09 09 09 09 20 20 20 20 20 28 64 nk")..... (d
a380: 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 4e 4f ebug:print 0 "NO
a390: 54 45 3a 20 74 68 65 20 72 75 6e 20 64 69 72 20 TE: the run dir
a3a0: 66 6f 72 20 74 68 69 73 20 74 65 73 74 20 69 73 for this test is
a3b0: 20 75 6e 64 65 66 69 6e 65 64 2e 20 54 65 73 74 undefined. Test
a3c0: 20 6d 61 79 20 68 61 76 65 20 61 6c 72 65 61 64 may have alread
a3d0: 79 20 62 65 65 6e 20 64 65 6c 65 74 65 64 2e 22 y been deleted."
a3e0: 29 29 0a 09 09 09 09 20 29 29 29 0a 09 09 09 28 ))..... )))....(
a3f0: 28 73 65 74 2d 73 74 61 74 65 2d 73 74 61 74 75 (set-state-statu
a400: 73 29 0a 09 09 09 20 28 64 65 62 75 67 3a 70 72 s).... (debug:pr
a410: 69 6e 74 2d 69 6e 66 6f 20 32 20 22 6e 65 77 20 int-info 2 "new
a420: 73 74 61 74 65 20 22 20 28 63 61 72 20 73 74 61 state " (car sta
a430: 74 65 2d 73 74 61 74 75 73 29 20 22 2c 20 6e 65 te-status) ", ne
a440: 77 20 73 74 61 74 75 73 20 22 20 28 63 61 64 72 w status " (cadr
a450: 20 73 74 61 74 65 2d 73 74 61 74 75 73 29 29 0a state-status)).
a460: 09 09 09 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c ... (open-run-cl
a470: 6f 73 65 20 64 62 3a 74 65 73 74 2d 73 65 74 2d ose db:test-set-
a480: 73 74 61 74 65 2d 73 74 61 74 75 73 2d 62 79 2d state-status-by-
a490: 69 64 20 64 62 20 28 64 62 3a 74 65 73 74 2d 67 id db (db:test-g
a4a0: 65 74 2d 69 64 20 74 65 73 74 29 20 28 63 61 72 et-id test) (car
a4b0: 20 73 74 61 74 65 2d 73 74 61 74 75 73 29 28 63 state-status)(c
a4c0: 61 64 72 20 73 74 61 74 65 2d 73 74 61 74 75 73 adr state-status
a4d0: 29 20 23 66 29 29 29 29 29 0a 09 09 20 20 28 73 ) #f)))))... (s
a4e0: 6f 72 74 20 74 65 73 74 73 20 28 6c 61 6d 62 64 ort tests (lambd
a4f0: 61 20 28 61 20 62 29 28 6c 65 74 20 28 28 64 69 a (a b)(let ((di
a500: 72 61 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d ra (db:test-get-
a510: 72 75 6e 64 69 72 20 61 29 29 0a 09 09 09 09 09 rundir a))......
a520: 09 20 28 64 69 72 62 20 28 64 62 3a 74 65 73 74 . (dirb (db:test
a530: 2d 67 65 74 2d 72 75 6e 64 69 72 20 62 29 29 29 -get-rundir b)))
a540: 0a 09 09 09 09 09 20 20 20 20 20 28 69 66 20 28 ...... (if (
a550: 61 6e 64 20 28 73 74 72 69 6e 67 3f 20 64 69 72 and (string? dir
a560: 61 29 28 73 74 72 69 6e 67 3f 20 64 69 72 62 29 a)(string? dirb)
a570: 29 0a 09 09 09 09 09 09 20 28 3e 20 28 73 74 72 )....... (> (str
a580: 69 6e 67 2d 6c 65 6e 67 74 68 20 64 69 72 61 29 ing-length dira)
a590: 28 73 74 72 69 6e 67 2d 6c 65 6e 67 74 68 20 64 (string-length d
a5a0: 69 72 62 29 29 0a 09 09 09 09 09 09 20 23 66 29 irb))....... #f)
a5b0: 29 29 29 29 29 29 0a 09 20 20 20 3b 3b 20 72 65 )))))).. ;; re
a5c0: 6d 6f 76 65 20 74 68 65 20 72 75 6e 20 69 66 20 move the run if
a5d0: 7a 65 72 6f 20 74 65 73 74 73 20 72 65 6d 61 69 zero tests remai
a5e0: 6e 0a 09 20 20 20 28 69 66 20 28 65 71 3f 20 61 n.. (if (eq? a
a5f0: 63 74 69 6f 6e 20 27 72 65 6d 6f 76 65 2d 72 75 ction 'remove-ru
a600: 6e 73 29 0a 09 20 20 20 20 20 20 20 28 6c 65 74 ns).. (let
a610: 20 28 28 72 65 6d 74 65 73 74 73 20 28 6f 70 65 ((remtests (ope
a620: 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 n-run-close db:g
a630: 65 74 2d 74 65 73 74 73 2d 66 6f 72 2d 72 75 6e et-tests-for-run
a640: 20 64 62 20 28 64 62 3a 67 65 74 2d 76 61 6c 75 db (db:get-valu
a650: 65 2d 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 e-by-header run
a660: 68 65 61 64 65 72 20 22 69 64 22 29 20 23 66 20 header "id") #f
a670: 27 28 22 44 45 4c 45 54 45 44 22 29 20 27 28 22 '("DELETED") '("
a680: 6e 2f 61 22 29 20 6e 6f 74 2d 69 6e 3a 20 23 74 n/a") not-in: #t
a690: 29 29 29 0a 09 09 20 28 69 66 20 28 6e 75 6c 6c )))... (if (null
a6a0: 3f 20 72 65 6d 74 65 73 74 73 29 20 3b 3b 20 6e ? remtests) ;; n
a6b0: 6f 20 6d 6f 72 65 20 74 65 73 74 73 20 72 65 6d o more tests rem
a6c0: 61 69 6e 69 6e 67 0a 09 09 20 20 20 20 20 28 6c aining... (l
a6d0: 65 74 2a 20 28 28 64 70 61 72 74 73 20 20 28 73 et* ((dparts (s
a6e0: 74 72 69 6e 67 2d 73 70 6c 69 74 20 6c 61 73 74 tring-split last
a6f0: 74 70 61 74 68 20 22 2f 22 29 29 0a 09 09 09 20 tpath "/"))....
a700: 20 20 20 28 72 75 6e 70 61 74 68 20 28 63 6f 6e (runpath (con
a710: 63 20 22 2f 22 20 28 73 74 72 69 6e 67 2d 69 6e c "/" (string-in
a720: 74 65 72 73 70 65 72 73 65 20 0a 09 09 09 09 09 tersperse ......
a730: 09 28 74 61 6b 65 20 64 70 61 72 74 73 20 28 2d .(take dparts (-
a740: 20 28 6c 65 6e 67 74 68 20 64 70 61 72 74 73 29 (length dparts)
a750: 20 31 29 29 0a 09 09 09 09 09 09 22 2f 22 29 29 1))......."/"))
a760: 29 29 0a 09 09 20 20 20 20 20 20 20 28 64 65 62 ))... (deb
a770: 75 67 3a 70 72 69 6e 74 20 31 20 22 52 65 6d 6f ug:print 1 "Remo
a780: 76 69 6e 67 20 72 75 6e 3a 20 22 20 72 75 6e 6b ving run: " runk
a790: 65 79 20 22 20 22 20 28 64 62 3a 67 65 74 2d 76 ey " " (db:get-v
a7a0: 61 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 20 72 alue-by-header r
a7b0: 75 6e 20 68 65 61 64 65 72 20 22 72 75 6e 6e 61 un header "runna
a7c0: 6d 65 22 29 20 22 20 61 6e 64 20 72 65 6c 61 74 me") " and relat
a7d0: 65 64 20 72 65 63 6f 72 64 22 29 0a 09 09 20 20 ed record")...
a7e0: 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 (open-run-c
a7f0: 6c 6f 73 65 20 64 62 3a 64 65 6c 65 74 65 2d 72 lose db:delete-r
a800: 75 6e 20 64 62 20 72 75 6e 2d 69 64 29 0a 09 09 un db run-id)...
a810: 20 20 20 20 20 20 20 3b 3b 20 54 68 69 73 20 69 ;; This i
a820: 73 20 61 20 70 72 65 74 74 79 20 67 6f 6f 64 20 s a pretty good
a830: 70 6c 61 63 65 20 74 6f 20 70 75 72 67 65 20 6f place to purge o
a840: 6c 64 20 44 45 4c 45 54 45 44 20 74 65 73 74 73 ld DELETED tests
a850: 0a 09 09 20 20 20 20 20 20 20 28 6f 70 65 6e 2d ... (open-
a860: 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 64 65 6c run-close db:del
a870: 65 74 65 2d 74 65 73 74 73 2d 66 6f 72 2d 72 75 ete-tests-for-ru
a880: 6e 20 64 62 20 72 75 6e 2d 69 64 29 0a 09 09 20 n db run-id)...
a890: 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d (open-run-
a8a0: 63 6c 6f 73 65 20 64 62 3a 64 65 6c 65 74 65 2d close db:delete-
a8b0: 6f 6c 64 2d 64 65 6c 65 74 65 64 2d 74 65 73 74 old-deleted-test
a8c0: 2d 72 65 63 6f 72 64 73 20 64 62 29 0a 09 09 20 -records db)...
a8d0: 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d (open-run-
a8e0: 63 6c 6f 73 65 20 64 62 3a 73 65 74 2d 76 61 72 close db:set-var
a8f0: 20 64 62 20 22 44 45 4c 45 54 45 44 5f 54 45 53 db "DELETED_TES
a900: 54 53 22 20 28 63 75 72 72 65 6e 74 2d 73 65 63 TS" (current-sec
a910: 6f 6e 64 73 29 29 0a 09 09 20 20 20 20 20 20 20 onds))...
a920: 3b 3b 20 6e 65 65 64 20 74 6f 20 66 69 67 75 72 ;; need to figur
a930: 65 20 6f 75 74 20 74 68 65 20 70 61 74 68 20 74 e out the path t
a940: 6f 20 74 68 65 20 72 75 6e 20 64 69 72 20 61 6e o the run dir an
a950: 64 20 72 65 6d 6f 76 65 20 69 74 20 69 66 20 65 d remove it if e
a960: 6d 70 74 79 0a 09 09 20 20 20 20 20 20 20 3b 3b mpty... ;;
a970: 20 20 20 20 28 69 66 20 28 6e 75 6c 6c 3f 20 28 (if (null? (
a980: 67 6c 6f 62 20 28 63 6f 6e 63 20 72 75 6e 70 61 glob (conc runpa
a990: 74 68 20 22 2f 2a 22 29 29 29 0a 09 09 20 20 20 th "/*")))...
a9a0: 20 20 20 20 3b 3b 20 20 20 20 20 20 20 20 28 62 ;; (b
a9b0: 65 67 69 6e 0a 09 09 20 20 20 20 20 20 20 3b 3b egin... ;;
a9c0: 20 09 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 . (debug:print
a9d0: 31 20 22 52 65 6d 6f 76 69 6e 67 20 72 75 6e 20 1 "Removing run
a9e0: 64 69 72 20 22 20 72 75 6e 70 61 74 68 29 0a 09 dir " runpath)..
a9f0: 09 20 20 20 20 20 20 20 3b 3b 20 09 20 28 73 79 . ;; . (sy
aa00: 73 74 65 6d 20 28 63 6f 6e 63 20 22 72 6d 64 69 stem (conc "rmdi
aa10: 72 20 2d 70 20 22 20 72 75 6e 70 61 74 68 29 29 r -p " runpath))
aa20: 29 29 0a 09 09 20 20 20 20 20 20 20 29 29 29 29 ))... ))))
aa30: 29 0a 09 20 29 29 0a 20 20 20 20 20 72 75 6e 73 ).. )). runs
aa40: 29 29 0a 20 20 23 74 29 0a 0a 3b 3b 3d 3d 3d 3d )). #t)..;;====
aa50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa60: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa70: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa80: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa90: 3d 3d 0a 3b 3b 20 52 6f 75 74 69 6e 65 73 20 66 ==.;; Routines f
aaa0: 6f 72 20 6d 61 6e 69 70 75 6c 61 74 69 6e 67 20 or manipulating
aab0: 72 75 6e 73 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d runs.;;=========
aac0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aad0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aae0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aaf0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a 3b =============..;
ab00: 3b 20 53 69 6e 63 65 20 6d 61 6e 79 20 63 61 6c ; Since many cal
ab10: 6c 73 20 74 6f 20 61 20 72 75 6e 20 72 65 71 75 ls to a run requ
ab20: 69 72 65 20 70 72 65 74 74 79 20 6d 75 63 68 20 ire pretty much
ab30: 74 68 65 20 73 61 6d 65 20 73 65 74 75 70 20 0a the same setup .
ab40: 3b 3b 20 74 68 69 73 20 77 72 61 70 70 65 72 20 ;; this wrapper
ab50: 69 73 20 75 73 65 64 20 74 6f 20 72 65 64 75 63 is used to reduc
ab60: 65 20 74 68 65 20 72 65 70 6c 69 63 61 74 69 6f e the replicatio
ab70: 6e 20 6f 66 20 63 6f 64 65 0a 28 64 65 66 69 6e n of code.(defin
ab80: 65 20 28 67 65 6e 65 72 61 6c 2d 72 75 6e 2d 63 e (general-run-c
ab90: 61 6c 6c 20 73 77 69 74 63 68 6e 61 6d 65 20 61 all switchname a
aba0: 63 74 69 6f 6e 2d 64 65 73 63 20 70 72 6f 63 29 ction-desc proc)
abb0: 0a 20 20 28 6c 65 74 20 28 28 72 75 6e 6e 61 6d . (let ((runnam
abc0: 65 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 e (args:get-arg
abd0: 22 3a 72 75 6e 6e 61 6d 65 22 29 29 0a 09 28 74 ":runname"))..(t
abe0: 61 72 67 65 74 20 20 28 69 66 20 28 61 72 67 73 arget (if (args
abf0: 3a 67 65 74 2d 61 72 67 20 22 2d 74 61 72 67 65 :get-arg "-targe
ac00: 74 22 29 0a 09 09 20 20 20 20 20 28 61 72 67 73 t")... (args
ac10: 3a 67 65 74 2d 61 72 67 20 22 2d 74 61 72 67 65 :get-arg "-targe
ac20: 74 22 29 0a 09 09 20 20 20 20 20 28 61 72 67 73 t")... (args
ac30: 3a 67 65 74 2d 61 72 67 20 22 2d 72 65 71 74 61 :get-arg "-reqta
ac40: 72 67 22 29 29 29 0a 09 28 74 68 31 20 20 20 20 rg")))..(th1
ac50: 20 23 66 29 29 0a 20 20 20 20 28 63 6f 6e 64 0a #f)). (cond.
ac60: 20 20 20 20 20 28 28 6e 6f 74 20 74 61 72 67 65 ((not targe
ac70: 74 29 0a 20 20 20 20 20 20 28 64 65 62 75 67 3a t). (debug:
ac80: 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a 20 print 0 "ERROR:
ac90: 4d 69 73 73 69 6e 67 20 72 65 71 75 69 72 65 64 Missing required
aca0: 20 70 61 72 61 6d 65 74 65 72 20 66 6f 72 20 22 parameter for "
acb0: 20 73 77 69 74 63 68 6e 61 6d 65 20 22 2c 20 79 switchname ", y
acc0: 6f 75 20 6d 75 73 74 20 73 70 65 63 69 66 79 20 ou must specify
acd0: 74 68 65 20 74 61 72 67 65 74 20 77 69 74 68 20 the target with
ace0: 2d 74 61 72 67 65 74 22 29 0a 20 20 20 20 20 20 -target").
acf0: 28 65 78 69 74 20 33 29 29 0a 20 20 20 20 20 28 (exit 3)). (
ad00: 28 6e 6f 74 20 72 75 6e 6e 61 6d 65 29 0a 20 20 (not runname).
ad10: 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 (debug:print
ad20: 20 30 20 22 45 52 52 4f 52 3a 20 4d 69 73 73 69 0 "ERROR: Missi
ad30: 6e 67 20 72 65 71 75 69 72 65 64 20 70 61 72 61 ng required para
ad40: 6d 65 74 65 72 20 66 6f 72 20 22 20 73 77 69 74 meter for " swit
ad50: 63 68 6e 61 6d 65 20 22 2c 20 79 6f 75 20 6d 75 chname ", you mu
ad60: 73 74 20 73 70 65 63 69 66 79 20 74 68 65 20 72 st specify the r
ad70: 75 6e 20 6e 61 6d 65 20 77 69 74 68 20 3a 72 75 un name with :ru
ad80: 6e 6e 61 6d 65 20 72 75 6e 6e 61 6d 65 22 29 0a nname runname").
ad90: 20 20 20 20 20 20 28 65 78 69 74 20 33 29 29 0a (exit 3)).
ada0: 20 20 20 20 20 28 65 6c 73 65 0a 20 20 20 20 20 (else.
adb0: 20 28 6c 65 74 20 28 28 64 62 20 20 20 23 66 29 (let ((db #f)
adc0: 0a 09 20 20 20 20 28 6b 65 79 73 20 23 66 29 29 .. (keys #f))
add0: 0a 09 28 69 66 20 28 6e 6f 74 20 28 73 65 74 75 ..(if (not (setu
ade0: 70 2d 66 6f 72 2d 72 75 6e 29 29 0a 09 20 20 20 p-for-run))..
adf0: 20 28 62 65 67 69 6e 20 0a 09 20 20 20 20 20 20 (begin ..
ae00: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 (debug:print 0 "
ae10: 46 61 69 6c 65 64 20 74 6f 20 73 65 74 75 70 2c Failed to setup,
ae20: 20 65 78 69 74 69 6e 67 22 29 0a 09 20 20 20 20 exiting")..
ae30: 20 20 28 65 78 69 74 20 31 29 29 29 0a 09 28 69 (exit 1)))..(i
ae40: 66 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 f (args:get-arg
ae50: 22 2d 73 65 72 76 65 72 22 29 0a 09 20 20 20 20 "-server")..
ae60: 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 (open-run-close
ae70: 73 65 72 76 65 72 3a 73 74 61 72 74 20 64 62 20 server:start db
ae80: 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d (args:get-arg "-
ae90: 73 65 72 76 65 72 22 29 29 29 0a 20 09 20 20 20 server"))). .
aea0: 20 3b 3b 20 28 69 66 20 28 6e 6f 74 20 28 6f 72 ;; (if (not (or
aeb0: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
aec0: 2d 72 75 6e 61 6c 6c 22 29 20 20 20 20 20 3b 3b -runall") ;;
aed0: 20 72 75 6e 61 6c 6c 20 61 6e 64 20 72 75 6e 74 runall and runt
aee0: 65 73 74 73 20 61 72 65 20 61 6c 6c 6f 77 65 64 ests are allowed
aef0: 20 74 6f 20 62 65 20 73 65 72 76 65 72 73 0a 20 to be servers.
af00: 09 20 20 20 20 3b 3b 20 20 20 20 20 09 20 28 61 . ;; . (a
af10: 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 72 75 rgs:get-arg "-ru
af20: 6e 74 65 73 74 73 22 29 29 29 0a 09 20 20 20 20 ntests")))..
af30: 3b 3b 20 20 20 20 20 28 63 6c 69 65 6e 74 3a 73 ;; (client:s
af40: 65 74 75 70 29 20 3b 3b 20 54 68 69 73 20 69 73 etup) ;; This is
af50: 20 61 20 64 75 70 6c 69 63 61 74 65 20 73 74 61 a duplicate sta
af60: 72 74 75 70 21 21 21 3f 3f 3f 20 42 55 47 3f 0a rtup!!!??? BUG?.
af70: 09 20 20 20 20 3b 3b 20 20 20 20 20 29 29 0a 09 . ;; ))..
af80: 28 73 65 74 21 20 6b 65 79 73 20 28 6f 70 65 6e (set! keys (open
af90: 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 -run-close db:ge
afa0: 74 2d 6b 65 79 73 20 64 62 29 29 0a 09 3b 3b 20 t-keys db))..;;
afb0: 68 61 76 65 20 65 6e 6f 75 67 68 20 74 6f 20 70 have enough to p
afc0: 72 6f 63 65 73 73 20 2d 74 61 72 67 65 74 20 6f rocess -target o
afd0: 72 20 2d 72 65 71 74 61 72 67 20 68 65 72 65 0a r -reqtarg here.
afe0: 09 28 69 66 20 28 61 72 67 73 3a 67 65 74 2d 61 .(if (args:get-a
aff0: 72 67 20 22 2d 72 65 71 74 61 72 67 22 29 0a 09 rg "-reqtarg")..
b000: 20 20 20 20 28 6c 65 74 2a 20 28 28 72 75 6e 63 (let* ((runc
b010: 6f 6e 66 69 67 66 20 28 63 6f 6e 63 20 20 2a 74 onfigf (conc *t
b020: 6f 70 70 61 74 68 2a 20 22 2f 72 75 6e 63 6f 6e oppath* "/runcon
b030: 66 69 67 73 2e 63 6f 6e 66 69 67 22 29 29 20 3b figs.config")) ;
b040: 3b 20 44 4f 20 4e 4f 54 20 45 56 41 4c 55 41 54 ; DO NOT EVALUAT
b050: 45 20 41 4c 4c 20 0a 09 09 20 20 20 28 72 75 6e E ALL ... (run
b060: 63 6f 6e 66 69 67 20 20 28 72 65 61 64 2d 63 6f config (read-co
b070: 6e 66 69 67 20 72 75 6e 63 6f 6e 66 69 67 66 20 nfig runconfigf
b080: 23 66 20 23 74 20 65 6e 76 69 72 6f 6e 2d 70 61 #f #t environ-pa
b090: 74 74 3a 20 23 66 29 29 29 20 0a 09 20 20 20 20 tt: #f))) ..
b0a0: 20 20 28 69 66 20 28 68 61 73 68 2d 74 61 62 6c (if (hash-tabl
b0b0: 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 72 75 e-ref/default ru
b0c0: 6e 63 6f 6e 66 69 67 20 28 61 72 67 73 3a 67 65 nconfig (args:ge
b0d0: 74 2d 61 72 67 20 22 2d 72 65 71 74 61 72 67 22 t-arg "-reqtarg"
b0e0: 29 20 23 66 29 0a 09 09 20 20 28 6b 65 79 73 3a ) #f)... (keys:
b0f0: 74 61 72 67 65 74 2d 73 65 74 2d 61 72 67 73 20 target-set-args
b100: 6b 65 79 73 20 28 61 72 67 73 3a 67 65 74 2d 61 keys (args:get-a
b110: 72 67 20 22 2d 72 65 71 74 61 72 67 22 29 20 61 rg "-reqtarg") a
b120: 72 67 73 3a 61 72 67 2d 68 61 73 68 29 0a 09 09 rgs:arg-hash)...
b130: 20 20 28 62 65 67 69 6e 0a 09 09 20 20 20 20 28 (begin... (
b140: 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 debug:print 0 "E
b150: 52 52 4f 52 3a 20 5b 22 20 28 61 72 67 73 3a 67 RROR: [" (args:g
b160: 65 74 2d 61 72 67 20 22 2d 72 65 71 74 61 72 67 et-arg "-reqtarg
b170: 22 29 20 22 5d 20 6e 6f 74 20 66 6f 75 6e 64 20 ") "] not found
b180: 69 6e 20 22 20 72 75 6e 63 6f 6e 66 69 67 66 29 in " runconfigf)
b190: 0a 09 09 20 20 20 20 28 69 66 20 64 62 20 28 73 ... (if db (s
b1a0: 71 6c 69 74 65 33 3a 66 69 6e 61 6c 69 7a 65 21 qlite3:finalize!
b1b0: 20 64 62 29 29 0a 09 09 20 20 20 20 28 65 78 69 db))... (exi
b1c0: 74 20 31 29 29 29 29 0a 09 20 20 20 20 28 69 66 t 1)))).. (if
b1d0: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
b1e0: 2d 74 61 72 67 65 74 22 29 0a 09 09 28 6b 65 79 -target")...(key
b1f0: 73 3a 74 61 72 67 65 74 2d 73 65 74 2d 61 72 67 s:target-set-arg
b200: 73 20 6b 65 79 73 20 28 61 72 67 73 3a 67 65 74 s keys (args:get
b210: 2d 61 72 67 20 22 2d 74 61 72 67 65 74 22 20 61 -arg "-target" a
b220: 72 67 73 3a 61 72 67 2d 68 61 73 68 29 20 61 72 rgs:arg-hash) ar
b230: 67 73 3a 61 72 67 2d 68 61 73 68 29 29 29 0a 09 gs:arg-hash)))..
b240: 28 69 66 20 28 6e 6f 74 20 28 63 61 72 20 2a 63 (if (not (car *c
b250: 6f 6e 66 69 67 69 6e 66 6f 2a 29 29 0a 09 20 20 onfiginfo*))..
b260: 20 20 28 62 65 67 69 6e 0a 09 20 20 20 20 20 20 (begin..
b270: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 (debug:print 0 "
b280: 45 52 52 4f 52 3a 20 41 74 74 65 6d 70 74 65 64 ERROR: Attempted
b290: 20 74 6f 20 22 20 61 63 74 69 6f 6e 2d 64 65 73 to " action-des
b2a0: 63 20 22 20 62 75 74 20 72 75 6e 20 61 72 65 61 c " but run area
b2b0: 20 63 6f 6e 66 69 67 20 66 69 6c 65 20 6e 6f 74 config file not
b2c0: 20 66 6f 75 6e 64 22 29 0a 09 20 20 20 20 20 20 found")..
b2d0: 28 65 78 69 74 20 31 29 29 0a 09 20 20 20 20 3b (exit 1)).. ;
b2e0: 3b 20 45 78 74 72 61 63 74 20 6f 75 74 20 73 74 ; Extract out st
b2f0: 75 66 66 20 6e 65 65 64 65 64 20 69 6e 20 6d 6f uff needed in mo
b300: 73 74 20 6f 72 20 6d 61 6e 79 20 63 61 6c 6c 73 st or many calls
b310: 0a 09 20 20 20 20 3b 3b 20 68 65 72 65 20 74 68 .. ;; here th
b320: 65 6e 20 63 61 6c 6c 20 70 72 6f 63 0a 09 20 20 en call proc..
b330: 20 20 28 6c 65 74 2a 20 28 28 6b 65 79 6e 61 6d (let* ((keynam
b340: 65 73 20 20 20 28 6d 61 70 20 6b 65 79 3a 67 65 es (map key:ge
b350: 74 2d 66 69 65 6c 64 6e 61 6d 65 20 6b 65 79 73 t-fieldname keys
b360: 29 29 0a 09 09 20 20 20 28 6b 65 79 76 61 6c 6c ))... (keyvall
b370: 73 74 20 20 28 6b 65 79 73 2d 3e 76 61 6c 6c 69 st (keys->valli
b380: 73 74 20 6b 65 79 73 20 23 74 29 29 29 0a 09 20 st keys #t)))..
b390: 20 20 20 20 20 28 70 72 6f 63 20 74 61 72 67 65 (proc targe
b3a0: 74 20 72 75 6e 6e 61 6d 65 20 6b 65 79 73 20 6b t runname keys k
b3b0: 65 79 6e 61 6d 65 73 20 6b 65 79 76 61 6c 6c 73 eynames keyvalls
b3c0: 74 29 29 29 0a 09 28 69 66 20 74 68 31 20 28 74 t)))..(if th1 (t
b3d0: 68 72 65 61 64 2d 6a 6f 69 6e 21 20 74 68 31 29 hread-join! th1)
b3e0: 29 0a 09 28 69 66 20 64 62 20 28 73 71 6c 69 74 )..(if db (sqlit
b3f0: 65 33 3a 66 69 6e 61 6c 69 7a 65 21 20 64 62 29 e3:finalize! db)
b400: 29 0a 09 28 73 65 74 21 20 2a 64 69 64 73 6f 6d )..(set! *didsom
b410: 65 74 68 69 6e 67 2a 20 23 74 29 29 29 29 29 29 ething* #t))))))
b420: 0a 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ..;;============
b430: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b440: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b450: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b460: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 4c 6f ==========.;; Lo
b470: 63 6b 2f 75 6e 6c 6f 63 6b 20 72 75 6e 73 0a 3b ck/unlock runs.;
b480: 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ;===============
b490: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b4a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b4b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b4c0: 3d 3d 3d 3d 3d 3d 3d 0a 0a 28 64 65 66 69 6e 65 =======..(define
b4d0: 20 28 72 75 6e 73 3a 68 61 6e 64 6c 65 2d 6c 6f (runs:handle-lo
b4e0: 63 6b 69 6e 67 20 74 61 72 67 65 74 20 6b 65 79 cking target key
b4f0: 73 20 72 75 6e 6e 61 6d 65 20 6c 6f 63 6b 20 75 s runname lock u
b500: 6e 6c 6f 63 6b 20 75 73 65 72 29 0a 20 20 28 6c nlock user). (l
b510: 65 74 2a 20 28 28 64 62 20 20 20 20 20 20 20 23 et* ((db #
b520: 66 29 0a 09 20 28 72 75 6e 64 61 74 20 20 20 28 f).. (rundat (
b530: 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 72 open-run-close r
b540: 75 6e 73 3a 67 65 74 2d 72 75 6e 73 2d 62 79 2d uns:get-runs-by-
b550: 70 61 74 74 20 64 62 20 6b 65 79 73 20 72 75 6e patt db keys run
b560: 6e 61 6d 65 29 29 0a 09 20 28 68 65 61 64 65 72 name)).. (header
b570: 20 20 20 28 76 65 63 74 6f 72 2d 72 65 66 20 72 (vector-ref r
b580: 75 6e 64 61 74 20 30 29 29 0a 09 20 28 72 75 6e undat 0)).. (run
b590: 73 20 20 20 20 20 28 76 65 63 74 6f 72 2d 72 65 s (vector-re
b5a0: 66 20 72 75 6e 64 61 74 20 31 29 29 29 0a 20 20 f rundat 1))).
b5b0: 20 20 28 66 6f 72 2d 65 61 63 68 20 28 6c 61 6d (for-each (lam
b5c0: 62 64 61 20 28 72 75 6e 29 0a 09 09 28 6c 65 74 bda (run)...(let
b5d0: 20 28 28 72 75 6e 2d 69 64 20 28 64 62 3a 67 65 ((run-id (db:ge
b5e0: 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 65 t-value-by-heade
b5f0: 72 20 72 75 6e 20 68 65 61 64 65 72 20 22 69 64 r run header "id
b600: 22 29 29 29 0a 09 09 20 20 28 69 66 20 28 6f 72 ")))... (if (or
b610: 20 6c 6f 63 6b 0a 09 09 09 20 20 28 61 6e 64 20 lock.... (and
b620: 75 6e 6c 6f 63 6b 0a 09 09 09 20 20 20 20 20 20 unlock....
b630: 20 28 62 65 67 69 6e 0a 09 09 09 09 20 28 70 72 (begin..... (pr
b640: 69 6e 74 20 22 44 6f 20 79 6f 75 20 72 65 61 6c int "Do you real
b650: 6c 79 20 77 69 73 68 20 74 6f 20 75 6e 6c 6f 63 ly wish to unloc
b660: 6b 20 72 75 6e 20 22 20 72 75 6e 2d 69 64 20 22 k run " run-id "
b670: 3f 5c 6e 20 20 20 79 2f 6e 3a 20 22 29 0a 09 09 ?\n y/n: ")...
b680: 09 09 20 28 65 71 75 61 6c 3f 20 22 79 22 20 28 .. (equal? "y" (
b690: 72 65 61 64 2d 6c 69 6e 65 29 29 29 29 29 0a 09 read-line)))))..
b6a0: 09 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e . (open-run
b6b0: 2d 63 6c 6f 73 65 20 64 62 3a 6c 6f 63 6b 2f 75 -close db:lock/u
b6c0: 6e 6c 6f 63 6b 2d 72 75 6e 20 64 62 20 72 75 6e nlock-run db run
b6d0: 2d 69 64 20 6c 6f 63 6b 20 75 6e 6c 6f 63 6b 20 -id lock unlock
b6e0: 75 73 65 72 29 0a 09 09 20 20 20 20 20 20 28 64 user)... (d
b6f0: 65 62 75 67 3a 70 72 69 6e 74 2d 69 6e 66 6f 20 ebug:print-info
b700: 30 20 22 53 6b 69 70 70 69 6e 67 20 6c 6f 63 6b 0 "Skipping lock
b710: 2f 75 6e 6c 6f 63 6b 20 6f 6e 20 22 20 72 75 6e /unlock on " run
b720: 2d 69 64 29 29 29 29 0a 09 20 20 20 20 20 20 72 -id)))).. r
b730: 75 6e 73 29 29 29 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d uns))).;;=======
b740: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b750: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b760: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b770: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a ===============.
b780: 3b 3b 20 52 6f 6c 6c 75 70 20 72 75 6e 73 0a 3b ;; Rollup runs.;
b790: 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ;===============
b7a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b7b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b7c0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
b7d0: 3d 3d 3d 3d 3d 3d 3d 0a 0a 3b 3b 20 55 70 64 61 =======..;; Upda
b7e0: 74 65 20 74 68 65 20 74 65 73 74 5f 6d 65 74 61 te the test_meta
b7f0: 20 74 61 62 6c 65 20 66 6f 72 20 74 68 69 73 20 table for this
b800: 74 65 73 74 0a 28 64 65 66 69 6e 65 20 28 72 75 test.(define (ru
b810: 6e 73 3a 75 70 64 61 74 65 2d 74 65 73 74 5f 6d ns:update-test_m
b820: 65 74 61 20 64 62 20 74 65 73 74 2d 6e 61 6d 65 eta db test-name
b830: 20 74 65 73 74 2d 63 6f 6e 66 29 0a 20 20 28 6c test-conf). (l
b840: 65 74 20 28 28 63 75 72 72 72 65 63 6f 72 64 20 et ((currrecord
b850: 28 63 64 62 3a 72 65 6d 6f 74 65 2d 72 75 6e 20 (cdb:remote-run
b860: 64 62 3a 74 65 73 74 6d 65 74 61 2d 67 65 74 2d db:testmeta-get-
b870: 72 65 63 6f 72 64 20 64 62 20 74 65 73 74 2d 6e record db test-n
b880: 61 6d 65 29 29 29 0a 20 20 20 20 28 69 66 20 28 ame))). (if (
b890: 6e 6f 74 20 63 75 72 72 72 65 63 6f 72 64 29 0a not currrecord).
b8a0: 09 28 62 65 67 69 6e 0a 09 20 20 28 73 65 74 21 .(begin.. (set!
b8b0: 20 63 75 72 72 72 65 63 6f 72 64 20 28 6d 61 6b currrecord (mak
b8c0: 65 2d 76 65 63 74 6f 72 20 31 30 20 23 66 29 29 e-vector 10 #f))
b8d0: 0a 09 20 20 28 63 64 62 3a 72 65 6d 6f 74 65 2d .. (cdb:remote-
b8e0: 72 75 6e 20 64 62 3a 74 65 73 74 6d 65 74 61 2d run db:testmeta-
b8f0: 61 64 64 2d 72 65 63 6f 72 64 20 64 62 20 74 65 add-record db te
b900: 73 74 2d 6e 61 6d 65 29 29 29 0a 20 20 20 20 28 st-name))). (
b910: 66 6f 72 2d 65 61 63 68 20 0a 20 20 20 20 20 28 for-each . (
b920: 6c 61 6d 62 64 61 20 28 6b 65 79 29 0a 20 20 20 lambda (key).
b930: 20 20 20 20 28 6c 65 74 2a 20 28 28 69 64 78 20 (let* ((idx
b940: 28 63 61 64 72 20 6b 65 79 29 29 0a 09 20 20 20 (cadr key))..
b950: 20 20 20 28 66 6c 64 20 28 63 61 72 20 20 6b 65 (fld (car ke
b960: 79 29 29 0a 09 20 20 20 20 20 20 28 76 61 6c 20 y)).. (val
b970: 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 74 (config-lookup t
b980: 65 73 74 2d 63 6f 6e 66 20 22 74 65 73 74 5f 6d est-conf "test_m
b990: 65 74 61 22 20 66 6c 64 29 29 29 0a 09 20 3b 3b eta" fld))).. ;;
b9a0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 35 20 (debug:print 5
b9b0: 22 69 64 78 3a 20 22 20 69 64 78 20 22 20 66 6c "idx: " idx " fl
b9c0: 64 3a 20 22 20 66 6c 64 20 22 20 76 61 6c 3a 20 d: " fld " val:
b9d0: 22 20 76 61 6c 29 0a 09 20 28 69 66 20 28 61 6e " val).. (if (an
b9e0: 64 20 76 61 6c 20 28 6e 6f 74 20 28 65 71 75 61 d val (not (equa
b9f0: 6c 3f 20 28 76 65 63 74 6f 72 2d 72 65 66 20 63 l? (vector-ref c
ba00: 75 72 72 72 65 63 6f 72 64 20 69 64 78 29 20 76 urrrecord idx) v
ba10: 61 6c 29 29 29 0a 09 20 20 20 20 20 28 62 65 67 al))).. (beg
ba20: 69 6e 0a 09 20 20 20 20 20 20 20 28 70 72 69 6e in.. (prin
ba30: 74 20 22 55 70 64 61 74 69 6e 67 20 22 20 74 65 t "Updating " te
ba40: 73 74 2d 6e 61 6d 65 20 22 20 22 20 66 6c 64 20 st-name " " fld
ba50: 22 20 74 6f 20 22 20 76 61 6c 29 0a 09 20 20 20 " to " val)..
ba60: 20 20 20 20 28 63 64 62 3a 72 65 6d 6f 74 65 2d (cdb:remote-
ba70: 72 75 6e 20 64 62 3a 74 65 73 74 6d 65 74 61 2d run db:testmeta-
ba80: 75 70 64 61 74 65 2d 66 69 65 6c 64 20 64 62 20 update-field db
ba90: 74 65 73 74 2d 6e 61 6d 65 20 66 6c 64 20 76 61 test-name fld va
baa0: 6c 29 29 29 29 29 0a 20 20 20 20 20 27 28 28 22 l))))). '(("
bab0: 61 75 74 68 6f 72 22 20 32 29 28 22 6f 77 6e 65 author" 2)("owne
bac0: 72 22 20 33 29 28 22 64 65 73 63 72 69 70 74 69 r" 3)("descripti
bad0: 6f 6e 22 20 34 29 28 22 72 65 76 69 65 77 65 64 on" 4)("reviewed
bae0: 22 20 35 29 28 22 74 61 67 73 22 20 39 29 29 29 " 5)("tags" 9)))
baf0: 29 29 0a 0a 3b 3b 20 55 70 64 61 74 65 20 74 65 ))..;; Update te
bb00: 73 74 5f 6d 65 74 61 20 66 6f 72 20 61 6c 6c 20 st_meta for all
bb10: 74 65 73 74 73 0a 28 64 65 66 69 6e 65 20 28 72 tests.(define (r
bb20: 75 6e 73 3a 75 70 64 61 74 65 2d 61 6c 6c 2d 74 uns:update-all-t
bb30: 65 73 74 5f 6d 65 74 61 20 64 62 29 0a 20 20 28 est_meta db). (
bb40: 6c 65 74 20 28 28 74 65 73 74 2d 6e 61 6d 65 73 let ((test-names
bb50: 20 28 67 65 74 2d 61 6c 6c 2d 6c 65 67 61 6c 2d (get-all-legal-
bb60: 74 65 73 74 73 29 29 29 0a 20 20 20 20 28 66 6f tests))). (fo
bb70: 72 2d 65 61 63 68 20 0a 20 20 20 20 20 28 6c 61 r-each . (la
bb80: 6d 62 64 61 20 28 74 65 73 74 2d 6e 61 6d 65 29 mbda (test-name)
bb90: 0a 20 20 20 20 20 20 20 28 6c 65 74 2a 20 28 28 . (let* ((
bba0: 74 65 73 74 2d 70 61 74 68 20 20 20 20 28 63 6f test-path (co
bbb0: 6e 63 20 2a 74 6f 70 70 61 74 68 2a 20 22 2f 74 nc *toppath* "/t
bbc0: 65 73 74 73 2f 22 20 74 65 73 74 2d 6e 61 6d 65 ests/" test-name
bbd0: 29 29 0a 09 20 20 20 20 20 20 28 74 65 73 74 2d )).. (test-
bbe0: 63 6f 6e 66 69 67 66 20 28 63 6f 6e 63 20 74 65 configf (conc te
bbf0: 73 74 2d 70 61 74 68 20 22 2f 74 65 73 74 63 6f st-path "/testco
bc00: 6e 66 69 67 22 29 29 0a 09 20 20 20 20 20 20 28 nfig")).. (
bc10: 74 65 73 74 65 78 69 73 74 73 20 20 20 28 61 6e testexists (an
bc20: 64 20 28 66 69 6c 65 2d 65 78 69 73 74 73 3f 20 d (file-exists?
bc30: 74 65 73 74 2d 63 6f 6e 66 69 67 66 29 28 66 69 test-configf)(fi
bc40: 6c 65 2d 72 65 61 64 2d 61 63 63 65 73 73 3f 20 le-read-access?
bc50: 74 65 73 74 2d 63 6f 6e 66 69 67 66 29 29 29 0a test-configf))).
bc60: 09 20 20 20 20 20 20 3b 3b 20 72 65 61 64 20 63 . ;; read c
bc70: 6f 6e 66 69 67 73 20 77 69 74 68 20 74 72 69 63 onfigs with tric
bc80: 6b 73 20 74 75 72 6e 65 64 20 6f 66 66 20 28 69 ks turned off (i
bc90: 2e 65 2e 20 6e 6f 20 73 79 73 74 65 6d 29 0a 09 .e. no system)..
bca0: 20 20 20 20 20 20 28 74 65 73 74 2d 63 6f 6e 66 (test-conf
bcb0: 20 20 20 20 28 69 66 20 74 65 73 74 65 78 69 73 (if testexis
bcc0: 74 73 20 28 72 65 61 64 2d 63 6f 6e 66 69 67 20 ts (read-config
bcd0: 74 65 73 74 2d 63 6f 6e 66 69 67 66 20 23 66 20 test-configf #f
bce0: 23 66 29 28 6d 61 6b 65 2d 68 61 73 68 2d 74 61 #f)(make-hash-ta
bcf0: 62 6c 65 29 29 29 29 0a 09 20 3b 3b 20 75 73 65 ble)))).. ;; use
bd00: 20 74 68 65 20 6f 70 65 6e 2d 72 75 6e 2d 63 6c the open-run-cl
bd10: 6f 73 65 20 69 6e 73 74 65 61 64 20 6f 66 20 70 ose instead of p
bd20: 61 73 73 69 6e 67 20 69 6e 20 64 62 0a 09 20 28 assing in db.. (
bd30: 72 75 6e 73 3a 75 70 64 61 74 65 2d 74 65 73 74 runs:update-test
bd40: 5f 6d 65 74 61 20 23 66 20 74 65 73 74 2d 6e 61 _meta #f test-na
bd50: 6d 65 20 74 65 73 74 2d 63 6f 6e 66 29 29 29 0a me test-conf))).
bd60: 20 20 20 20 20 74 65 73 74 2d 6e 61 6d 65 73 29 test-names)
bd70: 29 29 0a 0a 3b 3b 20 54 68 69 73 20 63 6f 75 6c ))..;; This coul
bd80: 64 20 70 72 6f 62 61 62 6c 79 20 62 65 20 72 65 d probably be re
bd90: 66 61 63 74 6f 72 65 64 20 69 6e 74 6f 20 6f 6e factored into on
bda0: 65 20 63 6f 6d 70 6c 65 78 20 71 75 65 72 79 20 e complex query
bdb0: 2e 2e 2e 0a 28 64 65 66 69 6e 65 20 28 72 75 6e ....(define (run
bdc0: 73 3a 72 6f 6c 6c 75 70 2d 72 75 6e 20 6b 65 79 s:rollup-run key
bdd0: 73 20 6b 65 79 76 61 6c 6c 73 74 20 72 75 6e 6e s keyvallst runn
bde0: 61 6d 65 20 75 73 65 72 29 20 3b 3b 20 77 61 73 ame user) ;; was
bdf0: 20 74 61 72 67 65 74 2c 20 6e 6f 77 20 6b 65 79 target, now key
be00: 76 61 6c 6c 73 74 0a 20 20 28 64 65 62 75 67 3a vallst. (debug:
be10: 70 72 69 6e 74 20 34 20 22 72 75 6e 73 3a 72 6f print 4 "runs:ro
be20: 6c 6c 75 70 2d 72 75 6e 2c 20 6b 65 79 73 3a 20 llup-run, keys:
be30: 22 20 6b 65 79 73 20 22 20 6b 65 79 76 61 6c 6c " keys " keyvall
be40: 73 74 3a 20 22 20 6b 65 79 76 61 6c 6c 73 74 20 st: " keyvallst
be50: 22 20 3a 72 75 6e 6e 61 6d 65 20 22 20 72 75 6e " :runname " run
be60: 6e 61 6d 65 20 22 20 75 73 65 72 3a 20 22 20 75 name " user: " u
be70: 73 65 72 29 0a 20 20 28 6c 65 74 2a 20 28 28 64 ser). (let* ((d
be80: 62 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 b #
be90: 66 29 20 3b 3b 20 28 6b 65 79 76 61 6c 6c 6c 73 f) ;; (keyvallls
bea0: 74 20 20 20 20 20 20 28 6b 65 79 73 3a 74 61 72 t (keys:tar
beb0: 67 65 74 2d 3e 6b 65 79 76 61 6c 20 6b 65 79 73 get->keyval keys
bec0: 20 74 61 72 67 65 74 29 29 0a 09 20 28 6e 65 77 target)).. (new
bed0: 2d 72 75 6e 2d 69 64 20 20 20 20 20 20 28 63 64 -run-id (cd
bee0: 62 3a 72 65 6d 6f 74 65 2d 72 75 6e 20 64 62 3a b:remote-run db:
bef0: 72 65 67 69 73 74 65 72 2d 72 75 6e 20 23 66 20 register-run #f
bf00: 6b 65 79 73 20 6b 65 79 76 61 6c 6c 73 74 20 72 keys keyvallst r
bf10: 75 6e 6e 61 6d 65 20 22 6e 65 77 22 20 22 6e 2f unname "new" "n/
bf20: 61 22 20 75 73 65 72 29 29 0a 09 20 28 70 72 65 a" user)).. (pre
bf30: 76 2d 74 65 73 74 73 20 20 20 20 20 20 28 6f 70 v-tests (op
bf40: 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 74 65 73 en-run-close tes
bf50: 74 3a 67 65 74 2d 6d 61 74 63 68 69 6e 67 2d 70 t:get-matching-p
bf60: 72 65 76 69 6f 75 73 2d 74 65 73 74 2d 72 75 6e revious-test-run
bf70: 2d 72 65 63 6f 72 64 73 20 64 62 20 6e 65 77 2d -records db new-
bf80: 72 75 6e 2d 69 64 20 22 25 22 20 22 25 22 29 29 run-id "%" "%"))
bf90: 0a 09 20 28 63 75 72 72 2d 74 65 73 74 73 20 20 .. (curr-tests
bfa0: 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c (open-run-cl
bfb0: 6f 73 65 20 64 62 3a 67 65 74 2d 74 65 73 74 73 ose db:get-tests
bfc0: 2d 66 6f 72 2d 72 75 6e 20 64 62 20 6e 65 77 2d -for-run db new-
bfd0: 72 75 6e 2d 69 64 20 22 25 2f 25 22 20 27 28 29 run-id "%/%" '()
bfe0: 20 27 28 29 29 29 0a 09 20 28 63 75 72 72 2d 74 '())).. (curr-t
bff0: 65 73 74 73 2d 68 61 73 68 20 28 6d 61 6b 65 2d ests-hash (make-
c000: 68 61 73 68 2d 74 61 62 6c 65 29 29 29 0a 20 20 hash-table))).
c010: 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 (open-run-clos
c020: 65 20 64 62 3a 75 70 64 61 74 65 2d 72 75 6e 2d e db:update-run-
c030: 65 76 65 6e 74 5f 74 69 6d 65 20 64 62 20 6e 65 event_time db ne
c040: 77 2d 72 75 6e 2d 69 64 29 0a 20 20 20 20 3b 3b w-run-id). ;;
c050: 20 69 6e 64 65 78 20 74 68 65 20 61 6c 72 65 61 index the alrea
c060: 64 79 20 73 61 76 65 64 20 74 65 73 74 73 20 62 dy saved tests b
c070: 79 20 74 65 73 74 6e 61 6d 65 20 61 6e 64 20 69 y testname and i
c080: 74 65 6d 64 61 74 20 69 6e 20 63 75 72 72 2d 74 temdat in curr-t
c090: 65 73 74 73 2d 68 61 73 68 0a 20 20 20 20 28 66 ests-hash. (f
c0a0: 6f 72 2d 65 61 63 68 0a 20 20 20 20 20 28 6c 61 or-each. (la
c0b0: 6d 62 64 61 20 28 74 65 73 74 64 61 74 29 0a 20 mbda (testdat).
c0c0: 20 20 20 20 20 20 28 6c 65 74 2a 20 28 28 74 65 (let* ((te
c0d0: 73 74 6e 61 6d 65 20 20 28 64 62 3a 74 65 73 74 stname (db:test
c0e0: 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 74 65 -get-testname te
c0f0: 73 74 64 61 74 29 29 0a 09 20 20 20 20 20 20 28 stdat)).. (
c100: 69 74 65 6d 2d 70 61 74 68 20 28 64 62 3a 74 65 item-path (db:te
c110: 73 74 2d 67 65 74 2d 69 74 65 6d 2d 70 61 74 68 st-get-item-path
c120: 20 74 65 73 74 64 61 74 29 29 0a 09 20 20 20 20 testdat))..
c130: 20 20 28 66 75 6c 6c 2d 6e 61 6d 65 20 28 63 6f (full-name (co
c140: 6e 63 20 74 65 73 74 6e 61 6d 65 20 22 2f 22 20 nc testname "/"
c150: 69 74 65 6d 2d 70 61 74 68 29 29 29 0a 09 20 28 item-path))).. (
c160: 68 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 hash-table-set!
c170: 63 75 72 72 2d 74 65 73 74 73 2d 68 61 73 68 20 curr-tests-hash
c180: 66 75 6c 6c 2d 6e 61 6d 65 20 74 65 73 74 64 61 full-name testda
c190: 74 29 29 29 0a 20 20 20 20 20 63 75 72 72 2d 74 t))). curr-t
c1a0: 65 73 74 73 29 0a 20 20 20 20 3b 3b 20 4e 4f 50 ests). ;; NOP
c1b0: 45 3a 20 4e 6f 6e 2d 6f 70 74 69 6d 61 6c 20 61 E: Non-optimal a
c1c0: 70 70 72 6f 61 63 68 2e 20 54 72 79 20 74 68 69 pproach. Try thi
c1d0: 73 20 69 6e 73 74 65 61 64 2e 0a 20 20 20 20 3b s instead.. ;
c1e0: 3b 20 20 20 31 2e 20 74 65 73 74 73 20 61 72 65 ; 1. tests are
c1f0: 20 72 65 63 65 69 76 65 64 20 69 6e 20 61 20 6c received in a l
c200: 69 73 74 2c 20 6d 6f 73 74 20 72 65 63 65 6e 74 ist, most recent
c210: 20 66 69 72 73 74 0a 20 20 20 20 3b 3b 20 20 20 first. ;;
c220: 32 2e 20 72 65 70 6c 61 63 65 20 74 68 65 20 72 2. replace the r
c230: 6f 6c 6c 75 70 20 74 65 73 74 20 77 69 74 68 20 ollup test with
c240: 74 68 65 20 6e 65 77 20 2a 61 6c 77 61 79 73 2a the new *always*
c250: 0a 20 20 20 20 28 66 6f 72 2d 65 61 63 68 20 0a . (for-each .
c260: 20 20 20 20 20 28 6c 61 6d 62 64 61 20 28 74 65 (lambda (te
c270: 73 74 64 61 74 29 0a 20 20 20 20 20 20 20 28 6c stdat). (l
c280: 65 74 2a 20 28 28 74 65 73 74 6e 61 6d 65 20 20 et* ((testname
c290: 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 74 65 73 (db:test-get-tes
c2a0: 74 6e 61 6d 65 20 74 65 73 74 64 61 74 29 29 0a tname testdat)).
c2b0: 09 20 20 20 20 20 20 28 69 74 65 6d 2d 70 61 74 . (item-pat
c2c0: 68 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 h (db:test-get-i
c2d0: 74 65 6d 2d 70 61 74 68 20 74 65 73 74 64 61 74 tem-path testdat
c2e0: 29 29 0a 09 20 20 20 20 20 20 28 66 75 6c 6c 2d )).. (full-
c2f0: 6e 61 6d 65 20 28 63 6f 6e 63 20 74 65 73 74 6e name (conc testn
c300: 61 6d 65 20 22 2f 22 20 69 74 65 6d 2d 70 61 74 ame "/" item-pat
c310: 68 29 29 0a 09 20 20 20 20 20 20 28 70 72 65 76 h)).. (prev
c320: 2d 74 65 73 74 2d 64 61 74 20 28 68 61 73 68 2d -test-dat (hash-
c330: 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c table-ref/defaul
c340: 74 20 63 75 72 72 2d 74 65 73 74 73 2d 68 61 73 t curr-tests-has
c350: 68 20 66 75 6c 6c 2d 6e 61 6d 65 20 23 66 29 29 h full-name #f))
c360: 0a 09 20 20 20 20 20 20 28 74 65 73 74 2d 73 74 .. (test-st
c370: 65 70 73 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 eps (open-r
c380: 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d un-close db:get-
c390: 73 74 65 70 73 2d 66 6f 72 2d 74 65 73 74 20 64 steps-for-test d
c3a0: 62 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 b (db:test-get-i
c3b0: 64 20 74 65 73 74 64 61 74 29 29 29 0a 09 20 20 d testdat)))..
c3c0: 20 20 20 20 28 6e 65 77 2d 74 65 73 74 2d 72 65 (new-test-re
c3d0: 63 6f 72 64 20 23 66 29 29 0a 09 20 3b 3b 20 72 cord #f)).. ;; r
c3e0: 65 70 6c 61 63 65 20 74 68 65 73 65 20 77 69 74 eplace these wit
c3f0: 68 20 69 6e 73 65 72 74 20 2e 2e 2e 20 73 65 6c h insert ... sel
c400: 65 63 74 0a 09 20 28 61 70 70 6c 79 20 73 71 6c ect.. (apply sql
c410: 69 74 65 33 3a 65 78 65 63 75 74 65 20 0a 09 09 ite3:execute ...
c420: 64 62 20 0a 09 09 28 63 6f 6e 63 20 22 49 4e 53 db ...(conc "INS
c430: 45 52 54 20 4f 52 20 52 45 50 4c 41 43 45 20 49 ERT OR REPLACE I
c440: 4e 54 4f 20 74 65 73 74 73 20 28 72 75 6e 5f 69 NTO tests (run_i
c450: 64 2c 74 65 73 74 6e 61 6d 65 2c 73 74 61 74 65 d,testname,state
c460: 2c 73 74 61 74 75 73 2c 65 76 65 6e 74 5f 74 69 ,status,event_ti
c470: 6d 65 2c 68 6f 73 74 2c 63 70 75 6c 6f 61 64 2c me,host,cpuload,
c480: 64 69 73 6b 66 72 65 65 2c 75 6e 61 6d 65 2c 72 diskfree,uname,r
c490: 75 6e 64 69 72 2c 69 74 65 6d 5f 70 61 74 68 2c undir,item_path,
c4a0: 72 75 6e 5f 64 75 72 61 74 69 6f 6e 2c 66 69 6e run_duration,fin
c4b0: 61 6c 5f 6c 6f 67 66 2c 63 6f 6d 6d 65 6e 74 29 al_logf,comment)
c4c0: 20 22 0a 09 09 20 20 20 20 20 20 22 56 41 4c 55 "... "VALU
c4d0: 45 53 20 28 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c ES (?,?,?,?,?,?,
c4e0: 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 29 ?,?,?,?,?,?,?,?)
c4f0: 3b 22 29 0a 09 09 6e 65 77 2d 72 75 6e 2d 69 64 ;")...new-run-id
c500: 20 28 63 64 64 72 20 28 76 65 63 74 6f 72 2d 3e (cddr (vector->
c510: 6c 69 73 74 20 74 65 73 74 64 61 74 29 29 29 0a list testdat))).
c520: 09 20 28 73 65 74 21 20 6e 65 77 2d 74 65 73 74 . (set! new-test
c530: 64 61 74 20 28 63 61 72 20 28 6f 70 65 6e 2d 72 dat (car (open-r
c540: 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d un-close db:get-
c550: 74 65 73 74 73 2d 66 6f 72 2d 72 75 6e 20 64 62 tests-for-run db
c560: 20 6e 65 77 2d 72 75 6e 2d 69 64 20 28 63 6f 6e new-run-id (con
c570: 63 20 74 65 73 74 6e 61 6d 65 20 22 2f 22 20 69 c testname "/" i
c580: 74 65 6d 2d 70 61 74 68 29 20 27 28 29 20 27 28 tem-path) '() '(
c590: 29 29 29 29 0a 09 20 28 68 61 73 68 2d 74 61 62 )))).. (hash-tab
c5a0: 6c 65 2d 73 65 74 21 20 63 75 72 72 2d 74 65 73 le-set! curr-tes
c5b0: 74 73 2d 68 61 73 68 20 66 75 6c 6c 2d 6e 61 6d ts-hash full-nam
c5c0: 65 20 6e 65 77 2d 74 65 73 74 64 61 74 29 20 3b e new-testdat) ;
c5d0: 3b 20 74 68 69 73 20 63 6f 75 6c 64 20 62 65 20 ; this could be
c5e0: 63 6f 6e 66 75 73 69 6e 67 2c 20 77 68 69 63 68 confusing, which
c5f0: 20 72 65 63 6f 72 64 20 73 68 6f 75 6c 64 20 67 record should g
c600: 6f 20 69 6e 74 6f 20 74 68 65 20 6c 6f 6f 6b 75 o into the looku
c610: 70 20 74 61 62 6c 65 3f 0a 09 20 3b 3b 20 4e 6f p table?.. ;; No
c620: 77 20 64 75 70 6c 69 63 61 74 65 20 74 68 65 20 w duplicate the
c630: 74 65 73 74 20 73 74 65 70 73 0a 09 20 28 64 65 test steps.. (de
c640: 62 75 67 3a 70 72 69 6e 74 20 34 20 22 43 6f 70 bug:print 4 "Cop
c650: 79 69 6e 67 20 72 65 63 6f 72 64 73 20 69 6e 20 ying records in
c660: 74 65 73 74 5f 73 74 65 70 73 20 66 72 6f 6d 20 test_steps from
c670: 74 65 73 74 5f 69 64 3d 22 20 28 64 62 3a 74 65 test_id=" (db:te
c680: 73 74 2d 67 65 74 2d 69 64 20 74 65 73 74 64 61 st-get-id testda
c690: 74 29 20 22 20 74 6f 20 22 20 28 64 62 3a 74 65 t) " to " (db:te
c6a0: 73 74 2d 67 65 74 2d 69 64 20 6e 65 77 2d 74 65 st-get-id new-te
c6b0: 73 74 64 61 74 29 29 0a 09 20 28 6f 70 65 6e 2d stdat)).. (open-
c6c0: 72 75 6e 2d 63 6c 6f 73 65 20 0a 09 20 20 28 6c run-close .. (l
c6d0: 61 6d 62 64 61 20 28 29 0a 09 20 20 20 20 28 73 ambda ().. (s
c6e0: 71 6c 69 74 65 33 3a 65 78 65 63 75 74 65 20 0a qlite3:execute .
c6f0: 09 20 20 20 20 20 64 62 20 0a 09 20 20 20 20 20 . db ..
c700: 28 63 6f 6e 63 20 22 49 4e 53 45 52 54 20 4f 52 (conc "INSERT OR
c710: 20 52 45 50 4c 41 43 45 20 49 4e 54 4f 20 74 65 REPLACE INTO te
c720: 73 74 5f 73 74 65 70 73 20 28 74 65 73 74 5f 69 st_steps (test_i
c730: 64 2c 73 74 65 70 6e 61 6d 65 2c 73 74 61 74 65 d,stepname,state
c740: 2c 73 74 61 74 75 73 2c 65 76 65 6e 74 5f 74 69 ,status,event_ti
c750: 6d 65 2c 63 6f 6d 6d 65 6e 74 29 20 22 0a 09 09 me,comment) "...
c760: 20 20 20 22 53 45 4c 45 43 54 20 22 20 28 64 62 "SELECT " (db
c770: 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 6e 65 77 :test-get-id new
c780: 2d 74 65 73 74 64 61 74 29 20 22 2c 73 74 65 70 -testdat) ",step
c790: 6e 61 6d 65 2c 73 74 61 74 65 2c 73 74 61 74 75 name,state,statu
c7a0: 73 2c 65 76 65 6e 74 5f 74 69 6d 65 2c 63 6f 6d s,event_time,com
c7b0: 6d 65 6e 74 20 46 52 4f 4d 20 74 65 73 74 5f 73 ment FROM test_s
c7c0: 74 65 70 73 20 57 48 45 52 45 20 74 65 73 74 5f teps WHERE test_
c7d0: 69 64 3d 3f 3b 22 29 0a 09 20 20 20 20 20 28 64 id=?;").. (d
c7e0: 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 b:test-get-id te
c7f0: 73 74 64 61 74 29 29 0a 09 20 20 20 20 3b 3b 20 stdat)).. ;;
c800: 4e 6f 77 20 64 75 70 6c 69 63 61 74 65 20 74 68 Now duplicate th
c810: 65 20 74 65 73 74 20 64 61 74 61 0a 09 20 20 20 e test data..
c820: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 (debug:print 4
c830: 22 43 6f 70 79 69 6e 67 20 72 65 63 6f 72 64 73 "Copying records
c840: 20 69 6e 20 74 65 73 74 5f 64 61 74 61 20 66 72 in test_data fr
c850: 6f 6d 20 74 65 73 74 5f 69 64 3d 22 20 28 64 62 om test_id=" (db
c860: 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 73 :test-get-id tes
c870: 74 64 61 74 29 20 22 20 74 6f 20 22 20 28 64 62 tdat) " to " (db
c880: 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 6e 65 77 :test-get-id new
c890: 2d 74 65 73 74 64 61 74 29 29 0a 09 20 20 20 20 -testdat))..
c8a0: 28 73 71 6c 69 74 65 33 3a 65 78 65 63 75 74 65 (sqlite3:execute
c8b0: 20 0a 09 20 20 20 20 20 64 62 20 0a 09 20 20 20 .. db ..
c8c0: 20 20 28 63 6f 6e 63 20 22 49 4e 53 45 52 54 20 (conc "INSERT
c8d0: 4f 52 20 52 45 50 4c 41 43 45 20 49 4e 54 4f 20 OR REPLACE INTO
c8e0: 74 65 73 74 5f 64 61 74 61 20 28 74 65 73 74 5f test_data (test_
c8f0: 69 64 2c 63 61 74 65 67 6f 72 79 2c 76 61 72 69 id,category,vari
c900: 61 62 6c 65 2c 76 61 6c 75 65 2c 65 78 70 65 63 able,value,expec
c910: 74 65 64 2c 74 6f 6c 2c 75 6e 69 74 73 2c 63 6f ted,tol,units,co
c920: 6d 6d 65 6e 74 29 20 22 0a 09 09 20 20 20 22 53 mment) "... "S
c930: 45 4c 45 43 54 20 22 20 28 64 62 3a 74 65 73 74 ELECT " (db:test
c940: 2d 67 65 74 2d 69 64 20 6e 65 77 2d 74 65 73 74 -get-id new-test
c950: 64 61 74 29 20 22 2c 63 61 74 65 67 6f 72 79 2c dat) ",category,
c960: 76 61 72 69 61 62 6c 65 2c 76 61 6c 75 65 2c 65 variable,value,e
c970: 78 70 65 63 74 65 64 2c 74 6f 6c 2c 75 6e 69 74 xpected,tol,unit
c980: 73 2c 63 6f 6d 6d 65 6e 74 20 46 52 4f 4d 20 74 s,comment FROM t
c990: 65 73 74 5f 64 61 74 61 20 57 48 45 52 45 20 74 est_data WHERE t
c9a0: 65 73 74 5f 69 64 3d 3f 3b 22 29 0a 09 20 20 20 est_id=?;")..
c9b0: 20 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 (db:test-get-i
c9c0: 64 20 74 65 73 74 64 61 74 29 29 29 29 0a 09 20 d testdat))))..
c9d0: 29 29 0a 20 20 20 20 20 70 72 65 76 2d 74 65 73 )). prev-tes
c9e0: 74 73 29 29 29 0a 09 20 0a 20 20 20 20 20 0a ts))).. . .