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 31 2c 20 4d 61 74 74 68 65 77 06-2011, 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: 20 2e 20 70 61 72 61 6d 73 29 20 3b 3b 20 74 65 . params) ;; te
0460: 73 74 2d 6e 61 6d 65 29 0a 20 20 28 6c 65 74 2a st-name). (let*
0470: 20 28 28 6b 65 79 76 61 6c 6c 73 74 20 28 6b 65 ((keyvallst (ke
0480: 79 73 2d 3e 76 61 6c 6c 69 73 74 20 6b 65 79 73 ys->vallist keys
0490: 29 29 0a 09 20 28 74 6d 70 20 20 20 20 20 20 28 )).. (tmp (
04a0: 72 75 6e 73 3a 67 65 74 2d 73 74 64 2d 72 75 6e runs:get-std-run
04b0: 2d 66 69 65 6c 64 73 20 6b 65 79 73 20 27 28 22 -fields keys '("
04c0: 69 64 22 20 22 72 75 6e 6e 61 6d 65 22 20 22 73 id" "runname" "s
04d0: 74 61 74 65 22 20 22 73 74 61 74 75 73 22 20 22 tate" "status" "
04e0: 6f 77 6e 65 72 22 20 22 65 76 65 6e 74 5f 74 69 owner" "event_ti
04f0: 6d 65 22 29 29 29 0a 09 20 28 6b 65 79 73 74 72 me"))).. (keystr
0500: 20 20 20 28 63 61 72 20 74 6d 70 29 29 0a 09 20 (car tmp))..
0510: 28 68 65 61 64 65 72 20 20 20 28 63 61 64 72 20 (header (cadr
0520: 74 6d 70 29 29 0a 09 20 28 72 65 73 20 20 20 20 tmp)).. (res
0530: 20 27 28 29 29 0a 09 20 28 6b 65 79 2d 70 61 74 '()).. (key-pat
0540: 74 20 22 22 29 29 0a 20 20 20 20 28 66 6f 72 2d t "")). (for-
0550: 65 61 63 68 20 28 6c 61 6d 62 64 61 20 28 6b 65 each (lambda (ke
0560: 79 76 61 6c 29 0a 09 09 28 6c 65 74 2a 20 28 28 yval)...(let* ((
0570: 6b 65 79 20 20 20 20 28 76 65 63 74 6f 72 2d 72 key (vector-r
0580: 65 66 20 6b 65 79 76 61 6c 20 30 29 29 0a 09 09 ef keyval 0))...
0590: 20 20 20 20 20 20 20 28 66 75 6c 6b 65 79 20 28 (fulkey (
05a0: 63 6f 6e 63 20 22 3a 22 20 6b 65 79 29 29 0a 09 conc ":" key))..
05b0: 09 20 20 20 20 20 20 20 28 70 61 74 74 20 20 20 . (patt
05c0: 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 66 75 (args:get-arg fu
05d0: 6c 6b 65 79 29 29 29 0a 09 09 20 20 28 69 66 20 lkey)))... (if
05e0: 70 61 74 74 0a 09 09 20 20 20 20 20 20 28 73 65 patt... (se
05f0: 74 21 20 6b 65 79 2d 70 61 74 74 20 28 63 6f 6e t! key-patt (con
0600: 63 20 6b 65 79 2d 70 61 74 74 20 22 20 41 4e 44 c key-patt " AND
0610: 20 22 20 6b 65 79 20 22 20 6c 69 6b 65 20 27 22 " key " like '"
0620: 20 70 61 74 74 20 22 27 22 29 29 0a 09 09 20 20 patt "'"))...
0630: 20 20 20 20 28 62 65 67 69 6e 0a 09 09 09 28 64 (begin....(d
0640: 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 ebug:print 0 "ER
0650: 52 4f 52 3a 20 73 65 61 72 63 68 69 6e 67 20 66 ROR: searching f
0660: 6f 72 20 72 75 6e 73 20 77 69 74 68 20 6e 6f 20 or runs with no
0670: 70 61 74 74 65 72 6e 20 73 65 74 20 66 6f 72 20 pattern set for
0680: 22 20 66 75 6c 6b 65 79 29 0a 09 09 09 28 65 78 " fulkey)....(ex
0690: 69 74 20 36 29 29 29 29 29 0a 09 20 20 20 20 20 it 6)))))..
06a0: 20 6b 65 79 73 29 0a 20 20 20 20 28 73 71 6c 69 keys). (sqli
06b0: 74 65 33 3a 66 6f 72 2d 65 61 63 68 2d 72 6f 77 te3:for-each-row
06c0: 20 0a 20 20 20 20 20 28 6c 61 6d 62 64 61 20 28 . (lambda (
06d0: 61 20 2e 20 72 29 0a 20 20 20 20 20 20 20 28 73 a . r). (s
06e0: 65 74 21 20 72 65 73 20 28 63 6f 6e 73 20 28 6c et! res (cons (l
06f0: 69 73 74 2d 3e 76 65 63 74 6f 72 20 28 63 6f 6e ist->vector (con
0700: 73 20 61 20 72 29 29 20 72 65 73 29 29 29 0a 20 s a r)) res))).
0710: 20 20 20 20 64 62 20 0a 20 20 20 20 20 28 63 6f db . (co
0720: 6e 63 20 22 53 45 4c 45 43 54 20 22 20 6b 65 79 nc "SELECT " key
0730: 73 74 72 20 22 20 46 52 4f 4d 20 72 75 6e 73 20 str " FROM runs
0740: 57 48 45 52 45 20 72 75 6e 6e 61 6d 65 20 6c 69 WHERE runname li
0750: 6b 65 20 3f 20 22 20 6b 65 79 2d 70 61 74 74 20 ke ? " key-patt
0760: 22 3b 22 29 0a 20 20 20 20 20 72 75 6e 6e 61 6d ";"). runnam
0770: 65 70 61 74 74 29 0a 20 20 20 20 28 76 65 63 74 epatt). (vect
0780: 6f 72 20 68 65 61 64 65 72 20 72 65 73 29 29 29 or header res)))
0790: 0a 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 3a ..(define (runs:
07a0: 74 65 73 74 2d 67 65 74 2d 66 75 6c 6c 2d 70 61 test-get-full-pa
07b0: 74 68 20 74 65 73 74 29 0a 20 20 28 6c 65 74 2a th test). (let*
07c0: 20 28 28 74 65 73 74 6e 61 6d 65 20 28 64 62 3a ((testname (db:
07d0: 74 65 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d test-get-testnam
07e0: 65 20 20 20 74 65 73 74 29 29 0a 09 20 28 69 74 e test)).. (it
07f0: 65 6d 70 61 74 68 20 28 64 62 3a 74 65 73 74 2d empath (db:test-
0800: 67 65 74 2d 69 74 65 6d 2d 70 61 74 68 20 74 65 get-item-path te
0810: 73 74 29 29 29 0a 20 20 20 20 28 63 6f 6e 63 20 st))). (conc
0820: 74 65 73 74 6e 61 6d 65 20 28 69 66 20 28 65 71 testname (if (eq
0830: 75 61 6c 3f 20 69 74 65 6d 70 61 74 68 20 22 22 ual? itempath ""
0840: 29 20 22 22 20 28 63 6f 6e 63 20 22 28 22 20 69 ) "" (conc "(" i
0850: 74 65 6d 70 61 74 68 20 22 29 22 29 29 29 29 29 tempath ")")))))
0860: 0a 0a 28 64 65 66 69 6e 65 20 28 73 65 74 2d 6d ..(define (set-m
0870: 65 67 61 74 65 73 74 2d 65 6e 76 2d 76 61 72 73 egatest-env-vars
0880: 20 64 62 20 72 75 6e 2d 69 64 29 0a 20 20 28 6c db run-id). (l
0890: 65 74 20 28 28 6b 65 79 73 20 28 64 62 3a 67 65 et ((keys (db:ge
08a0: 74 2d 6b 65 79 73 20 64 62 29 29 29 0a 20 20 20 t-keys db))).
08b0: 20 28 66 6f 72 2d 65 61 63 68 20 28 6c 61 6d 62 (for-each (lamb
08c0: 64 61 20 28 6b 65 79 29 0a 09 09 28 73 71 6c 69 da (key)...(sqli
08d0: 74 65 33 3a 66 6f 72 2d 65 61 63 68 2d 72 6f 77 te3:for-each-row
08e0: 0a 09 09 20 28 6c 61 6d 62 64 61 20 28 76 61 6c ... (lambda (val
08f0: 29 0a 09 09 20 20 20 28 64 65 62 75 67 3a 70 72 )... (debug:pr
0900: 69 6e 74 20 32 20 22 73 65 74 65 6e 76 20 22 20 int 2 "setenv "
0910: 28 6b 65 79 3a 67 65 74 2d 66 69 65 6c 64 6e 61 (key:get-fieldna
0920: 6d 65 20 6b 65 79 29 20 22 20 22 20 76 61 6c 29 me key) " " val)
0930: 0a 09 09 20 20 20 28 73 65 74 65 6e 76 20 28 6b ... (setenv (k
0940: 65 79 3a 67 65 74 2d 66 69 65 6c 64 6e 61 6d 65 ey:get-fieldname
0950: 20 6b 65 79 29 20 76 61 6c 29 29 0a 09 09 20 64 key) val))... d
0960: 62 20 0a 09 09 20 28 63 6f 6e 63 20 22 53 45 4c b ... (conc "SEL
0970: 45 43 54 20 22 20 28 6b 65 79 3a 67 65 74 2d 66 ECT " (key:get-f
0980: 69 65 6c 64 6e 61 6d 65 20 6b 65 79 29 20 22 20 ieldname key) "
0990: 46 52 4f 4d 20 72 75 6e 73 20 57 48 45 52 45 20 FROM runs WHERE
09a0: 69 64 3d 3f 3b 22 29 0a 09 09 20 72 75 6e 2d 69 id=?;")... run-i
09b0: 64 29 29 0a 09 20 20 20 20 20 20 6b 65 79 73 29 d)).. keys)
09c0: 0a 20 20 20 20 28 61 6c 69 73 74 2d 3e 65 6e 76 . (alist->env
09d0: 2d 76 61 72 73 20 28 68 61 73 68 2d 74 61 62 6c -vars (hash-tabl
09e0: 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 2a 63 e-ref/default *c
09f0: 6f 6e 66 69 67 64 61 74 2a 20 22 65 6e 76 2d 6f onfigdat* "env-o
0a00: 76 65 72 72 69 64 65 22 20 27 28 29 29 29 0a 20 verride" '())).
0a10: 20 20 20 3b 3b 20 4c 65 74 73 20 75 73 65 20 74 ;; Lets use t
0a20: 68 69 73 20 61 73 20 61 6e 20 6f 70 70 6f 72 74 his as an opport
0a30: 75 6e 69 74 79 20 74 6f 20 70 75 74 20 4d 54 5f unity to put MT_
0a40: 52 55 4e 4e 41 4d 45 20 69 6e 20 74 68 65 20 65 RUNNAME in the e
0a50: 6e 76 69 72 6f 6e 6d 65 6e 74 0a 20 20 20 20 28 nvironment. (
0a60: 73 71 6c 69 74 65 33 3a 66 6f 72 2d 65 61 63 68 sqlite3:for-each
0a70: 2d 72 6f 77 0a 20 20 20 20 20 28 6c 61 6d 62 64 -row. (lambd
0a80: 61 20 28 72 75 6e 6e 61 6d 65 29 0a 20 20 20 20 a (runname).
0a90: 20 20 20 28 73 65 74 65 6e 76 20 22 4d 54 5f 52 (setenv "MT_R
0aa0: 55 4e 4e 41 4d 45 22 20 72 75 6e 6e 61 6d 65 29 UNNAME" runname)
0ab0: 29 0a 20 20 20 20 20 64 62 0a 20 20 20 20 20 22 ). db. "
0ac0: 53 45 4c 45 43 54 20 72 75 6e 6e 61 6d 65 20 46 SELECT runname F
0ad0: 52 4f 4d 20 72 75 6e 73 20 57 48 45 52 45 20 69 ROM runs WHERE i
0ae0: 64 3d 3f 3b 22 0a 20 20 20 20 20 72 75 6e 2d 69 d=?;". run-i
0af0: 64 29 0a 20 20 20 20 29 29 0a 0a 28 64 65 66 69 d). ))..(defi
0b00: 6e 65 20 28 73 65 74 2d 69 74 65 6d 2d 65 6e 76 ne (set-item-env
0b10: 2d 76 61 72 73 20 69 74 65 6d 64 61 74 29 0a 20 -vars itemdat).
0b20: 20 28 66 6f 72 2d 65 61 63 68 20 28 6c 61 6d 62 (for-each (lamb
0b30: 64 61 20 28 69 74 65 6d 29 0a 09 20 20 20 20 20 da (item)..
0b40: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 32 20 (debug:print 2
0b50: 22 73 65 74 65 6e 76 20 22 20 28 63 61 72 20 69 "setenv " (car i
0b60: 74 65 6d 29 20 22 20 22 20 28 63 61 64 72 20 69 tem) " " (cadr i
0b70: 74 65 6d 29 29 0a 09 20 20 20 20 20 20 28 73 65 tem)).. (se
0b80: 74 65 6e 76 20 28 63 61 72 20 69 74 65 6d 29 20 tenv (car item)
0b90: 28 63 61 64 72 20 69 74 65 6d 29 29 29 0a 09 20 (cadr item)))..
0ba0: 20 20 20 69 74 65 6d 64 61 74 29 29 0a 0a 28 64 itemdat))..(d
0bb0: 65 66 69 6e 65 20 28 72 75 6e 73 3a 63 61 6e 2d efine (runs:can-
0bc0: 72 75 6e 2d 6d 6f 72 65 2d 74 65 73 74 73 20 64 run-more-tests d
0bd0: 62 20 74 65 73 74 2d 72 65 63 6f 72 64 29 0a 20 b test-record).
0be0: 20 28 6c 65 74 2a 20 28 28 74 63 6f 6e 66 69 67 (let* ((tconfig
0bf0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0c00: 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 (tests:testqueu
0c10: 65 2d 67 65 74 2d 74 65 73 74 63 6f 6e 66 69 67 e-get-testconfig
0c20: 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 test-record))..
0c30: 20 28 6a 6f 62 67 72 6f 75 70 20 20 20 20 20 20 (jobgroup
0c40: 20 20 20 20 20 20 20 20 20 20 28 63 6f 6e 66 69 (confi
0c50: 67 2d 6c 6f 6f 6b 75 70 20 74 63 6f 6e 66 69 67 g-lookup tconfig
0c60: 20 22 72 65 71 75 69 72 65 6d 65 6e 74 73 22 20 "requirements"
0c70: 22 6a 6f 62 67 72 6f 75 70 22 29 29 0a 09 20 28 "jobgroup")).. (
0c80: 6e 75 6d 2d 72 75 6e 6e 69 6e 67 20 20 20 20 20 num-running
0c90: 20 20 20 20 20 20 20 20 28 64 62 3a 67 65 74 2d (db:get-
0ca0: 63 6f 75 6e 74 2d 74 65 73 74 73 2d 72 75 6e 6e count-tests-runn
0cb0: 69 6e 67 20 64 62 29 29 0a 09 20 28 6e 75 6d 2d ing db)).. (num-
0cc0: 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a 6f 62 67 72 running-in-jobgr
0cd0: 6f 75 70 20 28 64 62 3a 67 65 74 2d 63 6f 75 6e oup (db:get-coun
0ce0: 74 2d 74 65 73 74 73 2d 72 75 6e 6e 69 6e 67 2d t-tests-running-
0cf0: 69 6e 2d 6a 6f 62 67 72 6f 75 70 20 64 62 20 6a in-jobgroup db j
0d00: 6f 62 67 72 6f 75 70 29 29 0a 09 20 28 6d 61 78 obgroup)).. (max
0d10: 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 -concurrent-jobs
0d20: 20 20 20 20 20 28 63 6f 6e 66 69 67 2d 6c 6f 6f (config-loo
0d30: 6b 75 70 20 2a 63 6f 6e 66 69 67 64 61 74 2a 20 kup *configdat*
0d40: 22 73 65 74 75 70 22 20 20 20 20 20 22 6d 61 78 "setup" "max
0d50: 5f 63 6f 6e 63 75 72 72 65 6e 74 5f 6a 6f 62 73 _concurrent_jobs
0d60: 22 29 29 0a 09 20 28 6a 6f 62 2d 67 72 6f 75 70 ")).. (job-group
0d70: 2d 6c 69 6d 69 74 20 20 20 20 20 20 20 20 20 28 -limit (
0d80: 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 2a 63 config-lookup *c
0d90: 6f 6e 66 69 67 64 61 74 2a 20 22 6a 6f 62 67 72 onfigdat* "jobgr
0da0: 6f 75 70 73 22 20 6a 6f 62 67 72 6f 75 70 29 29 oups" jobgroup))
0db0: 29 0a 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 ). (debug:pri
0dc0: 6e 74 20 32 20 22 6d 61 78 2d 63 6f 6e 63 75 72 nt 2 "max-concur
0dd0: 72 65 6e 74 2d 6a 6f 62 73 3a 20 22 20 6d 61 78 rent-jobs: " max
0de0: 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 -concurrent-jobs
0df0: 20 22 2c 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 3a ", num-running:
0e00: 20 22 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 29 0a " num-running).
0e10: 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 65 71 (if (not (eq
0e20: 3f 20 30 20 2a 67 6c 6f 62 61 6c 65 78 69 74 73 ? 0 *globalexits
0e30: 74 61 74 75 73 2a 29 29 0a 09 23 66 0a 09 28 6c tatus*))..#f..(l
0e40: 65 74 20 28 28 63 61 6e 2d 6e 6f 74 2d 72 75 6e et ((can-not-run
0e50: 2d 6d 6f 72 65 20 28 63 6f 6e 64 0a 09 09 09 09 -more (cond.....
0e60: 20 3b 3b 20 69 66 20 6d 61 78 2d 63 6f 6e 63 75 ;; if max-concu
0e70: 72 72 65 6e 74 2d 6a 6f 62 73 20 69 73 20 73 65 rrent-jobs is se
0e80: 74 20 61 6e 64 20 74 68 65 20 6e 75 6d 62 65 72 t and the number
0e90: 20 72 75 6e 6e 69 6e 67 20 69 73 20 67 72 65 61 running is grea
0ea0: 74 65 72 20 0a 09 09 09 09 20 3b 3b 20 74 68 61 ter ..... ;; tha
0eb0: 6e 20 69 74 20 74 68 61 6e 20 63 61 6e 6e 6f 74 n it than cannot
0ec0: 20 72 75 6e 20 6d 6f 72 65 20 6a 6f 62 73 0a 09 run more jobs..
0ed0: 09 09 09 20 28 28 61 6e 64 20 6d 61 78 2d 63 6f ... ((and max-co
0ee0: 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 0a 09 09 ncurrent-jobs...
0ef0: 09 09 20 20 20 20 20 20 20 28 73 74 72 69 6e 67 .. (string
0f00: 2d 3e 6e 75 6d 62 65 72 20 6d 61 78 2d 63 6f 6e ->number max-con
0f10: 63 75 72 72 65 6e 74 2d 6a 6f 62 73 29 0a 09 09 current-jobs)...
0f20: 09 09 20 20 20 20 20 20 20 28 3e 3d 20 6e 75 6d .. (>= num
0f30: 2d 72 75 6e 6e 69 6e 67 20 28 73 74 72 69 6e 67 -running (string
0f40: 2d 3e 6e 75 6d 62 65 72 20 6d 61 78 2d 63 6f 6e ->number max-con
0f50: 63 75 72 72 65 6e 74 2d 6a 6f 62 73 29 29 29 0a current-jobs))).
0f60: 09 09 09 09 20 20 28 64 65 62 75 67 3a 70 72 69 .... (debug:pri
0f70: 6e 74 20 30 20 22 57 41 52 4e 49 4e 47 3a 20 4d nt 0 "WARNING: M
0f80: 61 78 20 72 75 6e 6e 69 6e 67 20 6a 6f 62 73 20 ax running jobs
0f90: 65 78 63 65 65 64 65 64 2c 20 63 75 72 72 65 6e exceeded, curren
0fa0: 74 20 6e 75 6d 62 65 72 20 72 75 6e 6e 69 6e 67 t number running
0fb0: 3a 20 22 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 20 : " num-running
0fc0: 0a 09 09 09 09 09 20 20 20 20 20 20 20 22 2c 20 ...... ",
0fd0: 6d 61 78 5f 63 6f 6e 63 75 72 72 65 6e 74 5f 6a max_concurrent_j
0fe0: 6f 62 73 3a 20 22 20 6d 61 78 2d 63 6f 6e 63 75 obs: " max-concu
0ff0: 72 72 65 6e 74 2d 6a 6f 62 73 29 0a 09 09 09 09 rrent-jobs).....
1000: 20 20 23 74 29 0a 09 09 09 09 20 3b 3b 20 69 66 #t)..... ;; if
1010: 20 6a 6f 62 2d 67 72 6f 75 70 2d 6c 69 6d 69 74 job-group-limit
1020: 20 69 73 20 73 65 74 20 61 6e 64 20 6e 75 6d 62 is set and numb
1030: 65 72 20 6f 66 20 6a 6f 62 73 20 69 6e 20 74 68 er of jobs in th
1040: 65 20 67 72 6f 75 70 20 69 73 20 67 72 65 61 74 e group is great
1050: 65 72 0a 09 09 09 09 20 3b 3b 20 74 68 61 6e 20 er..... ;; than
1060: 74 68 65 20 6c 69 6d 69 74 20 74 68 65 6e 20 63 the limit then c
1070: 61 6e 6e 6f 74 20 72 75 6e 20 6d 6f 72 65 20 6a annot run more j
1080: 6f 62 73 20 6f 66 20 74 68 69 73 20 6b 69 6e 64 obs of this kind
1090: 0a 09 09 09 09 20 28 28 61 6e 64 20 6a 6f 62 2d ..... ((and job-
10a0: 67 72 6f 75 70 2d 6c 69 6d 69 74 0a 09 09 09 09 group-limit.....
10b0: 20 20 20 20 20 20 20 28 3e 3d 20 6e 75 6d 2d 72 (>= num-r
10c0: 75 6e 6e 69 6e 67 2d 69 6e 2d 6a 6f 62 67 72 6f unning-in-jobgro
10d0: 75 70 20 6a 6f 62 2d 67 72 6f 75 70 2d 6c 69 6d up job-group-lim
10e0: 69 74 29 29 0a 09 09 09 09 20 20 28 64 65 62 75 it))..... (debu
10f0: 67 3a 70 72 69 6e 74 20 31 20 22 57 41 52 4e 49 g:print 1 "WARNI
1100: 4e 47 3a 20 6e 75 6d 62 65 72 20 6f 66 20 6a 6f NG: number of jo
1110: 62 73 20 22 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 bs " num-running
1120: 2d 69 6e 2d 6a 6f 62 67 72 6f 75 70 20 0a 09 09 -in-jobgroup ...
1130: 09 09 09 20 20 20 20 20 20 20 22 20 69 6e 20 22 ... " in "
1140: 20 6a 6f 62 67 72 6f 75 70 20 22 20 65 78 63 65 jobgroup " exce
1150: 65 64 65 64 2c 20 77 69 6c 6c 20 6e 6f 74 20 72 eded, will not r
1160: 75 6e 20 22 20 28 74 65 73 74 73 3a 74 65 73 74 un " (tests:test
1170: 71 75 65 75 65 2d 67 65 74 2d 74 65 73 74 6e 61 queue-get-testna
1180: 6d 65 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 me test-record))
1190: 0a 09 09 09 09 20 20 23 74 29 0a 09 09 09 09 20 ..... #t).....
11a0: 28 65 6c 73 65 20 23 66 29 29 29 29 0a 09 20 20 (else #f))))..
11b0: 28 6e 6f 74 20 63 61 6e 2d 6e 6f 74 2d 72 75 6e (not can-not-run
11c0: 2d 6d 6f 72 65 29 29 29 29 29 0a 0a 3b 3b 3d 3d -more)))))..;;==
11d0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
11e0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
11f0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1200: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1210: 3d 3d 3d 3d 0a 3b 3b 20 4e 65 77 20 6d 65 74 68 ====.;; New meth
1220: 6f 64 6f 6c 6f 67 79 2e 20 54 68 65 73 65 20 72 odology. These r
1230: 6f 75 74 69 6e 65 73 20 77 69 6c 6c 20 72 65 70 outines will rep
1240: 6c 61 63 65 20 74 68 65 20 61 62 6f 76 65 20 69 lace the above i
1250: 6e 20 74 69 6d 65 2e 20 46 6f 72 0a 3b 3b 20 6e n time. For.;; n
1260: 6f 77 20 74 68 65 20 63 6f 64 65 20 69 73 20 64 ow the code is d
1270: 75 70 6c 69 63 61 74 65 64 2e 20 54 68 69 73 20 uplicated. This
1280: 73 74 75 66 66 20 69 73 20 69 6e 69 74 69 61 6c stuff is initial
1290: 6c 79 20 75 73 65 64 20 69 6e 20 74 68 65 20 6d ly used in the m
12a0: 6f 6e 69 74 6f 72 0a 3b 3b 20 62 61 73 65 64 20 onitor.;; based
12b0: 63 6f 64 65 2e 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d code..;;========
12c0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
12d0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
12e0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
12f0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a ==============..
1300: 3b 3b 20 72 65 67 69 73 74 65 72 20 61 20 74 65 ;; register a te
1310: 73 74 20 72 75 6e 20 77 69 74 68 20 74 68 65 20 st run with the
1320: 64 62 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 db.(define (runs
1330: 3a 72 65 67 69 73 74 65 72 2d 72 75 6e 20 64 62 :register-run db
1340: 20 6b 65 79 73 20 6b 65 79 76 61 6c 6c 73 74 20 keys keyvallst
1350: 72 75 6e 6e 61 6d 65 20 73 74 61 74 65 20 73 74 runname state st
1360: 61 74 75 73 20 75 73 65 72 29 0a 20 20 28 64 65 atus user). (de
1370: 62 75 67 3a 70 72 69 6e 74 20 33 20 22 72 75 6e bug:print 3 "run
1380: 73 3a 72 65 67 69 73 74 65 72 2d 72 75 6e 2c 20 s:register-run,
1390: 6b 65 79 73 3a 20 22 20 6b 65 79 73 20 22 20 6b keys: " keys " k
13a0: 65 79 76 61 6c 6c 73 74 3a 20 22 20 6b 65 79 76 eyvallst: " keyv
13b0: 61 6c 6c 73 74 20 22 20 72 75 6e 6e 61 6d 65 3a allst " runname:
13c0: 20 22 20 72 75 6e 6e 61 6d 65 20 22 20 73 74 61 " runname " sta
13d0: 74 65 3a 20 22 20 73 74 61 74 65 20 22 20 73 74 te: " state " st
13e0: 61 74 75 73 3a 20 22 20 73 74 61 74 75 73 20 22 atus: " status "
13f0: 20 75 73 65 72 3a 20 22 20 75 73 65 72 29 0a 20 user: " user).
1400: 20 28 6c 65 74 2a 20 28 28 6b 65 79 73 74 72 20 (let* ((keystr
1410: 20 20 20 28 6b 65 79 73 2d 3e 6b 65 79 73 74 72 (keys->keystr
1420: 20 6b 65 79 73 29 29 0a 09 20 28 63 6f 6d 6d 61 keys)).. (comma
1430: 20 20 20 20 20 28 69 66 20 28 3e 20 28 6c 65 6e (if (> (len
1440: 67 74 68 20 6b 65 79 73 29 20 30 29 20 22 2c 22 gth keys) 0) ","
1450: 20 22 22 29 29 0a 09 20 28 61 6e 64 73 74 72 20 "")).. (andstr
1460: 20 20 20 28 69 66 20 28 3e 20 28 6c 65 6e 67 74 (if (> (lengt
1470: 68 20 6b 65 79 73 29 20 30 29 20 22 20 41 4e 44 h keys) 0) " AND
1480: 20 22 20 22 22 29 29 0a 09 20 28 76 61 6c 73 6c " "")).. (valsl
1490: 6f 74 73 20 20 28 6b 65 79 73 2d 3e 76 61 6c 73 ots (keys->vals
14a0: 6c 6f 74 73 20 6b 65 79 73 29 29 20 3b 3b 20 3f lots keys)) ;; ?
14b0: 2c 3f 2c 3f 20 2e 2e 2e 0a 09 20 28 6b 65 79 76 ,?,? ..... (keyv
14c0: 61 6c 73 20 20 20 28 6d 61 70 20 63 61 64 72 20 als (map cadr
14d0: 6b 65 79 76 61 6c 6c 73 74 29 29 0a 09 20 28 61 keyvallst)).. (a
14e0: 6c 6c 76 61 6c 73 20 20 20 28 61 70 70 65 6e 64 llvals (append
14f0: 20 28 6c 69 73 74 20 72 75 6e 6e 61 6d 65 20 73 (list runname s
1500: 74 61 74 65 20 73 74 61 74 75 73 20 75 73 65 72 tate status user
1510: 29 20 6b 65 79 76 61 6c 73 29 29 0a 09 20 28 71 ) keyvals)).. (q
1520: 72 79 76 61 6c 73 20 20 20 28 61 70 70 65 6e 64 ryvals (append
1530: 20 28 6c 69 73 74 20 72 75 6e 6e 61 6d 65 29 20 (list runname)
1540: 6b 65 79 76 61 6c 73 29 29 0a 09 20 28 6b 65 79 keyvals)).. (key
1550: 3d 3f 73 74 72 20 20 28 73 74 72 69 6e 67 2d 69 =?str (string-i
1560: 6e 74 65 72 73 70 65 72 73 65 20 28 6d 61 70 20 ntersperse (map
1570: 28 6c 61 6d 62 64 61 20 28 6b 29 28 63 6f 6e 63 (lambda (k)(conc
1580: 20 28 6b 65 79 3a 67 65 74 2d 66 69 65 6c 64 6e (key:get-fieldn
1590: 61 6d 65 20 6b 29 20 22 3d 3f 22 29 29 20 6b 65 ame k) "=?")) ke
15a0: 79 73 29 20 22 20 41 4e 44 20 22 29 29 29 0a 20 ys) " AND "))).
15b0: 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 (debug:print
15c0: 33 20 22 6b 65 79 73 3a 20 22 20 6b 65 79 73 20 3 "keys: " keys
15d0: 22 20 61 6c 6c 76 61 6c 73 3a 20 22 20 61 6c 6c " allvals: " all
15e0: 76 61 6c 73 20 22 20 6b 65 79 76 61 6c 73 3a 20 vals " keyvals:
15f0: 22 20 6b 65 79 76 61 6c 73 29 0a 20 20 20 20 28 " keyvals). (
1600: 64 65 62 75 67 3a 70 72 69 6e 74 20 32 20 22 4e debug:print 2 "N
1610: 4f 54 45 3a 20 75 73 69 6e 67 20 74 61 72 67 65 OTE: using targe
1620: 74 20 22 20 28 73 74 72 69 6e 67 2d 69 6e 74 65 t " (string-inte
1630: 72 73 70 65 72 73 65 20 6b 65 79 76 61 6c 73 20 rsperse keyvals
1640: 22 2f 22 29 20 22 20 66 6f 72 20 74 68 69 73 20 "/") " for this
1650: 72 75 6e 22 29 0a 20 20 20 20 28 69 66 20 28 61 run"). (if (a
1660: 6e 64 20 72 75 6e 6e 61 6d 65 20 28 6e 75 6c 6c nd runname (null
1670: 3f 20 28 66 69 6c 74 65 72 20 28 6c 61 6d 62 64 ? (filter (lambd
1680: 61 20 28 78 29 28 6e 6f 74 20 78 29 29 20 6b 65 a (x)(not x)) ke
1690: 79 76 61 6c 73 29 29 29 20 3b 3b 20 74 68 65 72 yvals))) ;; ther
16a0: 65 20 6d 75 73 74 20 62 65 20 61 20 62 65 74 74 e must be a bett
16b0: 65 72 20 77 61 79 20 74 6f 20 22 61 70 70 6c 79 er way to "apply
16c0: 20 61 6e 64 22 0a 09 28 6c 65 74 20 28 28 72 65 and"..(let ((re
16d0: 73 20 23 66 29 29 0a 09 20 20 28 61 70 70 6c 79 s #f)).. (apply
16e0: 20 73 71 6c 69 74 65 33 3a 65 78 65 63 75 74 65 sqlite3:execute
16f0: 20 64 62 20 28 63 6f 6e 63 20 22 49 4e 53 45 52 db (conc "INSER
1700: 54 20 4f 52 20 49 47 4e 4f 52 45 20 49 4e 54 4f T OR IGNORE INTO
1710: 20 72 75 6e 73 20 28 72 75 6e 6e 61 6d 65 2c 73 runs (runname,s
1720: 74 61 74 65 2c 73 74 61 74 75 73 2c 6f 77 6e 65 tate,status,owne
1730: 72 2c 65 76 65 6e 74 5f 74 69 6d 65 22 20 63 6f r,event_time" co
1740: 6d 6d 61 20 6b 65 79 73 74 72 20 22 29 20 56 41 mma keystr ") VA
1750: 4c 55 45 53 20 28 3f 2c 3f 2c 3f 2c 3f 2c 73 74 LUES (?,?,?,?,st
1760: 72 66 74 69 6d 65 28 27 25 73 27 2c 27 6e 6f 77 rftime('%s','now
1770: 27 29 22 20 63 6f 6d 6d 61 20 76 61 6c 73 6c 6f ')" comma valslo
1780: 74 73 20 22 29 3b 22 29 0a 09 09 20 61 6c 6c 76 ts ");")... allv
1790: 61 6c 73 29 0a 09 20 20 28 61 70 70 6c 79 20 73 als).. (apply s
17a0: 71 6c 69 74 65 33 3a 66 6f 72 2d 65 61 63 68 2d qlite3:for-each-
17b0: 72 6f 77 20 0a 09 20 20 20 28 6c 61 6d 62 64 61 row .. (lambda
17c0: 20 28 69 64 29 0a 09 20 20 20 20 20 28 73 65 74 (id).. (set
17d0: 21 20 72 65 73 20 69 64 29 29 0a 09 20 20 20 64 ! res id)).. d
17e0: 62 0a 09 20 20 20 28 6c 65 74 20 28 28 71 72 79 b.. (let ((qry
17f0: 20 28 63 6f 6e 63 20 22 53 45 4c 45 43 54 20 69 (conc "SELECT i
1800: 64 20 46 52 4f 4d 20 72 75 6e 73 20 57 48 45 52 d FROM runs WHER
1810: 45 20 28 72 75 6e 6e 61 6d 65 3d 3f 20 22 20 61 E (runname=? " a
1820: 6e 64 73 74 72 20 6b 65 79 3d 3f 73 74 72 20 22 ndstr key=?str "
1830: 29 3b 22 29 29 29 0a 09 20 20 20 20 20 3b 28 64 );"))).. ;(d
1840: 65 62 75 67 3a 70 72 69 6e 74 20 34 20 22 71 72 ebug:print 4 "qr
1850: 79 3a 20 22 20 71 72 79 29 20 0a 09 20 20 20 20 y: " qry) ..
1860: 20 71 72 79 29 0a 09 20 20 20 71 72 79 76 61 6c qry).. qryval
1870: 73 29 0a 09 20 20 28 73 71 6c 69 74 65 33 3a 65 s).. (sqlite3:e
1880: 78 65 63 75 74 65 20 64 62 20 22 55 50 44 41 54 xecute db "UPDAT
1890: 45 20 72 75 6e 73 20 53 45 54 20 73 74 61 74 65 E runs SET state
18a0: 3d 3f 2c 73 74 61 74 75 73 3d 3f 20 57 48 45 52 =?,status=? WHER
18b0: 45 20 69 64 3d 3f 3b 22 20 73 74 61 74 65 20 73 E id=?;" state s
18c0: 74 61 74 75 73 20 72 65 73 29 0a 09 20 20 72 65 tatus res).. re
18d0: 73 29 20 0a 09 28 62 65 67 69 6e 0a 09 20 20 28 s) ..(begin.. (
18e0: 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 debug:print 0 "E
18f0: 52 52 4f 52 3a 20 43 61 6c 6c 65 64 20 77 69 74 RROR: Called wit
1900: 68 6f 75 74 20 61 6c 6c 20 6e 65 63 65 73 73 61 hout all necessa
1910: 72 79 20 6b 65 79 73 22 29 0a 09 20 20 23 66 29 ry keys").. #f)
1920: 29 29 29 0a 0a 3b 3b 20 54 68 69 73 20 69 73 20 )))..;; This is
1930: 61 20 64 75 70 6c 69 63 61 74 65 20 6f 66 20 72 a duplicate of r
1940: 75 6e 2d 74 65 73 74 73 20 28 77 68 69 63 68 20 un-tests (which
1950: 68 61 73 20 62 65 65 6e 20 64 65 70 72 65 63 61 has been depreca
1960: 74 65 64 29 2e 20 55 73 65 20 74 68 69 73 20 6f ted). Use this o
1970: 6e 65 20 69 6e 73 74 65 61 64 20 6f 66 20 72 75 ne instead of ru
1980: 6e 20 74 65 73 74 73 2e 0a 3b 3b 20 6b 65 79 76 n tests..;; keyv
1990: 61 6c 73 0a 28 64 65 66 69 6e 65 20 28 72 75 6e als.(define (run
19a0: 73 3a 72 75 6e 2d 74 65 73 74 73 20 64 62 20 74 s:run-tests db t
19b0: 61 72 67 65 74 20 72 75 6e 6e 61 6d 65 20 74 65 arget runname te
19c0: 73 74 2d 70 61 74 74 73 20 75 73 65 72 20 66 6c st-patts user fl
19d0: 61 67 73 29 0a 20 20 28 6c 65 74 2a 20 28 28 6b ags). (let* ((k
19e0: 65 79 73 20 20 20 20 20 20 20 20 28 72 64 62 3a eys (rdb:
19f0: 67 65 74 2d 6b 65 79 73 20 64 62 29 29 0a 09 20 get-keys db))..
1a00: 28 6b 65 79 76 61 6c 6c 73 74 20 20 20 28 6b 65 (keyvallst (ke
1a10: 79 73 3a 74 61 72 67 65 74 2d 3e 6b 65 79 76 61 ys:target->keyva
1a20: 6c 20 6b 65 79 73 20 74 61 72 67 65 74 29 29 0a l keys target)).
1a30: 09 20 28 72 75 6e 2d 69 64 20 20 20 20 20 20 28 . (run-id (
1a40: 72 75 6e 73 3a 72 65 67 69 73 74 65 72 2d 72 75 runs:register-ru
1a50: 6e 20 64 62 20 6b 65 79 73 20 6b 65 79 76 61 6c n db keys keyval
1a60: 6c 73 74 20 72 75 6e 6e 61 6d 65 20 22 6e 65 77 lst runname "new
1a70: 22 20 22 6e 2f 61 22 20 75 73 65 72 29 29 20 20 " "n/a" user))
1a80: 3b 3b 20 20 74 65 73 74 2d 6e 61 6d 65 29 29 29 ;; test-name)))
1a90: 0a 09 20 28 64 65 66 65 72 72 65 64 20 20 20 20 .. (deferred
1aa0: 27 28 29 29 20 3b 3b 20 64 65 6c 61 79 20 72 75 '()) ;; delay ru
1ab0: 6e 6e 69 6e 67 20 74 68 65 73 65 20 73 69 6e 63 nning these sinc
1ac0: 65 20 74 68 65 79 20 68 61 76 65 20 61 20 77 61 e they have a wa
1ad0: 69 74 6f 6e 20 63 6c 61 75 73 65 0a 09 20 3b 3b iton clause.. ;;
1ae0: 20 6b 65 65 70 67 6f 69 6e 67 20 69 73 20 74 68 keepgoing is th
1af0: 65 20 64 65 66 61 63 74 6f 20 6d 6f 64 61 6c 69 e defacto modali
1b00: 74 79 20 6e 6f 77 2c 20 77 69 6c 6c 20 61 64 64 ty now, will add
1b10: 20 68 69 74 2d 6e 2d 72 75 6e 20 61 20 62 69 74 hit-n-run a bit
1b20: 20 6c 61 74 65 72 0a 09 20 3b 3b 20 28 6b 65 65 later.. ;; (kee
1b30: 70 67 6f 69 6e 67 20 20 20 28 68 61 73 68 2d 74 pgoing (hash-t
1b40: 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 able-ref/default
1b50: 20 66 6c 61 67 73 20 22 2d 6b 65 65 70 67 6f 69 flags "-keepgoi
1b60: 6e 67 22 20 23 66 29 29 0a 09 20 28 74 65 73 74 ng" #f)).. (test
1b70: 2d 6e 61 6d 65 73 20 20 27 28 29 29 0a 09 20 28 -names '()).. (
1b80: 72 75 6e 63 6f 6e 66 69 67 66 20 20 20 28 63 6f runconfigf (co
1b90: 6e 63 20 20 2a 74 6f 70 70 61 74 68 2a 20 22 2f nc *toppath* "/
1ba0: 72 75 6e 63 6f 6e 66 69 67 73 2e 63 6f 6e 66 69 runconfigs.confi
1bb0: 67 22 29 29 0a 09 20 28 72 65 71 75 69 72 65 64 g")).. (required
1bc0: 2d 74 65 73 74 73 20 27 28 29 29 0a 09 20 28 74 -tests '()).. (t
1bd0: 65 73 74 2d 72 65 63 6f 72 64 73 20 28 6d 61 6b est-records (mak
1be0: 65 2d 68 61 73 68 2d 74 61 62 6c 65 29 29 29 0a e-hash-table))).
1bf0: 0a 20 20 20 20 28 73 65 74 2d 6d 65 67 61 74 65 . (set-megate
1c00: 73 74 2d 65 6e 76 2d 76 61 72 73 20 64 62 20 72 st-env-vars db r
1c10: 75 6e 2d 69 64 29 20 3b 3b 20 74 68 65 73 65 20 un-id) ;; these
1c20: 6d 61 79 20 62 65 20 6e 65 65 64 65 64 20 62 79 may be needed by
1c30: 20 74 68 65 20 6c 61 75 6e 63 68 69 6e 67 20 70 the launching p
1c40: 72 6f 63 65 73 73 0a 0a 20 20 20 20 28 69 66 20 rocess.. (if
1c50: 28 66 69 6c 65 2d 65 78 69 73 74 73 3f 20 72 75 (file-exists? ru
1c60: 6e 63 6f 6e 66 69 67 66 29 0a 09 28 73 65 74 75 nconfigf)..(setu
1c70: 70 2d 65 6e 76 2d 64 65 66 61 75 6c 74 73 20 64 p-env-defaults d
1c80: 62 20 72 75 6e 63 6f 6e 66 69 67 66 20 72 75 6e b runconfigf run
1c90: 2d 69 64 20 2a 61 6c 72 65 61 64 79 2d 73 65 65 -id *already-see
1ca0: 6e 2d 72 75 6e 63 6f 6e 66 69 67 2d 69 6e 66 6f n-runconfig-info
1cb0: 2a 20 22 70 72 65 2d 6c 61 75 6e 63 68 2d 65 6e * "pre-launch-en
1cc0: 76 2d 76 61 72 73 22 29 0a 09 28 64 65 62 75 67 v-vars")..(debug
1cd0: 3a 70 72 69 6e 74 20 30 20 22 57 41 52 4e 49 4e :print 0 "WARNIN
1ce0: 47 3a 20 59 6f 75 20 64 6f 20 6e 6f 74 20 68 61 G: You do not ha
1cf0: 76 65 20 61 20 72 75 6e 20 63 6f 6e 66 69 67 20 ve a run config
1d00: 66 69 6c 65 3a 20 22 20 72 75 6e 63 6f 6e 66 69 file: " runconfi
1d10: 67 66 29 29 0a 20 20 20 20 0a 20 20 20 20 3b 3b gf)). . ;;
1d20: 20 6c 6f 6f 6b 20 75 70 20 61 6c 6c 20 74 65 73 look up all tes
1d30: 74 73 20 6d 61 74 63 68 69 6e 67 20 74 68 65 20 ts matching the
1d40: 63 6f 6d 6d 61 20 73 65 70 61 72 61 74 65 64 20 comma separated
1d50: 6c 69 73 74 20 6f 66 20 67 6c 6f 62 73 20 69 6e list of globs in
1d60: 0a 20 20 20 20 3b 3b 20 74 65 73 74 2d 70 61 74 . ;; test-pat
1d70: 74 73 20 28 75 73 69 6e 67 20 25 20 61 73 20 77 ts (using % as w
1d80: 69 6c 64 63 61 72 64 29 0a 20 20 20 20 28 66 6f ildcard). (fo
1d90: 72 2d 65 61 63 68 20 0a 20 20 20 20 20 28 6c 61 r-each . (la
1da0: 6d 62 64 61 20 28 70 61 74 74 29 0a 20 20 20 20 mbda (patt).
1db0: 20 20 20 28 6c 65 74 20 28 28 74 65 73 74 73 20 (let ((tests
1dc0: 28 67 6c 6f 62 20 28 63 6f 6e 63 20 2a 74 6f 70 (glob (conc *top
1dd0: 70 61 74 68 2a 20 22 2f 74 65 73 74 73 2f 22 20 path* "/tests/"
1de0: 28 73 74 72 69 6e 67 2d 74 72 61 6e 73 6c 61 74 (string-translat
1df0: 65 20 70 61 74 74 20 22 25 22 20 22 2a 22 29 29 e patt "%" "*"))
1e00: 29 29 29 0a 09 20 28 73 65 74 21 20 74 65 73 74 ))).. (set! test
1e10: 73 20 28 66 69 6c 74 65 72 20 28 6c 61 6d 62 64 s (filter (lambd
1e20: 61 20 28 74 65 73 74 29 28 66 69 6c 65 2d 65 78 a (test)(file-ex
1e30: 69 73 74 73 3f 20 28 63 6f 6e 63 20 74 65 73 74 ists? (conc test
1e40: 20 22 2f 74 65 73 74 63 6f 6e 66 69 67 22 29 29 "/testconfig"))
1e50: 29 20 74 65 73 74 73 29 29 0a 09 20 28 73 65 74 ) tests)).. (set
1e60: 21 20 74 65 73 74 2d 6e 61 6d 65 73 20 28 61 70 ! test-names (ap
1e70: 70 65 6e 64 20 74 65 73 74 2d 6e 61 6d 65 73 20 pend test-names
1e80: 0a 09 09 09 09 20 20 28 6d 61 70 20 28 6c 61 6d ..... (map (lam
1e90: 62 64 61 20 28 74 65 73 74 70 29 0a 09 09 09 09 bda (testp).....
1ea0: 09 20 28 6c 61 73 74 20 28 73 74 72 69 6e 67 2d . (last (string-
1eb0: 73 70 6c 69 74 20 74 65 73 74 70 20 22 2f 22 29 split testp "/")
1ec0: 29 29 0a 09 09 09 09 20 20 20 20 20 20 20 74 65 ))..... te
1ed0: 73 74 73 29 29 29 29 29 0a 20 20 20 20 20 28 69 sts))))). (i
1ee0: 66 20 74 65 73 74 2d 70 61 74 74 73 20 28 73 74 f test-patts (st
1ef0: 72 69 6e 67 2d 73 70 6c 69 74 20 74 65 73 74 2d ring-split test-
1f00: 70 61 74 74 73 20 22 2c 22 29 28 6c 69 73 74 20 patts ",")(list
1f10: 22 25 22 29 29 29 0a 0a 20 20 20 20 20 3b 3b 20 "%"))).. ;;
1f20: 6e 6f 77 20 72 65 6d 6f 76 65 20 64 75 70 6c 69 now remove dupli
1f30: 63 61 74 65 73 0a 20 20 20 20 28 73 65 74 21 20 cates. (set!
1f40: 74 65 73 74 2d 6e 61 6d 65 73 20 28 64 65 6c 65 test-names (dele
1f50: 74 65 2d 64 75 70 6c 69 63 61 74 65 73 20 74 65 te-duplicates te
1f60: 73 74 2d 6e 61 6d 65 73 29 29 0a 0a 20 20 20 20 st-names))..
1f70: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 (debug:print 0 "
1f80: 49 4e 46 4f 3a 20 74 65 73 74 20 6e 61 6d 65 73 INFO: test names
1f90: 20 22 20 74 65 73 74 2d 6e 61 6d 65 73 29 0a 0a " test-names)..
1fa0: 20 20 20 20 3b 3b 20 6f 6e 20 74 68 65 20 66 69 ;; on the fi
1fb0: 72 73 74 20 70 61 73 73 20 6f 72 20 63 61 6c 6c rst pass or call
1fc0: 20 74 6f 20 72 75 6e 2d 74 65 73 74 73 20 73 65 to run-tests se
1fd0: 74 20 46 41 49 4c 53 20 74 6f 20 4e 4f 54 5f 53 t FAILS to NOT_S
1fe0: 54 41 52 54 45 44 20 69 66 0a 20 20 20 20 3b 3b TARTED if. ;;
1ff0: 20 2d 6b 65 65 70 67 6f 69 6e 67 20 69 73 20 73 -keepgoing is s
2000: 70 65 63 69 66 69 65 64 0a 20 20 20 20 28 69 66 pecified. (if
2010: 20 28 65 71 3f 20 2a 70 61 73 73 6e 75 6d 2a 20 (eq? *passnum*
2020: 30 29 0a 09 28 62 65 67 69 6e 0a 09 20 20 3b 3b 0)..(begin.. ;;
2030: 20 68 61 76 65 20 74 6f 20 64 65 6c 65 74 65 20 have to delete
2040: 74 65 73 74 20 72 65 63 6f 72 64 73 20 77 68 65 test records whe
2050: 72 65 20 4e 4f 54 5f 53 54 41 52 54 45 44 20 73 re NOT_STARTED s
2060: 69 6e 63 65 20 74 68 65 79 20 63 61 6e 20 63 61 ince they can ca
2070: 75 73 65 20 2d 6b 65 65 70 67 6f 69 6e 67 20 74 use -keepgoing t
2080: 6f 20 0a 09 20 20 3b 3b 20 67 65 74 20 73 74 75 o .. ;; get stu
2090: 63 6b 20 64 75 65 20 74 6f 20 62 65 63 6f 6d 69 ck due to becomi
20a0: 6e 67 20 69 6e 61 63 63 65 73 73 69 62 6c 65 20 ng inaccessible
20b0: 66 72 6f 6d 20 61 20 66 61 69 6c 65 64 20 74 65 from a failed te
20c0: 73 74 2e 20 49 2e 65 2e 20 69 66 20 74 65 73 74 st. I.e. if test
20d0: 20 42 20 64 65 70 65 6e 64 73 20 0a 09 20 20 3b B depends .. ;
20e0: 3b 20 6f 6e 20 74 65 73 74 20 41 20 62 75 74 20 ; on test A but
20f0: 74 65 73 74 20 42 20 72 65 61 63 68 65 64 20 74 test B reached t
2100: 68 65 20 70 6f 69 6e 74 20 6f 6e 20 62 65 69 6e he point on bein
2110: 67 20 72 65 67 69 73 74 65 72 65 64 20 61 73 20 g registered as
2120: 4e 4f 54 5f 53 54 41 52 54 45 44 20 61 6e 64 20 NOT_STARTED and
2130: 74 65 73 74 0a 09 20 20 3b 3b 20 41 20 66 61 69 test.. ;; A fai
2140: 6c 65 64 20 66 6f 72 20 73 6f 6d 65 20 72 65 61 led for some rea
2150: 73 6f 6e 20 74 68 65 6e 20 6f 6e 20 72 65 2d 72 son then on re-r
2160: 75 6e 20 75 73 69 6e 67 20 2d 6b 65 65 70 67 6f un using -keepgo
2170: 69 6e 67 20 74 68 65 20 72 75 6e 20 63 61 6e 20 ing the run can
2180: 6e 65 76 65 72 20 63 6f 6d 70 6c 65 74 65 2e 0a never complete..
2190: 09 20 20 28 64 62 3a 64 65 6c 65 74 65 2d 74 65 . (db:delete-te
21a0: 73 74 73 2d 69 6e 2d 73 74 61 74 65 20 64 62 20 sts-in-state db
21b0: 72 75 6e 2d 69 64 20 22 4e 4f 54 5f 53 54 41 52 run-id "NOT_STAR
21c0: 54 45 44 22 29 0a 09 20 20 28 72 64 62 3a 73 65 TED").. (rdb:se
21d0: 74 2d 74 65 73 74 73 2d 73 74 61 74 65 2d 73 74 t-tests-state-st
21e0: 61 74 75 73 20 64 62 20 72 75 6e 2d 69 64 20 74 atus db run-id t
21f0: 65 73 74 2d 6e 61 6d 65 73 20 23 66 20 22 46 41 est-names #f "FA
2200: 49 4c 22 20 22 4e 4f 54 5f 53 54 41 52 54 45 44 IL" "NOT_STARTED
2210: 22 20 22 46 41 49 4c 22 29 29 29 0a 0a 20 20 20 " "FAIL")))..
2220: 20 3b 3b 20 66 72 6f 6d 20 68 65 72 65 20 6f 6e ;; from here on
2230: 20 6f 75 74 20 74 68 65 20 64 62 20 77 69 6c 6c out the db will
2240: 20 62 65 20 6f 70 65 6e 65 64 20 61 6e 64 20 63 be opened and c
2250: 6c 6f 73 65 64 20 6f 6e 20 65 76 65 72 79 20 63 losed on every c
2260: 61 6c 6c 20 72 75 6e 73 3a 72 75 6e 2d 74 65 73 all runs:run-tes
2270: 74 73 2d 71 75 65 75 65 0a 20 20 20 20 28 73 71 ts-queue. (sq
2280: 6c 69 74 65 33 3a 66 69 6e 61 6c 69 7a 65 21 20 lite3:finalize!
2290: 64 62 29 20 0a 20 20 20 20 3b 3b 20 6e 6f 77 20 db) . ;; now
22a0: 61 64 64 20 6e 6f 6e 2d 64 69 72 65 63 74 6c 79 add non-directly
22b0: 20 72 65 66 65 72 65 6e 63 65 64 20 64 65 70 65 referenced depe
22c0: 6e 64 65 6e 63 69 65 73 20 28 69 2e 65 2e 20 77 ndencies (i.e. w
22d0: 61 69 74 6f 6e 29 0a 20 20 20 20 28 69 66 20 28 aiton). (if (
22e0: 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 65 73 74 2d not (null? test-
22f0: 6e 61 6d 65 73 29 29 0a 09 28 6c 65 74 20 6c 6f names))..(let lo
2300: 6f 70 20 28 28 68 65 64 20 28 63 61 72 20 74 65 op ((hed (car te
2310: 73 74 2d 6e 61 6d 65 73 29 29 0a 09 09 20 20 20 st-names))...
2320: 28 74 61 6c 20 28 63 64 72 20 74 65 73 74 2d 6e (tal (cdr test-n
2330: 61 6d 65 73 29 29 29 20 20 20 20 20 20 20 20 20 ames)))
2340: 3b 3b 20 27 72 65 74 75 72 6e 2d 70 72 6f 63 73 ;; 'return-procs
2350: 20 74 65 6c 6c 73 20 74 68 65 20 63 6f 6e 66 69 tells the confi
2360: 67 20 72 65 61 64 65 72 20 74 6f 20 70 72 65 70 g reader to prep
2370: 20 72 75 6e 6e 69 6e 67 20 73 79 73 74 65 6d 20 running system
2380: 62 75 74 20 72 65 74 75 72 6e 20 61 20 70 72 6f but return a pro
2390: 63 0a 09 20 20 28 6c 65 74 2a 20 28 28 63 6f 6e c.. (let* ((con
23a0: 66 69 67 20 20 28 74 65 73 74 73 3a 67 65 74 2d fig (tests:get-
23b0: 74 65 73 74 63 6f 6e 66 69 67 20 68 65 64 20 27 testconfig hed '
23c0: 72 65 74 75 72 6e 2d 70 72 6f 63 73 29 29 0a 09 return-procs))..
23d0: 09 20 28 77 61 69 74 6f 6e 73 20 28 69 66 20 63 . (waitons (if c
23e0: 6f 6e 66 69 67 20 28 73 74 72 69 6e 67 2d 73 70 onfig (string-sp
23f0: 6c 69 74 20 28 6c 65 74 20 28 28 77 20 28 63 6f lit (let ((w (co
2400: 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 63 6f 6e 66 nfig-lookup conf
2410: 69 67 20 22 72 65 71 75 69 72 65 6d 65 6e 74 73 ig "requirements
2420: 22 20 22 77 61 69 74 6f 6e 22 29 29 29 0a 09 09 " "waiton")))...
2430: 09 09 09 09 20 20 20 20 20 28 69 66 20 77 20 77 .... (if w w
2440: 20 22 22 29 29 29 0a 09 09 09 20 20 20 20 20 20 "")))....
2450: 28 62 65 67 69 6e 0a 09 09 09 09 28 64 65 62 75 (begin.....(debu
2460: 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 g:print 0 "ERROR
2470: 3a 20 6e 6f 6e 2d 65 78 69 73 74 65 6e 74 20 72 : non-existent r
2480: 65 71 75 69 72 65 64 20 74 65 73 74 20 5c 22 22 equired test \""
2490: 20 68 65 64 20 22 5c 22 22 29 0a 20 20 20 20 20 hed "\"").
24a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
24b0: 20 20 20 20 20 20 20 20 20 20 20 28 73 71 6c 69 (sqli
24c0: 74 65 33 3a 66 69 6e 61 6c 69 7a 65 21 20 64 62 te3:finalize! db
24d0: 29 0a 09 09 09 09 28 65 78 69 74 20 31 29 29 29 ).....(exit 1)))
24e0: 29 29 0a 09 20 20 20 20 3b 3b 20 63 68 65 63 6b )).. ;; check
24f0: 20 66 6f 72 20 68 65 64 20 69 6e 20 77 61 69 74 for hed in wait
2500: 6f 6e 73 20 3d 3e 20 74 68 69 73 20 77 6f 75 6c ons => this woul
2510: 64 20 62 65 20 63 69 72 63 75 6c 61 72 2c 20 72 d be circular, r
2520: 65 6d 6f 76 65 20 69 74 20 61 6e 64 20 69 73 73 emove it and iss
2530: 75 65 20 61 6e 0a 09 20 20 20 20 3b 3b 20 65 72 ue an.. ;; er
2540: 72 6f 72 0a 09 20 20 20 20 28 69 66 20 28 6d 65 ror.. (if (me
2550: 6d 62 65 72 20 68 65 64 20 77 61 69 74 6f 6e 73 mber hed waitons
2560: 29 0a 09 09 28 62 65 67 69 6e 0a 09 09 20 20 28 )...(begin... (
2570: 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 debug:print 0 "E
2580: 52 52 4f 52 3a 20 74 65 73 74 20 22 20 68 65 64 RROR: test " hed
2590: 20 22 20 68 61 73 20 6c 69 73 74 65 64 20 69 74 " has listed it
25a0: 73 65 6c 66 20 61 73 20 61 20 77 61 69 74 6f 6e self as a waiton
25b0: 2c 20 70 6c 65 61 73 65 20 63 6f 72 72 65 63 74 , please correct
25c0: 20 74 68 69 73 21 22 29 0a 09 09 20 20 28 73 65 this!")... (se
25d0: 74 21 20 77 61 69 74 6f 6e 73 20 28 66 69 6c 74 t! waitons (filt
25e0: 65 72 20 28 6c 61 6d 62 64 61 20 28 78 29 28 6e er (lambda (x)(n
25f0: 6f 74 20 28 65 71 75 61 6c 3f 20 78 20 68 65 64 ot (equal? x hed
2600: 29 29 29 20 77 61 69 74 6f 6e 73 29 29 29 29 0a ))) waitons)))).
2610: 09 20 20 20 20 0a 09 20 20 20 20 3b 3b 20 28 69 . .. ;; (i
2620: 74 65 6d 73 20 20 20 28 69 74 65 6d 73 3a 67 65 tems (items:ge
2630: 74 2d 69 74 65 6d 73 2d 66 72 6f 6d 2d 63 6f 6e t-items-from-con
2640: 66 69 67 20 63 6f 6e 66 69 67 29 29 29 0a 09 20 fig config)))..
2650: 20 20 20 28 69 66 20 28 6e 6f 74 20 28 68 61 73 (if (not (has
2660: 68 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 h-table-ref/defa
2670: 75 6c 74 20 74 65 73 74 2d 72 65 63 6f 72 64 73 ult test-records
2680: 20 68 65 64 20 23 66 29 29 0a 09 09 28 68 61 73 hed #f))...(has
2690: 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 74 65 73 h-table-set! tes
26a0: 74 2d 72 65 63 6f 72 64 73 0a 09 09 09 09 20 68 t-records..... h
26b0: 65 64 20 28 76 65 63 74 6f 72 20 68 65 64 20 20 ed (vector hed
26c0: 20 20 20 3b 3b 20 30 0a 09 09 09 09 09 20 20 20 ;; 0......
26d0: 20 20 63 6f 6e 66 69 67 20 20 3b 3b 20 31 0a 09 config ;; 1..
26e0: 09 09 09 09 20 20 20 20 20 77 61 69 74 6f 6e 73 .... waitons
26f0: 20 3b 3b 20 32 0a 09 09 09 09 09 20 20 20 20 20 ;; 2......
2700: 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 63 (config-lookup c
2710: 6f 6e 66 69 67 20 22 72 65 71 75 69 72 65 6d 65 onfig "requireme
2720: 6e 74 73 22 20 22 70 72 69 6f 72 69 74 79 22 29 nts" "priority")
2730: 20 20 20 20 20 3b 3b 20 70 72 69 6f 72 69 74 79 ;; priority
2740: 20 33 0a 09 09 09 09 09 20 20 20 20 20 28 6c 65 3...... (le
2750: 74 20 28 28 69 74 65 6d 73 20 20 20 20 20 20 28 t ((items (
2760: 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 2f 64 hash-table-ref/d
2770: 65 66 61 75 6c 74 20 63 6f 6e 66 69 67 20 22 69 efault config "i
2780: 74 65 6d 73 22 20 23 66 29 29 20 3b 3b 20 69 74 tems" #f)) ;; it
2790: 65 6d 73 20 34 0a 09 09 09 09 09 09 20 20 20 28 ems 4....... (
27a0: 69 74 65 6d 73 74 61 62 6c 65 20 28 68 61 73 68 itemstable (hash
27b0: 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 -table-ref/defau
27c0: 6c 74 20 63 6f 6e 66 69 67 20 22 69 74 65 6d 73 lt config "items
27d0: 74 61 62 6c 65 22 20 23 66 29 29 29 20 0a 09 09 table" #f))) ...
27e0: 09 09 09 20 20 20 20 20 20 20 3b 3b 20 69 66 20 ... ;; if
27f0: 65 69 74 68 65 72 20 69 74 65 6d 73 20 6f 72 20 either items or
2800: 69 74 65 6d 73 20 74 61 62 6c 65 20 69 73 20 61 items table is a
2810: 20 70 72 6f 63 20 72 65 74 75 72 6e 20 69 74 20 proc return it
2820: 73 6f 20 74 65 73 74 20 72 75 6e 6e 69 6e 67 0a so test running.
2830: 09 09 09 09 09 20 20 20 20 20 20 20 3b 3b 20 70 ..... ;; p
2840: 72 6f 63 65 73 73 20 63 61 6e 20 6b 6e 6f 77 20 rocess can know
2850: 74 6f 20 63 61 6c 6c 20 69 74 65 6d 73 3a 67 65 to call items:ge
2860: 74 2d 69 74 65 6d 73 2d 66 72 6f 6d 2d 63 6f 6e t-items-from-con
2870: 66 69 67 0a 09 09 09 09 09 20 20 20 20 20 20 20 fig......
2880: 3b 3b 20 69 66 20 65 69 74 68 65 72 20 69 73 20 ;; if either is
2890: 61 20 6c 69 73 74 20 61 6e 64 20 6e 6f 6e 65 20 a list and none
28a0: 69 73 20 61 20 70 72 6f 63 20 67 6f 20 61 68 65 is a proc go ahe
28b0: 61 64 20 61 6e 64 20 63 61 6c 6c 20 67 65 74 2d ad and call get-
28c0: 69 74 65 6d 73 0a 09 09 09 09 09 20 20 20 20 20 items......
28d0: 20 20 3b 3b 20 6f 74 68 65 72 77 69 73 65 20 72 ;; otherwise r
28e0: 65 74 75 72 6e 20 23 66 20 2d 20 74 68 69 73 20 eturn #f - this
28f0: 69 73 20 6e 6f 74 20 61 6e 20 69 74 65 72 61 74 is not an iterat
2900: 65 64 20 74 65 73 74 0a 09 09 09 09 09 20 20 20 ed test......
2910: 20 20 20 20 28 63 6f 6e 64 0a 09 09 09 09 09 09 (cond.......
2920: 28 28 70 72 6f 63 65 64 75 72 65 3f 20 69 74 65 ((procedure? ite
2930: 6d 73 29 20 20 20 20 20 20 0a 09 09 09 09 09 09 ms) .......
2940: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 (debug:print 4
2950: 22 49 4e 46 4f 3a 20 69 74 65 6d 73 20 69 73 20 "INFO: items is
2960: 61 20 70 72 6f 63 65 64 75 72 65 2c 20 77 69 6c a procedure, wil
2970: 6c 20 63 61 6c 63 20 6c 61 74 65 72 22 29 0a 09 l calc later")..
2980: 09 09 09 09 09 20 69 74 65 6d 73 29 20 20 20 20 ..... items)
2990: 20 20 20 20 20 20 20 20 3b 3b 20 63 61 6c 63 20 ;; calc
29a0: 6c 61 74 65 72 0a 09 09 09 09 09 09 28 28 70 72 later.......((pr
29b0: 6f 63 65 64 75 72 65 3f 20 69 74 65 6d 73 74 61 ocedure? itemsta
29c0: 62 6c 65 29 0a 09 09 09 09 09 09 20 28 64 65 62 ble)....... (deb
29d0: 75 67 3a 70 72 69 6e 74 20 34 20 22 49 4e 46 4f ug:print 4 "INFO
29e0: 3a 20 69 74 65 6d 73 74 61 62 6c 65 20 69 73 20 : itemstable is
29f0: 61 20 70 72 6f 63 65 64 75 72 65 2c 20 77 69 6c a procedure, wil
2a00: 6c 20 63 61 6c 63 20 6c 61 74 65 72 22 29 0a 09 l calc later")..
2a10: 09 09 09 09 09 20 69 74 65 6d 73 74 61 62 6c 65 ..... itemstable
2a20: 29 20 20 20 20 20 20 20 3b 3b 20 63 61 6c 63 20 ) ;; calc
2a30: 6c 61 74 65 72 0a 09 09 09 09 09 09 28 28 66 69 later.......((fi
2a40: 6c 74 65 72 20 28 6c 61 6d 62 64 61 20 28 78 29 lter (lambda (x)
2a50: 0a 09 09 09 09 09 09 09 20 20 20 28 6c 65 74 20 ........ (let
2a60: 28 28 76 61 6c 20 28 63 61 72 20 78 29 29 29 0a ((val (car x))).
2a70: 09 09 09 09 09 09 09 20 20 20 20 20 28 69 66 20 ....... (if
2a80: 28 70 72 6f 63 65 64 75 72 65 3f 20 76 61 6c 29 (procedure? val)
2a90: 20 76 61 6c 20 23 66 29 29 29 0a 09 09 09 09 09 val #f)))......
2aa0: 09 09 20 28 61 70 70 65 6e 64 20 28 69 66 20 28 .. (append (if (
2ab0: 6c 69 73 74 3f 20 69 74 65 6d 73 29 20 69 74 65 list? items) ite
2ac0: 6d 73 20 27 28 29 29 0a 09 09 09 09 09 09 09 09 ms '()).........
2ad0: 20 28 69 66 20 28 6c 69 73 74 3f 20 69 74 65 6d (if (list? item
2ae0: 73 74 61 62 6c 65 29 20 69 74 65 6d 73 74 61 62 stable) itemstab
2af0: 6c 65 20 27 28 29 29 29 29 0a 09 09 09 09 09 09 le '()))).......
2b00: 20 27 68 61 76 65 2d 70 72 6f 63 65 64 75 72 65 'have-procedure
2b10: 29 0a 09 09 09 09 09 09 28 28 6f 72 20 28 6c 69 ).......((or (li
2b20: 73 74 3f 20 69 74 65 6d 73 29 28 6c 69 73 74 3f st? items)(list?
2b30: 20 69 74 65 6d 73 74 61 62 6c 65 29 29 20 3b 3b itemstable)) ;;
2b40: 20 63 61 6c 63 20 6e 6f 77 0a 09 09 09 09 09 09 calc now.......
2b50: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 (debug:print 4
2b60: 22 49 4e 46 4f 3a 20 69 74 65 6d 73 20 61 6e 64 "INFO: items and
2b70: 20 69 74 65 6d 73 74 61 62 6c 65 20 61 72 65 20 itemstable are
2b80: 6c 69 73 74 73 2c 20 63 61 6c 63 20 6e 6f 77 5c lists, calc now\
2b90: 6e 22 0a 09 09 09 09 09 09 09 20 20 20 20 20 20 n"........
2ba0: 22 20 20 20 20 69 74 65 6d 73 3a 20 22 20 69 74 " items: " it
2bb0: 65 6d 73 20 22 20 69 74 65 6d 73 74 61 62 6c 65 ems " itemstable
2bc0: 3a 20 22 20 69 74 65 6d 73 74 61 62 6c 65 29 0a : " itemstable).
2bd0: 09 09 09 09 09 09 20 28 69 74 65 6d 73 3a 67 65 ...... (items:ge
2be0: 74 2d 69 74 65 6d 73 2d 66 72 6f 6d 2d 63 6f 6e t-items-from-con
2bf0: 66 69 67 20 63 6f 6e 66 69 67 29 29 0a 09 09 09 fig config))....
2c00: 09 09 09 28 65 6c 73 65 20 23 66 29 29 29 20 20 ...(else #f)))
2c10: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
2c20: 20 20 20 20 20 20 20 20 20 3b 3b 20 6e 6f 74 20 ;; not
2c30: 69 74 65 72 61 74 65 64 0a 09 09 09 09 09 20 20 iterated......
2c40: 20 20 20 23 66 20 20 20 20 20 20 3b 3b 20 69 74 #f ;; it
2c50: 65 6d 73 64 61 74 20 35 0a 09 09 09 09 09 20 20 emsdat 5......
2c60: 20 20 20 23 66 20 20 20 20 20 20 3b 3b 20 73 70 #f ;; sp
2c70: 61 72 65 20 2d 20 75 73 65 64 20 66 6f 72 20 69 are - used for i
2c80: 74 65 6d 2d 70 61 74 68 0a 09 09 09 09 09 20 20 tem-path......
2c90: 20 20 20 29 29 29 0a 09 20 20 20 20 28 66 6f 72 ))).. (for
2ca0: 2d 65 61 63 68 20 0a 09 20 20 20 20 20 28 6c 61 -each .. (la
2cb0: 6d 62 64 61 20 28 77 61 69 74 6f 6e 29 0a 09 20 mbda (waiton)..
2cc0: 20 20 20 20 20 20 28 69 66 20 28 61 6e 64 20 77 (if (and w
2cd0: 61 69 74 6f 6e 20 28 6e 6f 74 20 28 6d 65 6d 62 aiton (not (memb
2ce0: 65 72 20 77 61 69 74 6f 6e 20 74 65 73 74 2d 6e er waiton test-n
2cf0: 61 6d 65 73 29 29 29 0a 09 09 20 20 20 28 62 65 ames)))... (be
2d00: 67 69 6e 0a 09 09 20 20 20 20 20 28 73 65 74 21 gin... (set!
2d10: 20 72 65 71 75 69 72 65 64 2d 74 65 73 74 73 20 required-tests
2d20: 28 63 6f 6e 73 20 77 61 69 74 6f 6e 20 72 65 71 (cons waiton req
2d30: 75 69 72 65 64 2d 74 65 73 74 73 29 29 0a 09 09 uired-tests))...
2d40: 20 20 20 20 20 28 73 65 74 21 20 74 65 73 74 2d (set! test-
2d50: 6e 61 6d 65 73 20 28 63 6f 6e 73 20 77 61 69 74 names (cons wait
2d60: 6f 6e 20 74 65 73 74 2d 6e 61 6d 65 73 29 29 29 on test-names)))
2d70: 29 29 20 3b 3b 20 77 61 73 20 61 6e 20 61 70 70 )) ;; was an app
2d80: 65 6e 64 2c 20 6e 6f 77 20 61 20 63 6f 6e 73 0a end, now a cons.
2d90: 09 20 20 20 20 20 77 61 69 74 6f 6e 73 29 0a 09 . waitons)..
2da0: 20 20 20 20 28 6c 65 74 20 28 28 72 65 6d 74 65 (let ((remte
2db0: 73 74 73 20 28 64 65 6c 65 74 65 2d 64 75 70 6c sts (delete-dupl
2dc0: 69 63 61 74 65 73 20 28 61 70 70 65 6e 64 20 77 icates (append w
2dd0: 61 69 74 6f 6e 73 20 74 61 6c 29 29 29 29 0a 09 aitons tal))))..
2de0: 20 20 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 (if (not (
2df0: 6e 75 6c 6c 3f 20 72 65 6d 74 65 73 74 73 29 29 null? remtests))
2e00: 0a 09 09 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 ... (loop (car
2e10: 72 65 6d 74 65 73 74 73 29 28 63 64 72 20 72 65 remtests)(cdr re
2e20: 6d 74 65 73 74 73 29 29 29 29 29 29 29 0a 0a 20 mtests)))))))..
2e30: 20 20 20 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c (if (not (nul
2e40: 6c 3f 20 72 65 71 75 69 72 65 64 2d 74 65 73 74 l? required-test
2e50: 73 29 29 0a 09 28 64 65 62 75 67 3a 70 72 69 6e s))..(debug:prin
2e60: 74 20 31 20 22 49 4e 46 4f 3a 20 41 64 64 69 6e t 1 "INFO: Addin
2e70: 67 20 22 20 72 65 71 75 69 72 65 64 2d 74 65 73 g " required-tes
2e80: 74 73 20 22 20 74 6f 20 74 68 65 20 72 75 6e 20 ts " to the run
2e90: 71 75 65 75 65 22 29 29 0a 20 20 20 20 3b 3b 20 queue")). ;;
2ea0: 4e 4f 54 45 3a 20 74 68 65 73 65 20 61 72 65 20 NOTE: these are
2eb0: 61 6c 6c 20 70 61 72 65 6e 74 20 74 65 73 74 73 all parent tests
2ec0: 2c 20 69 74 65 6d 73 20 61 72 65 20 6e 6f 74 20 , items are not
2ed0: 65 78 70 61 6e 64 65 64 20 79 65 74 2e 0a 20 20 expanded yet..
2ee0: 20 20 28 72 75 6e 73 3a 72 75 6e 2d 74 65 73 74 (runs:run-test
2ef0: 73 2d 71 75 65 75 65 20 72 75 6e 2d 69 64 20 72 s-queue run-id r
2f00: 75 6e 6e 61 6d 65 20 74 65 73 74 2d 72 65 63 6f unname test-reco
2f10: 72 64 73 20 6b 65 79 76 61 6c 6c 73 74 20 66 6c rds keyvallst fl
2f20: 61 67 73 29 0a 20 20 20 20 28 64 65 62 75 67 3a ags). (debug:
2f30: 70 72 69 6e 74 20 34 20 22 49 4e 46 4f 3a 20 41 print 4 "INFO: A
2f40: 6c 6c 20 64 6f 6e 65 20 62 79 20 68 65 72 65 22 ll done by here"
2f50: 29 29 29 0a 0a 3b 3b 20 74 65 73 74 2d 72 65 63 )))..;; test-rec
2f60: 6f 72 64 73 20 69 73 20 61 20 68 61 73 68 20 74 ords is a hash t
2f70: 61 62 6c 65 20 74 65 73 74 6e 61 6d 65 3a 69 74 able testname:it
2f80: 65 6d 5f 70 61 74 68 20 3d 3e 20 76 65 63 74 6f em_path => vecto
2f90: 72 20 3c 20 74 65 73 74 6e 61 6d 65 20 74 65 73 r < testname tes
2fa0: 74 63 6f 6e 66 69 67 20 77 61 69 74 6f 6e 73 20 tconfig waitons
2fb0: 70 72 69 6f 72 69 74 79 20 69 74 65 6d 73 2d 69 priority items-i
2fc0: 6e 66 6f 20 2e 2e 2e 20 3e 0a 28 64 65 66 69 6e nfo ... >.(defin
2fd0: 65 20 28 72 75 6e 73 3a 72 75 6e 2d 74 65 73 74 e (runs:run-test
2fe0: 73 2d 71 75 65 75 65 20 72 75 6e 2d 69 64 20 72 s-queue run-id r
2ff0: 75 6e 6e 61 6d 65 20 74 65 73 74 2d 72 65 63 6f unname test-reco
3000: 72 64 73 20 6b 65 79 76 61 6c 6c 73 74 20 66 6c rds keyvallst fl
3010: 61 67 73 29 0a 20 20 20 20 3b 3b 20 41 74 20 74 ags). ;; At t
3020: 68 69 73 20 70 6f 69 6e 74 20 74 68 65 20 6c 69 his point the li
3030: 73 74 20 6f 66 20 70 61 72 65 6e 74 20 74 65 73 st of parent tes
3040: 74 73 20 69 73 20 65 78 70 61 6e 64 65 64 20 0a ts is expanded .
3050: 20 20 20 20 3b 3b 20 4e 42 2f 2f 20 53 68 6f 75 ;; NB// Shou
3060: 6c 64 20 65 78 70 61 6e 64 20 69 74 65 6d 73 20 ld expand items
3070: 68 65 72 65 20 61 6e 64 20 74 68 65 6e 20 69 6e here and then in
3080: 73 65 72 74 20 69 6e 74 6f 20 74 68 65 20 72 75 sert into the ru
3090: 6e 20 71 75 65 75 65 2e 0a 20 20 28 64 65 62 75 n queue.. (debu
30a0: 67 3a 70 72 69 6e 74 20 35 20 22 74 65 73 74 2d g:print 5 "test-
30b0: 72 65 63 6f 72 64 73 3a 20 22 20 74 65 73 74 2d records: " test-
30c0: 72 65 63 6f 72 64 73 20 22 2c 20 6b 65 79 76 61 records ", keyva
30d0: 6c 6c 73 74 3a 20 22 20 6b 65 79 76 61 6c 6c 73 llst: " keyvalls
30e0: 74 20 22 20 66 6c 61 67 73 3a 20 22 20 28 68 61 t " flags: " (ha
30f0: 73 68 2d 74 61 62 6c 65 2d 3e 61 6c 69 73 74 20 sh-table->alist
3100: 66 6c 61 67 73 29 29 0a 20 20 28 6c 65 74 20 28 flags)). (let (
3110: 28 73 6f 72 74 65 64 2d 74 65 73 74 2d 6e 61 6d (sorted-test-nam
3120: 65 73 20 28 74 65 73 74 73 3a 73 6f 72 74 2d 62 es (tests:sort-b
3130: 79 2d 70 72 69 6f 72 69 74 79 2d 61 6e 64 2d 77 y-priority-and-w
3140: 61 69 74 6f 6e 20 74 65 73 74 2d 72 65 63 6f 72 aiton test-recor
3150: 64 73 29 29 0a 09 28 69 74 65 6d 2d 70 61 74 74 ds))..(item-patt
3160: 73 20 20 20 20 20 20 20 20 28 68 61 73 68 2d 74 s (hash-t
3170: 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 able-ref/default
3180: 20 66 6c 61 67 73 20 22 2d 69 74 65 6d 70 61 74 flags "-itempat
3190: 74 22 20 23 66 29 29 29 0a 20 20 20 20 28 69 66 t" #f))). (if
31a0: 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 73 6f 72 (not (null? sor
31b0: 74 65 64 2d 74 65 73 74 2d 6e 61 6d 65 73 29 29 ted-test-names))
31c0: 0a 09 28 6c 65 74 20 6c 6f 6f 70 20 28 28 68 65 ..(let loop ((he
31d0: 64 20 20 20 20 20 20 20 20 20 28 63 61 72 20 73 d (car s
31e0: 6f 72 74 65 64 2d 74 65 73 74 2d 6e 61 6d 65 73 orted-test-names
31f0: 29 29 0a 09 09 20 20 20 28 74 61 6c 20 20 20 20 ))... (tal
3200: 20 20 20 20 20 28 63 64 72 20 73 6f 72 74 65 64 (cdr sorted
3210: 2d 74 65 73 74 2d 6e 61 6d 65 73 29 29 29 0a 09 -test-names)))..
3220: 20 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 (thread-sleep!
3230: 20 28 2f 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c 74 (/ *global-delt
3240: 61 2a 20 31 30 29 29 20 3b 3b 20 67 69 76 65 20 a* 10)) ;; give
3250: 6f 74 68 65 72 20 61 70 70 6c 69 63 61 74 69 6f other applicatio
3260: 6e 73 20 73 6f 6d 65 20 74 69 6d 65 20 77 69 74 ns some time wit
3270: 68 20 74 68 65 20 64 62 0a 09 20 20 28 6c 65 74 h the db.. (let
3280: 2a 20 28 28 74 65 73 74 2d 72 65 63 6f 72 64 20 * ((test-record
3290: 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 20 (hash-table-ref
32a0: 74 65 73 74 2d 72 65 63 6f 72 64 73 20 68 65 64 test-records hed
32b0: 29 29 0a 09 09 20 28 74 63 6f 6e 66 69 67 20 20 ))... (tconfig
32c0: 20 20 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 (tests:testqu
32d0: 65 75 65 2d 67 65 74 2d 74 65 73 74 63 6f 6e 66 eue-get-testconf
32e0: 69 67 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 ig test-record))
32f0: 0a 09 09 20 28 74 65 73 74 6d 6f 64 65 20 20 20 ... (testmode
3300: 20 28 6c 65 74 20 28 28 6d 20 28 63 6f 6e 66 69 (let ((m (confi
3310: 67 2d 6c 6f 6f 6b 75 70 20 74 63 6f 6e 66 69 67 g-lookup tconfig
3320: 20 22 72 65 71 75 69 72 65 6d 65 6e 74 73 22 20 "requirements"
3330: 22 6d 6f 64 65 22 29 29 29 0a 09 09 09 09 28 69 "mode"))).....(i
3340: 66 20 6d 20 28 73 74 72 69 6e 67 2d 3e 73 79 6d f m (string->sym
3350: 62 6f 6c 20 6d 29 20 27 6e 6f 72 6d 61 6c 29 29 bol m) 'normal))
3360: 29 0a 09 09 20 28 77 61 69 74 6f 6e 73 20 20 20 )... (waitons
3370: 20 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 (tests:testque
3380: 75 65 2d 67 65 74 2d 77 61 69 74 6f 6e 73 20 20 ue-get-waitons
3390: 20 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a test-record)).
33a0: 09 09 20 28 70 72 69 6f 72 69 74 79 20 20 20 20 .. (priority
33b0: 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 (tests:testqueue
33c0: 2d 67 65 74 2d 70 72 69 6f 72 69 74 79 20 20 20 -get-priority
33d0: 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 09 test-record))...
33e0: 20 28 69 74 65 6d 64 61 74 20 20 20 20 20 28 74 (itemdat (t
33f0: 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 ests:testqueue-g
3400: 65 74 2d 69 74 65 6d 64 61 74 20 20 20 20 74 65 et-itemdat te
3410: 73 74 2d 72 65 63 6f 72 64 29 29 20 3b 3b 20 69 st-record)) ;; i
3420: 74 65 6d 64 61 74 20 63 61 6e 20 62 65 20 61 20 temdat can be a
3430: 73 74 72 69 6e 67 2c 20 6c 69 73 74 20 6f 72 20 string, list or
3440: 23 66 0a 09 09 20 28 69 74 65 6d 73 20 20 20 20 #f... (items
3450: 20 20 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 (tests:testqu
3460: 65 75 65 2d 67 65 74 2d 69 74 65 6d 73 20 20 20 eue-get-items
3470: 20 20 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 test-record))
3480: 0a 09 09 20 28 69 74 65 6d 2d 70 61 74 68 20 20 ... (item-path
3490: 20 28 69 74 65 6d 2d 6c 69 73 74 2d 3e 70 61 74 (item-list->pat
34a0: 68 20 69 74 65 6d 64 61 74 29 29 0a 09 09 20 28 h itemdat))... (
34b0: 6e 65 77 74 61 6c 20 20 20 20 20 20 28 61 70 70 newtal (app
34c0: 65 6e 64 20 74 61 6c 20 28 6c 69 73 74 20 68 65 end tal (list he
34d0: 64 29 29 29 0a 09 09 20 28 63 61 6c 63 2d 66 61 d)))... (calc-fa
34e0: 69 6c 73 20 20 28 6c 61 6d 62 64 61 20 28 70 72 ils (lambda (pr
34f0: 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 0a 09 ereqs-not-met)..
3500: 09 09 09 28 66 69 6c 74 65 72 20 28 6c 61 6d 62 ...(filter (lamb
3510: 64 61 20 28 74 65 73 74 29 0a 09 09 09 09 09 20 da (test)......
3520: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 39 20 (debug:print 9
3530: 22 74 65 73 74 3a 20 22 20 74 65 73 74 29 0a 09 "test: " test)..
3540: 09 09 09 09 20 20 28 61 6e 64 20 28 76 65 63 74 .... (and (vect
3550: 6f 72 3f 20 74 65 73 74 29 20 3b 3b 20 6e 6f 74 or? test) ;; not
3560: 20 28 73 74 72 69 6e 67 3f 20 74 65 73 74 29 29 (string? test))
3570: 0a 09 09 09 09 09 20 20 20 20 20 20 20 28 65 71 ...... (eq
3580: 75 61 6c 3f 20 28 64 62 3a 74 65 73 74 2d 67 65 ual? (db:test-ge
3590: 74 2d 73 74 61 74 65 20 74 65 73 74 29 20 22 43 t-state test) "C
35a0: 4f 4d 50 4c 45 54 45 44 22 29 0a 09 09 09 09 09 OMPLETED")......
35b0: 20 20 20 20 20 20 20 28 6e 6f 74 20 28 6d 65 6d (not (mem
35c0: 62 65 72 20 28 64 62 3a 74 65 73 74 2d 67 65 74 ber (db:test-get
35d0: 2d 73 74 61 74 75 73 20 74 65 73 74 29 0a 09 09 -status test)...
35e0: 09 09 09 09 09 20 20 20 20 27 28 22 50 41 53 53 ..... '("PASS
35f0: 22 20 22 57 41 52 4e 22 20 22 43 48 45 43 4b 22 " "WARN" "CHECK"
3600: 20 22 57 41 49 56 45 44 22 29 29 29 29 29 0a 09 "WAIVED")))))..
3610: 09 09 09 09 70 72 65 72 65 71 73 2d 6e 6f 74 2d ....prereqs-not-
3620: 6d 65 74 29 29 29 0a 09 09 20 28 63 61 6c 63 2d met)))... (calc-
3630: 6e 6f 74 2d 63 6f 6d 70 6c 65 74 65 64 20 28 6c not-completed (l
3640: 61 6d 62 64 61 20 28 70 72 65 72 65 71 73 2d 6e ambda (prereqs-n
3650: 6f 74 2d 6d 65 74 29 0a 09 09 09 09 20 20 20 20 ot-met).....
3660: 20 20 20 28 66 69 6c 74 65 72 0a 09 09 09 09 09 (filter......
3670: 28 6c 61 6d 62 64 61 20 28 74 29 0a 09 09 09 09 (lambda (t).....
3680: 09 20 20 28 6f 72 20 28 6e 6f 74 20 28 76 65 63 . (or (not (vec
3690: 74 6f 72 3f 20 74 29 29 0a 09 09 09 09 09 20 20 tor? t))......
36a0: 20 20 20 20 28 6e 6f 74 20 28 65 71 75 61 6c 3f (not (equal?
36b0: 20 22 43 4f 4d 50 4c 45 54 45 44 22 20 28 64 62 "COMPLETED" (db
36c0: 3a 74 65 73 74 2d 67 65 74 2d 73 74 61 74 65 20 :test-get-state
36d0: 74 29 29 29 29 29 0a 09 09 09 09 09 70 72 65 72 t)))))......prer
36e0: 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 29 29 0a 09 eqs-not-met)))..
36f0: 09 20 28 70 72 65 74 74 79 2d 73 74 72 69 6e 67 . (pretty-string
3700: 20 28 6c 61 6d 62 64 61 20 28 6c 73 74 29 0a 09 (lambda (lst)..
3710: 09 09 09 20 20 28 6d 61 70 20 28 6c 61 6d 62 64 ... (map (lambd
3720: 61 20 28 74 29 0a 09 09 09 09 09 20 28 69 66 20 a (t)...... (if
3730: 28 6e 6f 74 20 28 76 65 63 74 6f 72 3f 20 74 29 (not (vector? t)
3740: 29 0a 09 09 09 09 09 20 20 20 20 20 28 63 6f 6e )...... (con
3750: 63 20 74 29 0a 09 09 09 09 09 20 20 20 20 20 28 c t)...... (
3760: 63 6f 6e 63 20 28 64 62 3a 74 65 73 74 2d 67 65 conc (db:test-ge
3770: 74 2d 74 65 73 74 6e 61 6d 65 20 74 29 20 22 3a t-testname t) ":
3780: 22 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 73 " (db:test-get-s
3790: 74 61 74 65 20 74 29 20 22 2f 22 20 28 64 62 3a tate t) "/" (db:
37a0: 74 65 73 74 2d 67 65 74 2d 73 74 61 74 75 73 20 test-get-status
37b0: 74 29 29 29 29 0a 09 09 09 09 20 20 20 20 20 20 t)))).....
37c0: 20 6c 73 74 29 29 29 29 0a 09 20 20 20 20 28 64 lst)))).. (d
37d0: 65 62 75 67 3a 70 72 69 6e 74 20 36 0a 09 09 09 ebug:print 6....
37e0: 20 22 69 74 65 6d 64 61 74 3a 20 20 20 20 20 22 "itemdat: "
37f0: 20 69 74 65 6d 64 61 74 0a 09 09 09 20 22 5c 6e itemdat.... "\n
3800: 20 20 69 74 65 6d 73 3a 20 20 20 20 20 22 20 69 items: " i
3810: 74 65 6d 73 0a 09 09 09 20 22 5c 6e 20 20 69 74 tems.... "\n it
3820: 65 6d 2d 70 61 74 68 3a 20 22 20 69 74 65 6d 2d em-path: " item-
3830: 70 61 74 68 0a 09 09 09 20 22 5c 6e 20 20 77 61 path.... "\n wa
3840: 69 74 6f 6e 73 3a 20 20 20 22 20 77 61 69 74 6f itons: " waito
3850: 6e 73 29 0a 0a 09 20 20 20 20 3b 3b 20 63 68 65 ns)... ;; che
3860: 63 6b 20 66 6f 72 20 68 65 64 20 69 6e 20 77 61 ck for hed in wa
3870: 69 74 6f 6e 73 20 3d 3e 20 74 68 69 73 20 77 6f itons => this wo
3880: 75 6c 64 20 62 65 20 63 69 72 63 75 6c 61 72 2c uld be circular,
3890: 20 72 65 6d 6f 76 65 20 69 74 20 61 6e 64 20 69 remove it and i
38a0: 73 73 75 65 20 61 6e 0a 09 20 20 20 20 3b 3b 20 ssue an.. ;;
38b0: 65 72 72 6f 72 0a 09 20 20 20 20 28 69 66 20 28 error.. (if (
38c0: 6d 65 6d 62 65 72 20 68 65 64 20 77 61 69 74 6f member hed waito
38d0: 6e 73 29 0a 09 09 28 62 65 67 69 6e 0a 09 09 20 ns)...(begin...
38e0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 (debug:print 0
38f0: 22 45 52 52 4f 52 3a 20 74 65 73 74 20 22 20 68 "ERROR: test " h
3900: 65 64 20 22 20 68 61 73 20 6c 69 73 74 65 64 20 ed " has listed
3910: 69 74 73 65 6c 66 20 61 73 20 61 20 77 61 69 74 itself as a wait
3920: 6f 6e 2c 20 70 6c 65 61 73 65 20 63 6f 72 72 65 on, please corre
3930: 63 74 20 74 68 69 73 21 22 29 0a 09 09 20 20 28 ct this!")... (
3940: 73 65 74 21 20 77 61 69 74 6f 6e 20 28 66 69 6c set! waiton (fil
3950: 74 65 72 20 28 6c 61 6d 62 64 61 20 28 78 29 28 ter (lambda (x)(
3960: 6e 6f 74 20 28 65 71 75 61 6c 3f 20 78 20 68 65 not (equal? x he
3970: 64 29 29 29 20 77 61 69 74 6f 6e 73 29 29 29 29 d))) waitons))))
3980: 0a 0a 09 20 20 20 20 28 63 6f 6e 64 0a 09 20 20 ... (cond..
3990: 20 20 20 28 28 6e 6f 74 20 69 74 65 6d 73 29 20 ((not items)
39a0: 3b 3b 20 77 68 65 6e 20 66 61 6c 73 65 20 74 68 ;; when false th
39b0: 65 20 74 65 73 74 20 69 73 20 6f 6b 20 74 6f 20 e test is ok to
39c0: 62 65 20 68 61 6e 64 65 64 20 6f 66 66 20 74 6f be handed off to
39d0: 20 6c 61 75 6e 63 68 20 28 62 75 74 20 6e 6f 74 launch (but not
39e0: 20 62 65 66 6f 72 65 29 0a 09 20 20 20 20 20 20 before)..
39f0: 28 6c 65 74 2a 20 28 28 68 61 76 65 2d 72 65 73 (let* ((have-res
3a00: 6f 75 72 63 65 73 20 20 28 6f 70 65 6e 2d 72 75 ources (open-ru
3a10: 6e 2d 63 6c 6f 73 65 20 72 75 6e 73 3a 63 61 6e n-close runs:can
3a20: 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 73 74 73 20 -run-more-tests
3a30: 23 66 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 #f test-record))
3a40: 20 3b 3b 20 6c 6f 6f 6b 20 61 74 20 74 68 65 20 ;; look at the
3a50: 74 65 73 74 20 6a 6f 62 67 72 6f 75 70 20 61 6e test jobgroup an
3a60: 64 20 74 6f 74 20 6a 6f 62 73 20 72 75 6e 6e 69 d tot jobs runni
3a70: 6e 67 0a 09 09 20 20 20 20 20 28 70 72 65 72 65 ng... (prere
3a80: 71 73 2d 6e 6f 74 2d 6d 65 74 20 28 6f 70 65 6e qs-not-met (open
3a90: 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 -run-close db:ge
3aa0: 74 2d 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 t-prereqs-not-me
3ab0: 74 20 23 66 20 72 75 6e 2d 69 64 20 77 61 69 74 t #f run-id wait
3ac0: 6f 6e 73 20 69 74 65 6d 2d 70 61 74 68 20 6d 6f ons item-path mo
3ad0: 64 65 3a 20 74 65 73 74 6d 6f 64 65 29 29 0a 09 de: testmode))..
3ae0: 09 20 20 20 20 20 28 66 61 69 6c 73 20 20 20 20 . (fails
3af0: 20 20 20 20 20 20 20 28 63 61 6c 63 2d 66 61 69 (calc-fai
3b00: 6c 73 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d ls prereqs-not-m
3b10: 65 74 29 29 0a 09 09 20 20 20 20 20 28 6e 6f 6e et))... (non
3b20: 2d 63 6f 6d 70 6c 65 74 65 64 20 20 20 28 63 61 -completed (ca
3b30: 6c 63 2d 6e 6f 74 2d 63 6f 6d 70 6c 65 74 65 64 lc-not-completed
3b40: 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 prereqs-not-met
3b50: 29 29 29 0a 09 09 28 64 65 62 75 67 3a 70 72 69 )))...(debug:pri
3b60: 6e 74 20 38 20 22 49 4e 46 4f 3a 20 68 61 76 65 nt 8 "INFO: have
3b70: 2d 72 65 73 6f 75 72 63 65 73 3a 20 22 20 68 61 -resources: " ha
3b80: 76 65 2d 72 65 73 6f 75 72 63 65 73 20 22 20 70 ve-resources " p
3b90: 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 3a 20 rereqs-not-met:
3ba0: 22 20 0a 09 09 09 20 20 20 20 20 28 73 74 72 69 " .... (stri
3bb0: 6e 67 2d 69 6e 74 65 72 73 70 65 72 73 65 20 0a ng-intersperse .
3bc0: 09 09 09 20 20 20 20 20 20 28 6d 61 70 20 28 6c ... (map (l
3bd0: 61 6d 62 64 61 20 28 74 29 0a 09 09 09 09 20 20 ambda (t).....
3be0: 20 20 20 28 69 66 20 28 76 65 63 74 6f 72 3f 20 (if (vector?
3bf0: 74 29 0a 09 09 09 09 09 20 28 63 6f 6e 63 20 28 t)...... (conc (
3c00: 64 62 3a 74 65 73 74 2d 67 65 74 2d 73 74 61 74 db:test-get-stat
3c10: 65 20 74 29 20 22 2f 22 20 28 64 62 3a 74 65 73 e t) "/" (db:tes
3c20: 74 2d 67 65 74 2d 73 74 61 74 75 73 20 74 29 29 t-get-status t))
3c30: 0a 09 09 09 09 09 20 28 63 6f 6e 63 20 22 20 57 ...... (conc " W
3c40: 41 52 4e 49 4e 47 3a 20 74 20 69 73 20 6e 6f 74 ARNING: t is not
3c50: 20 61 20 76 65 63 74 6f 72 3d 22 20 74 20 29 29 a vector=" t ))
3c60: 29 0a 09 09 09 09 20 20 20 70 72 65 72 65 71 73 )..... prereqs
3c70: 2d 6e 6f 74 2d 6d 65 74 29 20 22 2c 20 22 29 20 -not-met) ", ")
3c80: 22 20 66 61 69 6c 73 3a 20 22 20 66 61 69 6c 73 " fails: " fails
3c90: 29 0a 09 09 3b 3b 20 44 6f 6e 27 74 20 6b 6e 6f )...;; Don't kno
3ca0: 77 20 61 74 20 74 68 69 73 20 74 69 6d 65 20 69 w at this time i
3cb0: 66 20 74 68 65 20 74 65 73 74 20 68 61 76 65 20 f the test have
3cc0: 62 65 65 6e 20 6c 61 75 6e 63 68 65 64 20 61 74 been launched at
3cd0: 20 73 6f 6d 65 20 74 69 6d 65 20 69 6e 20 74 68 some time in th
3ce0: 65 20 70 61 73 74 0a 09 09 3b 3b 20 69 2e 65 2e e past...;; i.e.
3cf0: 20 69 73 20 74 68 69 73 20 61 20 72 65 2d 6c 61 is this a re-la
3d00: 75 6e 63 68 3f 0a 09 09 28 63 6f 6e 64 0a 09 09 unch?...(cond...
3d10: 20 28 28 61 6e 64 20 68 61 76 65 2d 72 65 73 6f ((and have-reso
3d20: 75 72 63 65 73 0a 09 09 20 20 20 20 20 20 20 28 urces... (
3d30: 6f 72 20 28 6e 75 6c 6c 3f 20 70 72 65 72 65 71 or (null? prereq
3d40: 73 2d 6e 6f 74 2d 6d 65 74 29 0a 09 09 09 20 20 s-not-met)....
3d50: 20 28 61 6e 64 20 28 65 71 3f 20 74 65 73 74 6d (and (eq? testm
3d60: 6f 64 65 20 27 74 6f 70 6c 65 76 65 6c 29 0a 09 ode 'toplevel)..
3d70: 09 09 09 28 6e 75 6c 6c 3f 20 6e 6f 6e 2d 63 6f ...(null? non-co
3d80: 6d 70 6c 65 74 65 64 29 29 29 29 0a 09 09 20 20 mpleted))))...
3d90: 3b 3b 20 6e 6f 20 6c 6f 6f 70 20 68 65 72 65 2c ;; no loop here,
3da0: 20 6a 75 73 74 20 64 72 6f 70 20 74 68 6f 75 67 just drop thoug
3db0: 68 20 61 6e 64 20 75 73 65 20 74 68 65 20 6c 6f h and use the lo
3dc0: 6f 70 20 61 74 20 74 68 65 20 62 6f 74 74 6f 6d op at the bottom
3dd0: 20 0a 09 09 20 20 28 69 66 20 28 70 61 74 74 2d ... (if (patt-
3de0: 6c 69 73 74 2d 6d 61 74 63 68 20 69 74 65 6d 2d list-match item-
3df0: 70 61 74 68 20 69 74 65 6d 2d 70 61 74 74 73 29 path item-patts)
3e00: 0a 09 09 20 20 20 20 20 20 28 72 75 6e 3a 74 65 ... (run:te
3e10: 73 74 20 72 75 6e 2d 69 64 20 72 75 6e 6e 61 6d st run-id runnam
3e20: 65 20 6b 65 79 76 61 6c 6c 73 74 20 74 65 73 74 e keyvallst test
3e30: 2d 72 65 63 6f 72 64 20 66 6c 61 67 73 20 23 66 -record flags #f
3e40: 29 0a 09 09 20 20 20 20 20 20 28 64 65 62 75 67 )... (debug
3e50: 3a 70 72 69 6e 74 20 31 20 22 49 4e 46 4f 3a 20 :print 1 "INFO:
3e60: 53 6b 69 70 70 69 6e 67 20 22 20 28 74 65 73 74 Skipping " (test
3e70: 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d s:testqueue-get-
3e80: 74 65 73 74 6e 61 6d 65 20 74 65 73 74 2d 72 65 testname test-re
3e90: 63 6f 72 64 29 20 22 20 22 20 69 74 65 6d 2d 70 cord) " " item-p
3ea0: 61 74 68 20 22 20 61 73 20 69 74 20 64 6f 65 73 ath " as it does
3eb0: 6e 27 74 20 6d 61 74 63 68 20 22 20 69 74 65 6d n't match " item
3ec0: 2d 70 61 74 74 73 29 29 0a 09 09 20 20 3b 3b 20 -patts))... ;;
3ed0: 65 6c 73 65 20 74 68 65 20 72 75 6e 20 69 73 20 else the run is
3ee0: 73 74 75 63 6b 2c 20 74 65 6d 70 6f 72 61 72 69 stuck, temporari
3ef0: 6c 79 20 6f 72 20 70 65 72 6d 61 6e 65 6e 74 6c ly or permanentl
3f00: 79 0a 09 09 20 20 3b 3b 20 62 75 74 20 73 68 6f y... ;; but sho
3f10: 75 6c 64 20 63 68 65 63 6b 20 69 66 20 69 74 20 uld check if it
3f20: 69 73 20 64 75 65 20 74 6f 20 6c 61 63 6b 20 6f is due to lack o
3f30: 66 20 72 65 73 6f 75 72 63 65 73 20 76 73 2e 20 f resources vs.
3f40: 70 72 65 72 65 71 75 69 73 69 74 65 73 0a 09 09 prerequisites...
3f50: 20 20 29 0a 09 09 20 28 28 6e 6f 74 20 68 61 76 )... ((not hav
3f60: 65 2d 72 65 73 6f 75 72 63 65 73 29 20 3b 3b 20 e-resources) ;;
3f70: 73 69 6d 70 6c 79 20 74 72 79 20 61 67 61 69 6e simply try again
3f80: 20 61 66 74 65 72 20 77 61 69 74 69 6e 67 20 61 after waiting a
3f90: 20 73 65 63 6f 6e 64 0a 09 09 20 20 28 74 68 72 second... (thr
3fa0: 65 61 64 2d 73 6c 65 65 70 21 20 28 2a 20 2a 67 ead-sleep! (* *g
3fb0: 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 20 2a 67 6c lobal-delta* *gl
3fc0: 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 29 0a 09 09 obal-delta*))...
3fd0: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 31 (debug:print 1
3fe0: 20 22 49 4e 46 4f 3a 20 6e 6f 20 72 65 73 6f 75 "INFO: no resou
3ff0: 72 63 65 73 20 74 6f 20 72 75 6e 20 6e 65 77 20 rces to run new
4000: 74 65 73 74 73 2c 20 77 61 69 74 69 6e 67 20 2e tests, waiting .
4010: 2e 2e 22 29 0a 09 09 20 20 3b 3b 20 63 6f 75 6c ..")... ;; coul
4020: 64 20 68 61 76 65 20 64 6f 6e 65 20 68 65 64 20 d have done hed
4030: 74 61 6c 20 68 65 72 65 20 62 75 74 20 64 6f 69 tal here but doi
4040: 6e 67 20 63 61 72 2f 63 64 72 20 6f 66 20 6e 65 ng car/cdr of ne
4050: 77 74 61 6c 20 74 6f 20 72 6f 74 61 74 65 20 74 wtal to rotate t
4060: 65 73 74 73 0a 09 09 20 20 28 6c 6f 6f 70 20 28 ests... (loop (
4070: 63 61 72 20 6e 65 77 74 61 6c 29 28 63 64 72 20 car newtal)(cdr
4080: 6e 65 77 74 61 6c 29 29 29 0a 09 09 20 28 65 6c newtal)))... (el
4090: 73 65 20 3b 3b 20 6d 75 73 74 20 62 65 20 77 65 se ;; must be we
40a0: 20 68 61 76 65 20 75 6e 6d 65 74 20 70 72 65 72 have unmet prer
40b0: 65 71 75 69 73 69 74 65 73 0a 09 09 20 20 20 20 equisites...
40c0: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 22 (debug:print 4 "
40d0: 46 41 49 4c 53 3a 20 22 20 66 61 69 6c 73 29 0a FAILS: " fails).
40e0: 09 09 20 20 20 20 3b 3b 20 49 66 20 6f 6e 65 20 .. ;; If one
40f0: 6f 72 20 6d 6f 72 65 20 6f 66 20 74 68 65 20 70 or more of the p
4100: 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 20 61 rereqs-not-met a
4110: 72 65 20 46 41 49 4c 20 74 68 65 6e 20 77 65 20 re FAIL then we
4120: 63 61 6e 20 69 73 73 75 65 0a 09 09 20 20 20 20 can issue...
4130: 3b 3b 20 61 20 6d 65 73 73 61 67 65 20 61 6e 64 ;; a message and
4140: 20 64 72 6f 70 20 68 65 64 20 66 72 6f 6d 20 74 drop hed from t
4150: 68 65 20 69 74 65 6d 73 20 74 6f 20 62 65 20 70 he items to be p
4160: 72 6f 63 65 73 73 65 64 2e 0a 09 09 20 20 20 20 rocessed....
4170: 28 69 66 20 28 6e 75 6c 6c 3f 20 66 61 69 6c 73 (if (null? fails
4180: 29 0a 09 09 09 28 62 65 67 69 6e 0a 09 09 09 20 )....(begin....
4190: 20 3b 3b 20 63 6f 75 6c 64 6e 27 74 20 72 75 6e ;; couldn't run
41a0: 2c 20 74 61 6b 65 20 61 20 62 72 65 61 74 68 65 , take a breathe
41b0: 72 0a 09 09 09 20 20 28 64 65 62 75 67 3a 70 72 r.... (debug:pr
41c0: 69 6e 74 20 34 20 22 49 4e 46 4f 3a 20 53 68 6f int 4 "INFO: Sho
41d0: 75 6c 64 6e 27 74 20 72 65 61 6c 6c 79 20 67 65 uldn't really ge
41e0: 74 20 68 65 72 65 2c 20 72 61 63 65 20 63 6f 6e t here, race con
41f0: 64 69 74 69 6f 6e 3f 20 55 6e 61 62 6c 65 20 74 dition? Unable t
4200: 6f 20 6c 61 75 6e 63 68 20 6d 6f 72 65 20 74 65 o launch more te
4210: 73 74 73 20 61 74 20 74 68 69 73 20 6d 6f 6d 65 sts at this mome
4220: 6e 74 2c 20 6b 69 6c 6c 69 6e 67 20 74 69 6d 65 nt, killing time
4230: 20 2e 2e 2e 22 29 0a 09 09 09 20 20 28 74 68 72 ...").... (thr
4240: 65 61 64 2d 73 6c 65 65 70 21 20 28 2a 20 2a 67 ead-sleep! (* *g
4250: 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 20 2a 67 6c lobal-delta* *gl
4260: 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 29 20 3b 3b obal-delta*)) ;;
4270: 20 6c 6f 6e 67 20 73 6c 65 65 70 20 68 65 72 65 long sleep here
4280: 20 2d 20 6e 6f 20 72 65 73 6f 75 72 63 65 73 2c - no resources,
4290: 20 6d 61 79 20 61 73 20 77 65 6c 6c 20 62 65 20 may as well be
42a0: 70 61 74 69 65 6e 74 0a 09 09 09 20 20 3b 3b 20 patient.... ;;
42b0: 77 65 20 6d 61 64 65 20 6e 65 77 20 74 61 6c 20 we made new tal
42c0: 62 79 20 73 74 69 63 6b 69 6e 67 20 68 65 64 20 by sticking hed
42d0: 61 74 20 74 68 65 20 62 61 63 6b 20 6f 66 20 74 at the back of t
42e0: 68 65 20 6c 69 73 74 0a 09 09 09 20 20 28 6c 6f he list.... (lo
42f0: 6f 70 20 28 63 61 72 20 6e 65 77 74 61 6c 29 28 op (car newtal)(
4300: 63 64 72 20 6e 65 77 74 61 6c 29 29 29 0a 09 09 cdr newtal)))...
4310: 09 3b 3b 20 74 68 65 20 77 61 69 74 6f 6e 20 69 .;; the waiton i
4320: 73 20 46 41 49 4c 20 73 6f 20 6e 6f 20 70 6f 69 s FAIL so no poi
4330: 6e 74 20 69 6e 20 74 72 79 69 6e 67 20 74 6f 20 nt in trying to
4340: 72 75 6e 20 68 65 64 20 65 76 65 72 20 61 67 61 run hed ever aga
4350: 69 6e 0a 09 09 09 28 69 66 20 28 6e 6f 74 20 28 in....(if (not (
4360: 6e 75 6c 6c 3f 20 74 61 6c 29 29 0a 09 09 09 20 null? tal))....
4370: 20 20 20 28 62 65 67 69 6e 0a 09 09 09 20 20 20 (begin....
4380: 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 (debug:print
4390: 31 20 22 57 41 52 4e 3a 20 44 72 6f 70 70 69 6e 1 "WARN: Droppin
43a0: 67 20 74 65 73 74 20 22 20 28 64 62 3a 74 65 73 g test " (db:tes
43b0: 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 68 t-get-testname h
43c0: 65 64 29 20 22 2f 22 20 28 64 62 3a 74 65 73 74 ed) "/" (db:test
43d0: 2d 67 65 74 2d 69 74 65 6d 2d 70 61 74 68 20 68 -get-item-path h
43e0: 65 64 29 0a 09 09 09 09 09 20 20 20 22 20 66 72 ed)...... " fr
43f0: 6f 6d 20 74 68 65 20 6c 61 75 6e 63 68 20 6c 69 om the launch li
4400: 73 74 20 61 73 20 69 74 20 68 61 73 20 70 72 65 st as it has pre
4410: 72 65 71 75 69 73 74 65 73 20 74 68 61 74 20 61 requistes that a
4420: 72 65 20 46 41 49 4c 22 29 0a 09 09 09 20 20 20 re FAIL")....
4430: 20 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 74 61 (loop (car ta
4440: 6c 29 28 63 64 72 20 74 61 6c 29 29 29 29 29 29 l)(cdr tal))))))
4450: 29 29 29 0a 09 20 20 20 20 20 0a 09 20 20 20 20 ))).. ..
4460: 20 3b 3b 20 63 61 73 65 20 77 68 65 72 65 20 61 ;; case where a
4470: 6e 20 69 74 65 6d 73 20 63 61 6d 65 20 69 6e 20 n items came in
4480: 61 73 20 61 20 6c 69 73 74 20 62 65 65 6e 20 70 as a list been p
4490: 72 6f 63 65 73 73 65 64 0a 09 20 20 20 20 20 28 rocessed.. (
44a0: 28 61 6e 64 20 28 6c 69 73 74 3f 20 69 74 65 6d (and (list? item
44b0: 73 29 20 20 20 20 20 3b 3b 20 74 68 75 73 20 77 s) ;; thus w
44c0: 65 20 6b 6e 6f 77 20 6f 75 72 20 69 74 65 6d 73 e know our items
44d0: 20 61 72 65 20 61 6c 72 65 61 64 79 20 63 61 6c are already cal
44e0: 63 75 6c 61 74 65 64 0a 09 09 20 20 20 28 6e 6f culated... (no
44f0: 74 20 20 20 69 74 65 6d 64 61 74 29 29 20 3b 3b t itemdat)) ;;
4500: 20 61 6e 64 20 6e 6f 74 20 79 65 74 20 65 78 70 and not yet exp
4510: 61 6e 64 65 64 20 69 6e 74 6f 20 74 68 65 20 6c anded into the l
4520: 69 73 74 20 6f 66 20 74 68 69 6e 67 73 20 74 6f ist of things to
4530: 20 62 65 20 64 6f 6e 65 0a 09 20 20 20 20 20 20 be done..
4540: 28 69 66 20 28 61 6e 64 20 28 3e 3d 20 2a 76 65 (if (and (>= *ve
4550: 72 62 6f 73 69 74 79 2a 20 31 29 0a 09 09 20 20 rbosity* 1)...
4560: 20 20 20 20 20 28 3e 20 28 6c 65 6e 67 74 68 20 (> (length
4570: 69 74 65 6d 73 29 20 30 29 0a 09 09 20 20 20 20 items) 0)...
4580: 20 20 20 28 3e 20 28 6c 65 6e 67 74 68 20 28 63 (> (length (c
4590: 61 72 20 69 74 65 6d 73 29 29 20 30 29 29 0a 09 ar items)) 0))..
45a0: 09 20 20 28 70 70 20 69 74 65 6d 73 29 29 0a 09 . (pp items))..
45b0: 20 20 20 20 20 20 3b 3b 20 28 69 66 20 28 3e 3d ;; (if (>=
45c0: 20 2a 76 65 72 62 6f 73 69 74 79 2a 20 35 29 0a *verbosity* 5).
45d0: 09 20 20 20 20 20 20 3b 3b 20 20 20 20 20 28 62 . ;; (b
45e0: 65 67 69 6e 0a 09 20 20 20 20 20 20 3b 3b 20 20 egin.. ;;
45f0: 20 20 20 20 20 28 70 72 69 6e 74 20 22 69 74 65 (print "ite
4600: 6d 73 3a 20 22 29 20 20 20 20 20 28 70 70 20 28 ms: ") (pp (
4610: 69 74 65 6d 2d 61 73 73 6f 63 2d 3e 69 74 65 6d item-assoc->item
4620: 2d 6c 69 73 74 20 69 74 65 6d 73 29 29 0a 09 20 -list items))..
4630: 20 20 20 20 20 3b 3b 20 20 20 20 20 20 20 28 70 ;; (p
4640: 72 69 6e 74 20 22 69 74 65 6d 73 74 61 62 6c 65 rint "itemstable
4650: 3a 20 22 29 28 70 70 20 28 69 74 65 6d 2d 74 61 : ")(pp (item-ta
4660: 62 6c 65 2d 3e 69 74 65 6d 2d 6c 69 73 74 20 69 ble->item-list i
4670: 74 65 6d 73 74 61 62 6c 65 29 29 29 29 0a 09 20 temstable))))..
4680: 20 20 20 20 20 28 66 6f 72 2d 65 61 63 68 0a 09 (for-each..
4690: 20 20 20 20 20 20 20 28 6c 61 6d 62 64 61 20 28 (lambda (
46a0: 6d 79 2d 69 74 65 6d 64 61 74 29 0a 09 09 20 28 my-itemdat)... (
46b0: 6c 65 74 2a 20 28 28 6e 65 77 2d 74 65 73 74 2d let* ((new-test-
46c0: 72 65 63 6f 72 64 20 28 6c 65 74 20 28 28 6e 65 record (let ((ne
46d0: 77 72 65 63 20 28 6d 61 6b 65 2d 74 65 73 74 73 wrec (make-tests
46e0: 3a 74 65 73 74 71 75 65 75 65 29 29 29 0a 09 09 :testqueue)))...
46f0: 09 09 09 20 20 20 28 76 65 63 74 6f 72 2d 63 6f ... (vector-co
4700: 70 79 21 20 74 65 73 74 2d 72 65 63 6f 72 64 20 py! test-record
4710: 6e 65 77 72 65 63 29 0a 09 09 09 09 09 20 20 20 newrec)......
4720: 6e 65 77 72 65 63 29 29 0a 09 09 09 28 6d 79 2d newrec))....(my-
4730: 69 74 65 6d 2d 70 61 74 68 20 28 69 74 65 6d 2d item-path (item-
4740: 6c 69 73 74 2d 3e 70 61 74 68 20 6d 79 2d 69 74 list->path my-it
4750: 65 6d 64 61 74 29 29 29 0a 09 09 20 20 20 28 69 emdat)))... (i
4760: 66 20 28 70 61 74 74 2d 6c 69 73 74 2d 6d 61 74 f (patt-list-mat
4770: 63 68 20 6d 79 2d 69 74 65 6d 2d 70 61 74 68 20 ch my-item-path
4780: 69 74 65 6d 2d 70 61 74 74 73 29 20 20 20 20 20 item-patts)
4790: 20 20 20 20 20 20 3b 3b 20 79 65 73 2c 20 77 65 ;; yes, we
47a0: 20 77 61 6e 74 20 74 6f 20 70 72 6f 63 65 73 73 want to process
47b0: 20 74 68 69 73 20 69 74 65 6d 2c 20 4e 4f 54 45 this item, NOTE
47c0: 3a 20 53 68 6f 75 6c 64 20 6e 6f 74 20 6e 65 65 : Should not nee
47d0: 64 20 74 68 69 73 20 63 68 65 63 6b 20 68 65 72 d this check her
47e0: 65 21 0a 09 09 20 20 20 20 20 20 20 28 6c 65 74 e!... (let
47f0: 20 28 28 6e 65 77 74 65 73 74 6e 61 6d 65 20 28 ((newtestname (
4800: 63 6f 6e 63 20 68 65 64 20 22 2f 22 20 6d 79 2d conc hed "/" my-
4810: 69 74 65 6d 2d 70 61 74 68 29 29 29 20 20 20 20 item-path)))
4820: 3b 3b 20 74 65 73 74 20 6e 61 6d 65 73 20 61 72 ;; test names ar
4830: 65 20 75 6e 69 71 75 65 20 6f 6e 20 74 65 73 74 e unique on test
4840: 6e 61 6d 65 2f 69 74 65 6d 2d 70 61 74 68 0a 09 name/item-path..
4850: 09 09 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 .. (tests:testqu
4860: 65 75 65 2d 73 65 74 2d 69 74 65 6d 73 21 20 20 eue-set-items!
4870: 20 20 20 6e 65 77 2d 74 65 73 74 2d 72 65 63 6f new-test-reco
4880: 72 64 20 23 66 29 0a 09 09 09 20 28 74 65 73 74 rd #f).... (test
4890: 73 3a 74 65 73 74 71 75 65 75 65 2d 73 65 74 2d s:testqueue-set-
48a0: 69 74 65 6d 64 61 74 21 20 20 20 6e 65 77 2d 74 itemdat! new-t
48b0: 65 73 74 2d 72 65 63 6f 72 64 20 6d 79 2d 69 74 est-record my-it
48c0: 65 6d 64 61 74 29 0a 09 09 09 20 28 74 65 73 74 emdat).... (test
48d0: 73 3a 74 65 73 74 71 75 65 75 65 2d 73 65 74 2d s:testqueue-set-
48e0: 69 74 65 6d 5f 70 61 74 68 21 20 6e 65 77 2d 74 item_path! new-t
48f0: 65 73 74 2d 72 65 63 6f 72 64 20 6d 79 2d 69 74 est-record my-it
4900: 65 6d 2d 70 61 74 68 29 0a 09 09 09 20 28 68 61 em-path).... (ha
4910: 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 74 65 sh-table-set! te
4920: 73 74 2d 72 65 63 6f 72 64 73 20 6e 65 77 74 65 st-records newte
4930: 73 74 6e 61 6d 65 20 6e 65 77 2d 74 65 73 74 2d stname new-test-
4940: 72 65 63 6f 72 64 29 0a 09 09 09 20 28 73 65 74 record).... (set
4950: 21 20 74 61 6c 20 28 63 6f 6e 73 20 6e 65 77 74 ! tal (cons newt
4960: 65 73 74 6e 61 6d 65 20 74 61 6c 29 29 29 29 29 estname tal)))))
4970: 29 20 3b 3b 20 73 69 6e 63 65 20 74 68 65 73 65 ) ;; since these
4980: 20 61 72 65 20 69 74 65 6d 69 7a 65 64 20 63 72 are itemized cr
4990: 65 61 74 65 20 6e 65 77 20 74 65 73 74 20 6e 61 eate new test na
49a0: 6d 65 73 20 74 65 73 74 6e 61 6d 65 2f 69 74 65 mes testname/ite
49b0: 6d 70 61 74 68 0a 09 20 20 20 20 20 20 20 69 74 mpath.. it
49c0: 65 6d 73 29 0a 09 20 20 20 20 20 20 28 69 66 20 ems).. (if
49d0: 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 (not (null? tal)
49e0: 29 0a 09 09 20 20 28 6c 6f 6f 70 20 28 63 61 72 )... (loop (car
49f0: 20 74 61 6c 29 28 63 64 72 20 74 61 6c 29 29 29 tal)(cdr tal)))
4a00: 29 0a 0a 09 20 20 20 20 20 3b 3b 20 69 66 20 69 )... ;; if i
4a10: 74 65 6d 73 20 69 73 20 61 20 70 72 6f 63 20 74 tems is a proc t
4a20: 68 65 6e 20 6e 65 65 64 20 74 6f 20 72 75 6e 20 hen need to run
4a30: 69 74 65 6d 73 3a 67 65 74 2d 69 74 65 6d 73 2d items:get-items-
4a40: 66 72 6f 6d 2d 63 6f 6e 66 69 67 2c 20 67 65 74 from-config, get
4a50: 20 74 68 65 20 6c 69 73 74 20 61 6e 64 20 6c 6f the list and lo
4a60: 6f 70 20 0a 09 20 20 20 20 20 3b 3b 20 20 20 20 op .. ;;
4a70: 2d 20 62 75 74 20 6f 6e 6c 79 20 64 6f 20 74 68 - but only do th
4a80: 61 74 20 69 66 20 72 65 73 6f 75 72 63 65 73 20 at if resources
4a90: 65 78 69 73 74 20 74 6f 20 6b 69 63 6b 20 6f 66 exist to kick of
4aa0: 66 20 74 68 65 20 6a 6f 62 0a 09 20 20 20 20 20 f the job..
4ab0: 28 28 6f 72 20 28 70 72 6f 63 65 64 75 72 65 3f ((or (procedure?
4ac0: 20 69 74 65 6d 73 29 28 65 71 3f 20 69 74 65 6d items)(eq? item
4ad0: 73 20 27 68 61 76 65 2d 70 72 6f 63 65 64 75 72 s 'have-procedur
4ae0: 65 29 29 0a 09 20 20 20 20 20 20 28 6c 65 74 20 e)).. (let
4af0: 28 28 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 20 20 ((can-run-more
4b00: 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 (open-run-clos
4b10: 65 20 72 75 6e 73 3a 63 61 6e 2d 72 75 6e 2d 6d e runs:can-run-m
4b20: 6f 72 65 2d 74 65 73 74 73 20 23 66 20 74 65 73 ore-tests #f tes
4b30: 74 2d 72 65 63 6f 72 64 29 29 29 0a 09 09 28 69 t-record)))...(i
4b40: 66 20 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 0a 09 f can-run-more..
4b50: 09 20 20 20 20 28 6c 65 74 2a 20 28 28 70 72 65 . (let* ((pre
4b60: 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 20 28 6f 70 reqs-not-met (op
4b70: 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a en-run-close db:
4b80: 67 65 74 2d 70 72 65 72 65 71 73 2d 6e 6f 74 2d get-prereqs-not-
4b90: 6d 65 74 20 23 66 20 72 75 6e 2d 69 64 20 77 61 met #f run-id wa
4ba0: 69 74 6f 6e 73 20 69 74 65 6d 2d 70 61 74 68 20 itons item-path
4bb0: 6d 6f 64 65 3a 20 74 65 73 74 6d 6f 64 65 29 29 mode: testmode))
4bc0: 0a 09 09 09 20 20 20 28 66 61 69 6c 73 20 20 20 .... (fails
4bd0: 20 20 20 20 20 20 20 20 28 63 61 6c 63 2d 66 61 (calc-fa
4be0: 69 6c 73 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d ils prereqs-not-
4bf0: 6d 65 74 29 29 0a 09 09 09 20 20 20 28 6e 6f 6e met)).... (non
4c00: 2d 63 6f 6d 70 6c 65 74 65 64 20 20 20 28 63 61 -completed (ca
4c10: 6c 63 2d 6e 6f 74 2d 63 6f 6d 70 6c 65 74 65 64 lc-not-completed
4c20: 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 prereqs-not-met
4c30: 29 29 29 0a 09 09 20 20 20 20 20 20 28 64 65 62 )))... (deb
4c40: 75 67 3a 70 72 69 6e 74 20 38 20 22 49 4e 46 4f ug:print 8 "INFO
4c50: 3a 20 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 3a 20 : can-run-more:
4c60: 22 20 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 0a 09 " can-run-more..
4c70: 09 09 09 20 20 20 22 5c 6e 20 70 72 65 72 65 71 ... "\n prereq
4c80: 73 2d 6e 6f 74 2d 6d 65 74 3a 20 22 20 28 70 72 s-not-met: " (pr
4c90: 65 74 74 79 2d 73 74 72 69 6e 67 20 70 72 65 72 etty-string prer
4ca0: 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 0a 09 09 09 eqs-not-met)....
4cb0: 09 20 20 20 22 5c 6e 20 6e 6f 6e 2d 63 6f 6d 70 . "\n non-comp
4cc0: 6c 65 74 65 64 3a 20 20 20 22 20 28 70 72 65 74 leted: " (pret
4cd0: 74 79 2d 73 74 72 69 6e 67 20 6e 6f 6e 2d 63 6f ty-string non-co
4ce0: 6d 70 6c 65 74 65 64 29 20 0a 09 09 09 09 20 20 mpleted) .....
4cf0: 20 22 5c 6e 20 66 61 69 6c 73 3a 20 20 20 20 20 "\n fails:
4d00: 20 20 20 20 20 20 22 20 28 70 72 65 74 74 79 2d " (pretty-
4d10: 73 74 72 69 6e 67 20 66 61 69 6c 73 29 0a 09 09 string fails)...
4d20: 09 09 20 20 20 22 5c 6e 20 74 65 73 74 6d 6f 64 .. "\n testmod
4d30: 65 3a 20 20 20 20 20 20 20 20 22 20 74 65 73 74 e: " test
4d40: 6d 6f 64 65 0a 09 09 09 09 20 20 20 22 5c 6e 20 mode..... "\n
4d50: 28 65 71 3f 20 74 65 73 74 6d 6f 64 65 20 27 74 (eq? testmode 't
4d60: 6f 70 6c 65 76 65 6c 29 20 22 20 28 65 71 3f 20 oplevel) " (eq?
4d70: 74 65 73 74 6d 6f 64 65 20 27 74 6f 70 6c 65 76 testmode 'toplev
4d80: 65 6c 29 0a 09 09 09 09 20 20 20 22 5c 6e 20 28 el)..... "\n (
4d90: 6e 75 6c 6c 3f 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 null? non-comple
4da0: 74 65 64 29 20 20 20 20 22 20 28 6e 75 6c 6c 3f ted) " (null?
4db0: 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 74 65 64 29 29 non-completed))
4dc0: 0a 09 09 20 20 20 20 20 20 28 63 6f 6e 64 20 0a ... (cond .
4dd0: 09 09 20 20 20 20 20 20 20 28 28 6f 72 20 28 6e .. ((or (n
4de0: 75 6c 6c 3f 20 70 72 65 72 65 71 73 2d 6e 6f 74 ull? prereqs-not
4df0: 2d 6d 65 74 29 20 3b 3b 20 61 6c 6c 20 70 72 65 -met) ;; all pre
4e00: 72 65 71 73 20 6d 65 74 2c 20 66 69 72 65 20 6f reqs met, fire o
4e10: 66 66 20 74 68 65 20 74 65 73 74 0a 09 09 09 20 ff the test....
4e20: 20 20 20 3b 3b 20 6f 72 2c 20 69 66 20 69 74 20 ;; or, if it
4e30: 69 73 20 61 20 27 74 6f 70 6c 65 76 65 6c 20 74 is a 'toplevel t
4e40: 65 73 74 20 61 6e 64 20 61 6c 6c 20 70 72 65 72 est and all prer
4e50: 65 71 73 20 6e 6f 74 20 6d 65 74 20 61 72 65 20 eqs not met are
4e60: 43 4f 4d 50 4c 45 54 45 44 20 74 68 65 6e 20 6c COMPLETED then l
4e70: 61 75 6e 63 68 0a 09 09 09 20 20 20 20 28 61 6e aunch.... (an
4e80: 64 20 28 65 71 3f 20 74 65 73 74 6d 6f 64 65 20 d (eq? testmode
4e90: 27 74 6f 70 6c 65 76 65 6c 29 0a 09 09 09 09 20 'toplevel).....
4ea0: 28 6e 75 6c 6c 3f 20 6e 6f 6e 2d 63 6f 6d 70 6c (null? non-compl
4eb0: 65 74 65 64 29 29 29 0a 09 09 09 28 6c 65 74 20 eted)))....(let
4ec0: 28 28 74 65 73 74 2d 6e 61 6d 65 20 28 74 65 73 ((test-name (tes
4ed0: 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 ts:testqueue-get
4ee0: 2d 74 65 73 74 6e 61 6d 65 20 74 65 73 74 2d 72 -testname test-r
4ef0: 65 63 6f 72 64 29 29 29 0a 09 09 09 20 20 28 73 ecord))).... (s
4f00: 65 74 65 6e 76 20 22 4d 54 5f 54 45 53 54 5f 4e etenv "MT_TEST_N
4f10: 41 4d 45 22 20 74 65 73 74 2d 6e 61 6d 65 29 20 AME" test-name)
4f20: 3b 3b 20 0a 09 09 09 20 20 28 73 65 74 65 6e 76 ;; .... (setenv
4f30: 20 22 4d 54 5f 52 55 4e 4e 41 4d 45 22 20 20 20 "MT_RUNNAME"
4f40: 72 75 6e 6e 61 6d 65 29 0a 09 09 09 20 20 28 6f runname).... (o
4f50: 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 2d 6d 65 pen-run-close-me
4f60: 61 73 75 72 65 20 73 65 74 2d 6d 65 67 61 74 65 asure set-megate
4f70: 73 74 2d 65 6e 76 2d 76 61 72 73 20 23 66 20 72 st-env-vars #f r
4f80: 75 6e 2d 69 64 29 20 3b 3b 20 74 68 65 73 65 20 un-id) ;; these
4f90: 6d 61 79 20 62 65 20 6e 65 65 64 65 64 20 62 79 may be needed by
4fa0: 20 74 68 65 20 6c 61 75 6e 63 68 69 6e 67 20 70 the launching p
4fb0: 72 6f 63 65 73 73 0a 09 09 09 20 20 28 6c 65 74 rocess.... (let
4fc0: 20 28 28 69 74 65 6d 73 2d 6c 69 73 74 20 28 69 ((items-list (i
4fd0: 74 65 6d 73 3a 67 65 74 2d 69 74 65 6d 73 2d 66 tems:get-items-f
4fe0: 72 6f 6d 2d 63 6f 6e 66 69 67 20 74 63 6f 6e 66 rom-config tconf
4ff0: 69 67 29 29 29 0a 09 09 09 20 20 20 20 28 69 66 ig))).... (if
5000: 20 28 6c 69 73 74 3f 20 69 74 65 6d 73 2d 6c 69 (list? items-li
5010: 73 74 29 0a 09 09 09 09 28 62 65 67 69 6e 0a 09 st).....(begin..
5020: 09 09 09 20 20 28 74 65 73 74 73 3a 74 65 73 74 ... (tests:test
5030: 71 75 65 75 65 2d 73 65 74 2d 69 74 65 6d 73 21 queue-set-items!
5040: 20 74 65 73 74 2d 72 65 63 6f 72 64 20 69 74 65 test-record ite
5050: 6d 73 2d 6c 69 73 74 29 0a 09 09 09 09 20 20 28 ms-list)..... (
5060: 6c 6f 6f 70 20 68 65 64 20 74 61 6c 29 29 0a 09 loop hed tal))..
5070: 09 09 09 28 62 65 67 69 6e 0a 09 09 09 09 20 20 ...(begin.....
5080: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 (debug:print 0 "
5090: 45 52 52 4f 52 3a 20 54 68 65 20 70 72 6f 63 20 ERROR: The proc
50a0: 66 72 6f 6d 20 72 65 61 64 69 6e 67 20 74 68 65 from reading the
50b0: 20 73 65 74 75 70 20 64 69 64 20 6e 6f 74 20 79 setup did not y
50c0: 69 65 6c 64 20 61 20 6c 69 73 74 20 2d 20 70 6c ield a list - pl
50d0: 65 61 73 65 20 72 65 70 6f 72 74 20 74 68 69 73 ease report this
50e0: 22 29 0a 09 09 09 09 20 20 28 65 78 69 74 20 31 ")..... (exit 1
50f0: 29 29 29 29 29 29 0a 09 09 20 20 20 20 20 20 20 ))))))...
5100: 28 28 6e 75 6c 6c 3f 20 66 61 69 6c 73 29 0a 09 ((null? fails)..
5110: 09 09 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 ..(loop (car new
5120: 74 61 6c 29 28 63 64 72 20 6e 65 77 74 61 6c 29 tal)(cdr newtal)
5130: 29 29 20 3b 3b 20 61 6e 20 69 73 73 75 65 20 77 )) ;; an issue w
5140: 69 74 68 20 70 72 65 72 65 71 73 20 6e 6f 74 20 ith prereqs not
5150: 79 65 74 20 6d 65 74 3f 0a 09 09 20 20 20 20 20 yet met?...
5160: 20 20 28 28 61 6e 64 20 28 6e 6f 74 20 28 6e 75 ((and (not (nu
5170: 6c 6c 3f 20 66 61 69 6c 73 29 29 28 65 71 3f 20 ll? fails))(eq?
5180: 74 65 73 74 6d 6f 64 65 20 27 6e 6f 72 6d 61 6c testmode 'normal
5190: 29 29 0a 09 09 09 28 64 65 62 75 67 3a 70 72 69 ))....(debug:pri
51a0: 6e 74 20 31 20 22 49 4e 46 4f 3a 20 74 65 73 74 nt 1 "INFO: test
51b0: 20 22 20 20 68 65 64 20 22 20 28 6d 6f 64 65 3d " hed " (mode=
51c0: 22 20 74 65 73 74 6d 6f 64 65 20 22 29 20 68 61 " testmode ") ha
51d0: 73 20 66 61 69 6c 65 64 20 70 72 65 72 65 71 75 s failed prerequ
51e0: 69 73 69 74 65 28 73 29 3b 20 22 0a 09 09 09 09 isite(s); ".....
51f0: 20 20 20 20 20 28 73 74 72 69 6e 67 2d 69 6e 74 (string-int
5200: 65 72 73 70 65 72 73 65 20 28 6d 61 70 20 28 6c ersperse (map (l
5210: 61 6d 62 64 61 20 28 74 29 28 63 6f 6e 63 20 28 ambda (t)(conc (
5220: 64 62 3a 74 65 73 74 2d 67 65 74 2d 74 65 73 74 db:test-get-test
5230: 6e 61 6d 65 20 74 29 20 22 3a 22 20 28 64 62 3a name t) ":" (db:
5240: 74 65 73 74 2d 67 65 74 2d 73 74 61 74 65 20 74 test-get-state t
5250: 29 22 2f 22 28 64 62 3a 74 65 73 74 2d 67 65 74 )"/"(db:test-get
5260: 2d 73 74 61 74 75 73 20 74 29 29 29 20 66 61 69 -status t))) fai
5270: 6c 73 29 20 22 2c 20 22 29 0a 09 09 09 09 20 20 ls) ", ").....
5280: 20 20 20 22 2c 20 72 65 6d 6f 76 69 6e 67 20 69 ", removing i
5290: 74 20 66 72 6f 6d 20 74 6f 2d 64 6f 20 6c 69 73 t from to-do lis
52a0: 74 22 29 0a 09 09 09 28 69 66 20 28 6e 6f 74 20 t")....(if (not
52b0: 28 6e 75 6c 6c 3f 20 74 61 6c 29 29 0a 09 09 09 (null? tal))....
52c0: 20 20 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 74 (loop (car t
52d0: 61 6c 29 28 63 64 72 20 74 61 6c 29 29 29 29 0a al)(cdr tal)))).
52e0: 09 09 20 20 20 20 20 20 20 28 65 6c 73 65 0a 09 .. (else..
52f0: 09 09 28 64 65 62 75 67 3a 70 72 69 6e 74 20 38 ..(debug:print 8
5300: 20 22 45 52 52 4f 52 3a 20 4e 6f 20 68 61 6e 64 "ERROR: No hand
5310: 6c 65 72 20 66 6f 72 20 74 68 69 73 20 63 6f 6e ler for this con
5320: 64 69 74 69 6f 6e 2e 22 29 0a 09 09 09 3b 3b 20 dition.")....;;
5330: 09 20 20 20 20 20 22 5c 6e 20 20 68 65 64 3a 20 . "\n hed:
5340: 20 20 20 20 20 20 20 20 20 20 20 22 20 68 65 64 " hed
5350: 20 0a 09 09 09 3b 3b 20 09 20 20 20 20 20 22 5c ....;; . "\
5360: 6e 20 66 61 69 6c 73 3a 20 20 20 20 20 20 20 20 n fails:
5370: 20 20 20 22 20 28 73 74 72 69 6e 67 2d 69 6e 74 " (string-int
5380: 65 72 73 70 65 72 73 65 20 28 6d 61 70 20 64 62 ersperse (map db
5390: 3a 74 65 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 :test-get-testna
53a0: 6d 65 20 66 61 69 6c 73 29 20 22 2c 22 29 0a 09 me fails) ",")..
53b0: 09 09 3b 3b 20 09 20 20 20 20 20 22 5c 6e 20 74 ..;; . "\n t
53c0: 65 73 74 6d 6f 64 65 3a 20 20 20 20 20 20 20 20 estmode:
53d0: 22 20 74 65 73 74 6d 6f 64 65 0a 09 09 09 3b 3b " testmode....;;
53e0: 20 09 20 20 20 20 20 22 5c 6e 20 70 72 65 72 65 . "\n prere
53f0: 71 73 2d 6e 6f 74 2d 6d 65 74 3a 20 22 20 28 70 qs-not-met: " (p
5400: 72 65 74 74 79 2d 73 74 72 69 6e 67 20 70 72 65 retty-string pre
5410: 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 0a 09 09 reqs-not-met)...
5420: 09 3b 3b 20 09 20 20 20 20 20 22 5c 6e 20 69 74 .;; . "\n it
5430: 65 6d 73 3a 20 20 20 20 20 20 20 20 20 20 20 22 ems: "
5440: 20 69 74 65 6d 73 29 0a 09 09 09 28 6c 6f 6f 70 items)....(loop
5450: 20 28 63 61 72 20 6e 65 77 74 61 6c 29 28 63 64 (car newtal)(cd
5460: 72 20 6e 65 77 74 61 6c 29 29 29 29 29 0a 09 09 r newtal)))))...
5470: 20 20 20 20 3b 3b 20 69 66 20 63 61 6e 27 74 20 ;; if can't
5480: 72 75 6e 20 6d 6f 72 65 20 6a 75 73 74 20 6c 6f run more just lo
5490: 6f 70 20 77 69 74 68 20 6e 65 78 74 20 70 6f 73 op with next pos
54a0: 73 69 62 6c 65 20 74 65 73 74 0a 09 09 20 20 20 sible test...
54b0: 20 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 74 (loop (car newt
54c0: 61 6c 29 28 63 64 72 20 6e 65 77 74 61 6c 29 29 al)(cdr newtal))
54d0: 29 29 29 0a 09 20 20 20 20 20 0a 09 20 20 20 20 ))).. ..
54e0: 20 3b 3b 20 74 68 69 73 20 63 61 73 65 20 73 68 ;; this case sh
54f0: 6f 75 6c 64 20 6e 6f 74 20 68 61 70 70 65 6e 2c ould not happen,
5500: 20 61 64 64 65 64 20 74 6f 20 68 65 6c 70 20 63 added to help c
5510: 61 74 63 68 20 61 6e 79 20 62 75 67 73 0a 09 20 atch any bugs..
5520: 20 20 20 20 28 28 61 6e 64 20 28 6c 69 73 74 3f ((and (list?
5530: 20 69 74 65 6d 73 29 20 69 74 65 6d 64 61 74 29 items) itemdat)
5540: 0a 09 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 .. (debug:p
5550: 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a 20 53 rint 0 "ERROR: S
5560: 68 6f 75 6c 64 20 6e 6f 74 20 68 61 76 65 20 61 hould not have a
5570: 20 6c 69 73 74 20 6f 66 20 69 74 65 6d 73 20 69 list of items i
5580: 6e 20 61 20 74 65 73 74 20 61 6e 64 20 74 68 65 n a test and the
5590: 20 69 74 65 6d 73 70 61 74 68 20 73 65 74 20 2d itemspath set -
55a0: 20 70 6c 65 61 73 65 20 72 65 70 6f 72 74 20 74 please report t
55b0: 68 69 73 22 29 0a 09 20 20 20 20 20 20 28 65 78 his").. (ex
55c0: 69 74 20 31 29 29 29 29 0a 09 20 20 0a 09 20 20 it 1)))).. ..
55d0: 3b 3b 20 77 65 20 67 65 74 20 68 65 72 65 20 6f ;; we get here o
55e0: 6e 20 22 64 72 6f 70 20 74 68 72 6f 75 67 68 22 n "drop through"
55f0: 20 2d 20 6c 6f 6f 70 20 66 6f 72 20 6e 65 78 74 - loop for next
5600: 20 74 65 73 74 20 69 6e 20 71 75 65 75 65 0a 09 test in queue..
5610: 20 20 28 69 66 20 28 6e 75 6c 6c 3f 20 74 61 6c (if (null? tal
5620: 29 0a 09 20 20 20 20 20 20 28 62 65 67 69 6e 0a ).. (begin.
5630: 09 09 3b 3b 20 46 49 58 4d 45 21 21 21 21 20 54 ..;; FIXME!!!! T
5640: 48 49 53 20 53 48 4f 55 4c 44 20 4e 4f 54 20 52 HIS SHOULD NOT R
5650: 45 51 55 49 52 45 20 41 4e 20 45 58 49 54 21 21 EQUIRE AN EXIT!!
5660: 21 21 21 21 21 0a 09 09 28 64 65 62 75 67 3a 70 !!!!!...(debug:p
5670: 72 69 6e 74 20 31 20 22 49 4e 46 4f 3a 20 41 6c rint 1 "INFO: Al
5680: 6c 20 74 65 73 74 73 20 6c 61 75 6e 63 68 65 64 l tests launched
5690: 22 29 0a 09 09 28 74 68 72 65 61 64 2d 73 6c 65 ")...(thread-sle
56a0: 65 70 21 20 30 2e 35 29 0a 09 09 3b 3b 20 46 49 ep! 0.5)...;; FI
56b0: 58 4d 45 21 20 54 68 69 73 20 68 61 72 73 68 20 XME! This harsh
56c0: 65 78 69 74 20 73 68 6f 75 6c 64 20 6e 6f 74 20 exit should not
56d0: 62 65 20 6e 65 63 65 73 73 61 72 79 2e 2e 2e 2e be necessary....
56e0: 0a 09 09 28 69 66 20 28 6e 6f 74 20 2a 72 75 6e ...(if (not *run
56f0: 72 65 6d 6f 74 65 2a 29 28 65 78 69 74 29 29 20 remote*)(exit))
5700: 3b 3b 20 0a 09 09 23 66 29 20 3b 3b 20 72 65 74 ;; ...#f) ;; ret
5710: 75 72 6e 20 61 20 23 66 20 61 73 20 61 20 68 69 urn a #f as a hi
5720: 6e 74 20 74 68 61 74 20 77 65 20 61 72 65 20 64 nt that we are d
5730: 6f 6e 65 0a 09 20 20 20 20 20 20 3b 3b 20 48 65 one.. ;; He
5740: 72 65 20 77 65 20 6e 65 65 64 20 74 6f 20 63 68 re we need to ch
5750: 65 63 6b 20 74 68 61 74 20 61 6c 6c 20 74 68 65 eck that all the
5760: 20 74 65 73 74 73 20 72 65 6d 61 69 6e 69 6e 67 tests remaining
5770: 20 74 6f 20 62 65 20 72 75 6e 20 61 72 65 20 65 to be run are e
5780: 6c 69 67 69 62 6c 65 20 74 6f 20 72 75 6e 0a 09 ligible to run..
5790: 20 20 20 20 20 20 3b 3b 20 61 6e 64 20 61 72 65 ;; and are
57a0: 20 6e 6f 74 20 62 6c 6f 63 6b 65 64 20 62 79 20 not blocked by
57b0: 66 61 69 6c 65 64 0a 09 20 20 20 20 20 20 28 6c failed.. (l
57c0: 65 74 20 28 28 6e 65 77 6c 73 74 20 28 6f 70 65 et ((newlst (ope
57d0: 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 74 65 73 74 n-run-close test
57e0: 73 3a 66 69 6c 74 65 72 2d 6e 6f 6e 2d 72 75 6e s:filter-non-run
57f0: 6e 61 62 6c 65 20 23 66 20 72 75 6e 2d 69 64 20 nable #f run-id
5800: 74 61 6c 20 74 65 73 74 2d 72 65 63 6f 72 64 73 tal test-records
5810: 29 29 29 20 3b 3b 20 69 2e 65 2e 20 6e 6f 74 20 ))) ;; i.e. not
5820: 46 41 49 4c 2c 20 57 41 49 56 45 44 2c 20 49 4e FAIL, WAIVED, IN
5830: 43 4f 4d 50 4c 45 54 45 2c 20 50 41 53 53 2c 20 COMPLETE, PASS,
5840: 4b 49 4c 4c 45 44 2c 0a 09 09 28 74 68 72 65 61 KILLED,...(threa
5850: 64 2d 73 6c 65 65 70 21 20 28 2f 20 2a 67 6c 6f d-sleep! (/ *glo
5860: 62 61 6c 2d 64 65 6c 74 61 2a 20 31 30 29 29 0a bal-delta* 10)).
5870: 09 09 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c 6c ..(if (not (null
5880: 3f 20 6e 65 77 6c 73 74 29 29 0a 09 09 20 20 20 ? newlst))...
5890: 20 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 6c (loop (car newl
58a0: 73 74 29 28 63 64 72 20 6e 65 77 6c 73 74 29 29 st)(cdr newlst))
58b0: 29 29 29 29 29 29 29 0a 0a 3b 3b 20 70 61 72 65 )))))))..;; pare
58c0: 6e 74 2d 74 65 73 74 20 69 73 20 74 68 65 72 65 nt-test is there
58d0: 20 61 73 20 61 20 70 6c 61 63 65 68 6f 6c 64 65 as a placeholde
58e0: 72 20 66 6f 72 20 77 68 65 6e 20 70 61 72 65 6e r for when paren
58f0: 74 2d 74 65 73 74 73 20 63 61 6e 20 62 65 20 72 t-tests can be r
5900: 75 6e 20 61 73 20 61 20 73 65 74 75 70 20 73 74 un as a setup st
5910: 65 70 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 3a ep.(define (run:
5920: 74 65 73 74 20 72 75 6e 2d 69 64 20 72 75 6e 6e test run-id runn
5930: 61 6d 65 20 6b 65 79 76 61 6c 6c 73 74 20 74 65 ame keyvallst te
5940: 73 74 2d 72 65 63 6f 72 64 20 66 6c 61 67 73 20 st-record flags
5950: 70 61 72 65 6e 74 2d 74 65 73 74 29 0a 20 20 3b parent-test). ;
5960: 3b 20 41 6c 6c 20 74 68 65 73 65 20 76 61 72 73 ; All these vars
5970: 20 6d 69 67 68 74 20 62 65 20 72 65 66 65 72 65 might be refere
5980: 6e 63 65 64 20 62 79 20 74 68 65 20 74 65 73 74 nced by the test
5990: 63 6f 6e 66 69 67 20 66 69 6c 65 20 72 65 61 64 config file read
59a0: 65 72 0a 20 20 28 6c 65 74 2a 20 28 28 74 65 73 er. (let* ((tes
59b0: 74 2d 6e 61 6d 65 20 20 20 20 28 74 65 73 74 73 t-name (tests
59c0: 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d 74 :testqueue-get-t
59d0: 65 73 74 6e 61 6d 65 20 20 20 74 65 73 74 2d 72 estname test-r
59e0: 65 63 6f 72 64 29 29 0a 09 20 28 74 65 73 74 2d ecord)).. (test-
59f0: 77 61 69 74 6f 6e 73 20 28 74 65 73 74 73 3a 74 waitons (tests:t
5a00: 65 73 74 71 75 65 75 65 2d 67 65 74 2d 77 61 69 estqueue-get-wai
5a10: 74 6f 6e 73 20 20 20 20 74 65 73 74 2d 72 65 63 tons test-rec
5a20: 6f 72 64 29 29 0a 09 20 28 74 65 73 74 2d 63 6f ord)).. (test-co
5a30: 6e 66 20 20 20 20 28 74 65 73 74 73 3a 74 65 73 nf (tests:tes
5a40: 74 71 75 65 75 65 2d 67 65 74 2d 74 65 73 74 63 tqueue-get-testc
5a50: 6f 6e 66 69 67 20 74 65 73 74 2d 72 65 63 6f 72 onfig test-recor
5a60: 64 29 29 0a 09 20 28 69 74 65 6d 64 61 74 20 20 d)).. (itemdat
5a70: 20 20 20 20 28 74 65 73 74 73 3a 74 65 73 74 71 (tests:testq
5a80: 75 65 75 65 2d 67 65 74 2d 69 74 65 6d 64 61 74 ueue-get-itemdat
5a90: 20 20 20 20 74 65 73 74 2d 72 65 63 6f 72 64 29 test-record)
5aa0: 29 0a 09 20 28 74 65 73 74 2d 70 61 74 68 20 20 ).. (test-path
5ab0: 20 20 28 63 6f 6e 63 20 2a 74 6f 70 70 61 74 68 (conc *toppath
5ac0: 2a 20 22 2f 74 65 73 74 73 2f 22 20 74 65 73 74 * "/tests/" test
5ad0: 2d 6e 61 6d 65 29 29 20 3b 3b 20 63 6f 75 6c 64 -name)) ;; could
5ae0: 20 75 73 65 20 74 65 73 74 73 3a 67 65 74 2d 74 use tests:get-t
5af0: 65 73 74 63 6f 6e 66 69 67 20 68 65 72 65 20 2e estconfig here .
5b00: 2e 2e 0a 09 20 28 66 6f 72 63 65 20 20 20 20 20 .... (force
5b10: 20 20 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 (hash-table-r
5b20: 65 66 2f 64 65 66 61 75 6c 74 20 66 6c 61 67 73 ef/default flags
5b30: 20 22 2d 66 6f 72 63 65 22 20 23 66 29 29 0a 09 "-force" #f))..
5b40: 20 28 72 65 72 75 6e 20 20 20 20 20 20 20 20 28 (rerun (
5b50: 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 2f 64 hash-table-ref/d
5b60: 65 66 61 75 6c 74 20 66 6c 61 67 73 20 22 2d 72 efault flags "-r
5b70: 65 72 75 6e 22 20 23 66 29 29 0a 09 20 28 6b 65 erun" #f)).. (ke
5b80: 65 70 67 6f 69 6e 67 20 20 20 20 28 68 61 73 68 epgoing (hash
5b90: 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 -table-ref/defau
5ba0: 6c 74 20 66 6c 61 67 73 20 22 2d 6b 65 65 70 67 lt flags "-keepg
5bb0: 6f 69 6e 67 22 20 23 66 29 29 0a 09 20 28 69 74 oing" #f)).. (it
5bc0: 65 6d 2d 70 61 74 68 20 20 20 20 20 22 22 29 0a em-path "").
5bd0: 09 20 28 64 62 20 20 20 20 20 20 20 20 20 20 20 . (db
5be0: 23 66 29 29 0a 20 20 20 20 28 64 65 62 75 67 3a #f)). (debug:
5bf0: 70 72 69 6e 74 20 35 0a 09 09 20 22 74 65 73 74 print 5... "test
5c00: 2d 63 6f 6e 66 69 67 3a 20 22 20 28 68 61 73 68 -config: " (hash
5c10: 2d 74 61 62 6c 65 2d 3e 61 6c 69 73 74 20 74 65 -table->alist te
5c20: 73 74 2d 63 6f 6e 66 29 0a 09 09 20 22 5c 6e 20 st-conf)... "\n
5c30: 20 20 69 74 65 6d 64 61 74 3a 20 22 20 69 74 65 itemdat: " ite
5c40: 6d 64 61 74 0a 09 09 20 29 0a 20 20 20 20 3b 3b mdat... ). ;;
5c50: 20 73 65 74 74 69 6e 67 20 69 74 65 6d 64 61 74 setting itemdat
5c60: 20 74 6f 20 61 20 6c 69 73 74 20 69 66 20 69 74 to a list if it
5c70: 20 69 73 20 23 66 0a 20 20 20 20 28 69 66 20 28 is #f. (if (
5c80: 6e 6f 74 20 69 74 65 6d 64 61 74 29 28 73 65 74 not itemdat)(set
5c90: 21 20 69 74 65 6d 64 61 74 20 27 28 29 29 29 0a ! itemdat '())).
5ca0: 20 20 20 20 28 73 65 74 21 20 69 74 65 6d 2d 70 (set! item-p
5cb0: 61 74 68 20 28 69 74 65 6d 2d 6c 69 73 74 2d 3e ath (item-list->
5cc0: 70 61 74 68 20 69 74 65 6d 64 61 74 29 29 0a 20 path itemdat)).
5cd0: 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 (debug:print
5ce0: 32 20 22 41 74 74 65 6d 70 74 69 6e 67 20 74 6f 2 "Attempting to
5cf0: 20 6c 61 75 6e 63 68 20 74 65 73 74 20 22 20 74 launch test " t
5d00: 65 73 74 2d 6e 61 6d 65 20 22 2f 22 20 69 74 65 est-name "/" ite
5d10: 6d 2d 70 61 74 68 29 0a 20 20 20 20 28 73 65 74 m-path). (set
5d20: 65 6e 76 20 22 4d 54 5f 54 45 53 54 5f 4e 41 4d env "MT_TEST_NAM
5d30: 45 22 20 74 65 73 74 2d 6e 61 6d 65 29 20 3b 3b E" test-name) ;;
5d40: 20 0a 20 20 20 20 28 73 65 74 65 6e 76 20 22 4d . (setenv "M
5d50: 54 5f 52 55 4e 4e 41 4d 45 22 20 20 20 72 75 6e T_RUNNAME" run
5d60: 6e 61 6d 65 29 0a 20 20 20 20 28 6f 70 65 6e 2d name). (open-
5d70: 72 75 6e 2d 63 6c 6f 73 65 2d 6d 65 61 73 75 72 run-close-measur
5d80: 65 20 73 65 74 2d 6d 65 67 61 74 65 73 74 2d 65 e set-megatest-e
5d90: 6e 76 2d 76 61 72 73 20 64 62 20 72 75 6e 2d 69 nv-vars db run-i
5da0: 64 29 20 3b 3b 20 74 68 65 73 65 20 6d 61 79 20 d) ;; these may
5db0: 62 65 20 6e 65 65 64 65 64 20 62 79 20 74 68 65 be needed by the
5dc0: 20 6c 61 75 6e 63 68 69 6e 67 20 70 72 6f 63 65 launching proce
5dd0: 73 73 0a 20 20 20 20 28 63 68 61 6e 67 65 2d 64 ss. (change-d
5de0: 69 72 65 63 74 6f 72 79 20 2a 74 6f 70 70 61 74 irectory *toppat
5df0: 68 2a 29 0a 0a 20 20 20 20 3b 3b 20 48 65 72 65 h*).. ;; Here
5e00: 20 69 73 20 77 68 65 72 65 20 74 68 65 20 74 65 is where the te
5e10: 73 74 5f 6d 65 74 61 20 74 61 62 6c 65 20 69 73 st_meta table is
5e20: 20 62 65 73 74 20 75 70 64 61 74 65 64 0a 20 20 best updated.
5e30: 20 20 3b 3b 20 59 65 73 2c 20 61 6e 6f 74 68 65 ;; Yes, anothe
5e40: 72 20 75 73 65 20 6f 66 20 61 20 67 6c 6f 62 61 r use of a globa
5e50: 6c 20 66 6f 72 20 63 61 63 68 69 6e 67 2e 20 4e l for caching. N
5e60: 65 65 64 20 61 20 62 65 74 74 65 72 20 77 61 79 eed a better way
5e70: 3f 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 ?. (if (not (
5e80: 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 2f 64 hash-table-ref/d
5e90: 65 66 61 75 6c 74 20 2a 74 65 73 74 2d 6d 65 74 efault *test-met
5ea0: 61 2d 75 70 64 61 74 65 64 2a 20 74 65 73 74 2d a-updated* test-
5eb0: 6e 61 6d 65 20 23 66 29 29 0a 20 20 20 20 20 20 name #f)).
5ec0: 20 20 28 62 65 67 69 6e 0a 09 20 20 20 28 68 61 (begin.. (ha
5ed0: 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 2a 74 sh-table-set! *t
5ee0: 65 73 74 2d 6d 65 74 61 2d 75 70 64 61 74 65 64 est-meta-updated
5ef0: 2a 20 74 65 73 74 2d 6e 61 6d 65 20 23 74 29 0a * test-name #t).
5f00: 20 20 20 20 20 20 20 20 20 20 20 28 6f 70 65 6e (open
5f10: 2d 72 75 6e 2d 63 6c 6f 73 65 20 72 75 6e 73 3a -run-close runs:
5f20: 75 70 64 61 74 65 2d 74 65 73 74 5f 6d 65 74 61 update-test_meta
5f30: 20 64 62 20 74 65 73 74 2d 6e 61 6d 65 20 74 65 db test-name te
5f40: 73 74 2d 63 6f 6e 66 29 29 29 0a 20 20 20 20 0a st-conf))). .
5f50: 20 20 20 20 3b 3b 20 28 6c 61 6d 62 64 61 20 28 ;; (lambda (
5f60: 69 74 65 6d 64 61 74 29 20 3b 3b 3b 20 28 28 72 itemdat) ;;; ((r
5f70: 69 70 65 6e 65 73 73 20 22 6f 76 65 72 72 69 70 ipeness "overrip
5f80: 65 22 29 20 28 74 65 6d 70 65 72 61 74 75 72 65 e") (temperature
5f90: 20 22 63 6f 6f 6c 22 29 20 28 73 65 61 73 6f 6e "cool") (season
5fa0: 20 22 73 75 6d 6d 65 72 22 29 29 0a 20 20 20 20 "summer")).
5fb0: 28 6c 65 74 2a 20 28 28 6e 65 77 2d 74 65 73 74 (let* ((new-test
5fc0: 2d 70 61 74 68 20 28 73 74 72 69 6e 67 2d 69 6e -path (string-in
5fd0: 74 65 72 73 70 65 72 73 65 20 28 63 6f 6e 73 20 tersperse (cons
5fe0: 74 65 73 74 2d 70 61 74 68 20 28 6d 61 70 20 63 test-path (map c
5ff0: 61 64 72 20 69 74 65 6d 64 61 74 29 29 20 22 2f adr itemdat)) "/
6000: 22 29 29 0a 09 20 20 20 28 6e 65 77 2d 74 65 73 ")).. (new-tes
6010: 74 2d 6e 61 6d 65 20 28 69 66 20 28 65 71 75 61 t-name (if (equa
6020: 6c 3f 20 69 74 65 6d 2d 70 61 74 68 20 22 22 29 l? item-path "")
6030: 20 74 65 73 74 2d 6e 61 6d 65 20 28 63 6f 6e 63 test-name (conc
6040: 20 74 65 73 74 2d 6e 61 6d 65 20 22 2f 22 20 69 test-name "/" i
6050: 74 65 6d 2d 70 61 74 68 29 29 29 20 3b 3b 20 6a tem-path))) ;; j
6060: 75 73 74 20 6e 65 65 64 20 69 74 20 74 6f 20 62 ust need it to b
6070: 65 20 75 6e 69 71 75 65 0a 09 20 20 20 28 74 65 e unique.. (te
6080: 73 74 2d 69 64 20 20 20 20 20 20 20 28 6f 70 65 st-id (ope
6090: 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 n-run-close db:g
60a0: 65 74 2d 74 65 73 74 2d 69 64 20 64 62 20 20 72 et-test-id db r
60b0: 75 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 un-id test-name
60c0: 69 74 65 6d 2d 70 61 74 68 29 29 0a 09 20 20 20 item-path))..
60d0: 28 74 65 73 74 64 61 74 20 20 20 20 20 20 20 28 (testdat (
60e0: 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 open-run-close d
60f0: 62 3a 67 65 74 2d 74 65 73 74 2d 69 6e 66 6f 2d b:get-test-info-
6100: 62 79 2d 69 64 20 64 62 20 74 65 73 74 2d 69 64 by-id db test-id
6110: 29 29 29 0a 20 20 20 20 20 20 28 69 66 20 28 6e ))). (if (n
6120: 6f 74 20 74 65 73 74 64 61 74 29 0a 09 20 20 28 ot testdat).. (
6130: 62 65 67 69 6e 0a 09 20 20 20 20 3b 3b 20 65 6e begin.. ;; en
6140: 73 75 72 65 20 74 68 61 74 20 74 68 65 20 70 61 sure that the pa
6150: 74 68 20 65 78 69 73 74 73 20 62 65 66 6f 72 65 th exists before
6160: 20 72 65 67 69 73 74 65 72 69 6e 67 20 74 68 65 registering the
6170: 20 74 65 73 74 0a 09 20 20 20 20 3b 3b 20 4e 4f test.. ;; NO
6180: 50 45 3a 20 43 61 6e 6e 6f 74 21 20 44 6f 6e 27 PE: Cannot! Don'
6190: 74 20 6b 6e 6f 77 20 79 65 74 20 77 68 69 63 68 t know yet which
61a0: 20 64 69 73 6b 20 61 72 65 61 20 77 69 6c 6c 20 disk area will
61b0: 62 65 20 61 73 73 69 67 6e 65 64 2e 2e 2e 2e 0a be assigned.....
61c0: 09 20 20 20 20 3b 3b 20 28 73 79 73 74 65 6d 20 . ;; (system
61d0: 28 63 6f 6e 63 20 22 6d 6b 64 69 72 20 2d 70 20 (conc "mkdir -p
61e0: 22 20 6e 65 77 2d 74 65 73 74 2d 70 61 74 68 29 " new-test-path)
61f0: 29 0a 09 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e ).. (open-run
6200: 2d 63 6c 6f 73 65 20 74 65 73 74 73 3a 72 65 67 -close tests:reg
6210: 69 73 74 65 72 2d 74 65 73 74 20 64 62 20 72 75 ister-test db ru
6220: 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 n-id test-name i
6230: 74 65 6d 2d 70 61 74 68 29 0a 09 20 20 20 20 28 tem-path).. (
6240: 73 65 74 21 20 74 65 73 74 2d 69 64 20 28 6f 70 set! test-id (op
6250: 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a en-run-close db:
6260: 67 65 74 2d 74 65 73 74 2d 69 64 20 64 62 20 72 get-test-id db r
6270: 75 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 un-id test-name
6280: 69 74 65 6d 2d 70 61 74 68 29 29 0a 09 20 20 20 item-path))..
6290: 20 28 73 65 74 21 20 74 65 73 74 64 61 74 20 28 (set! testdat (
62a0: 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 open-run-close d
62b0: 62 3a 67 65 74 2d 74 65 73 74 2d 69 6e 66 6f 2d b:get-test-info-
62c0: 62 79 2d 69 64 20 64 62 20 74 65 73 74 2d 69 64 by-id db test-id
62d0: 29 29 29 29 0a 20 20 20 20 20 20 28 73 65 74 21 )))). (set!
62e0: 20 74 65 73 74 2d 69 64 20 28 64 62 3a 74 65 73 test-id (db:tes
62f0: 74 2d 67 65 74 2d 69 64 20 74 65 73 74 64 61 74 t-get-id testdat
6300: 29 29 0a 20 20 20 20 20 20 28 63 68 61 6e 67 65 )). (change
6310: 2d 64 69 72 65 63 74 6f 72 79 20 74 65 73 74 2d -directory test-
6320: 70 61 74 68 29 0a 20 20 20 20 20 20 28 63 61 73 path). (cas
6330: 65 20 28 69 66 20 66 6f 72 63 65 20 3b 3b 20 28 e (if force ;; (
6340: 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 66 args:get-arg "-f
6350: 6f 72 63 65 22 29 0a 09 09 27 4e 4f 54 5f 53 54 orce")...'NOT_ST
6360: 41 52 54 45 44 0a 09 09 28 69 66 20 74 65 73 74 ARTED...(if test
6370: 64 61 74 0a 09 09 20 20 20 20 28 73 74 72 69 6e dat... (strin
6380: 67 2d 3e 73 79 6d 62 6f 6c 20 28 74 65 73 74 3a g->symbol (test:
6390: 67 65 74 2d 73 74 61 74 65 20 74 65 73 74 64 61 get-state testda
63a0: 74 29 29 0a 09 09 20 20 20 20 27 66 61 69 6c 65 t))... 'faile
63b0: 64 2d 74 6f 2d 69 6e 73 65 72 74 29 29 0a 09 28 d-to-insert))..(
63c0: 28 66 61 69 6c 65 64 2d 74 6f 2d 69 6e 73 65 72 (failed-to-inser
63d0: 74 29 0a 09 20 28 64 65 62 75 67 3a 70 72 69 6e t).. (debug:prin
63e0: 74 20 30 20 22 45 52 52 4f 52 3a 20 46 61 69 6c t 0 "ERROR: Fail
63f0: 65 64 20 74 6f 20 69 6e 73 65 72 74 20 74 68 65 ed to insert the
6400: 20 72 65 63 6f 72 64 20 69 6e 74 6f 20 74 68 65 record into the
6410: 20 64 62 22 29 29 0a 09 28 28 4e 4f 54 5f 53 54 db"))..((NOT_ST
6420: 41 52 54 45 44 20 43 4f 4d 50 4c 45 54 45 44 29 ARTED COMPLETED)
6430: 0a 09 20 28 6c 65 74 20 28 28 72 75 6e 66 6c 61 .. (let ((runfla
6440: 67 20 23 66 29 29 0a 09 20 20 20 28 63 6f 6e 64 g #f)).. (cond
6450: 0a 09 20 20 20 20 3b 3b 20 2d 66 6f 72 63 65 2c .. ;; -force,
6460: 20 72 75 6e 20 6e 6f 20 6d 61 74 74 65 72 20 77 run no matter w
6470: 68 61 74 0a 09 20 20 20 20 28 66 6f 72 63 65 20 hat.. (force
6480: 28 73 65 74 21 20 72 75 6e 66 6c 61 67 20 23 74 (set! runflag #t
6490: 29 29 0a 09 20 20 20 20 3b 3b 20 4e 4f 54 5f 53 )).. ;; NOT_S
64a0: 54 41 52 54 45 44 2c 20 72 75 6e 20 6e 6f 20 6d TARTED, run no m
64b0: 61 74 74 65 72 20 77 68 61 74 0a 09 20 20 20 20 atter what..
64c0: 28 28 65 71 75 61 6c 3f 20 28 74 65 73 74 3a 67 ((equal? (test:g
64d0: 65 74 2d 73 74 61 74 65 20 74 65 73 74 64 61 74 et-state testdat
64e0: 29 20 22 4e 4f 54 5f 53 54 41 52 54 45 44 22 29 ) "NOT_STARTED")
64f0: 28 73 65 74 21 20 72 75 6e 66 6c 61 67 20 23 74 (set! runflag #t
6500: 29 29 0a 09 20 20 20 20 3b 3b 20 6e 6f 74 20 2d )).. ;; not -
6510: 72 65 72 75 6e 20 61 6e 64 20 50 41 53 53 2c 20 rerun and PASS,
6520: 57 41 52 4e 20 6f 72 20 43 48 45 43 4b 2c 20 64 WARN or CHECK, d
6530: 6f 20 6e 6f 20 72 75 6e 0a 09 20 20 20 20 28 28 o no run.. ((
6540: 61 6e 64 20 28 6f 72 20 28 6e 6f 74 20 72 65 72 and (or (not rer
6550: 75 6e 29 0a 09 09 20 20 20 20 20 20 6b 65 65 70 un)... keep
6560: 67 6f 69 6e 67 29 0a 09 09 20 20 3b 3b 20 52 65 going)... ;; Re
6570: 71 75 69 72 65 20 74 6f 20 66 6f 72 63 65 20 72 quire to force r
6580: 65 2d 72 75 6e 20 66 6f 72 20 43 4f 4d 50 4c 45 e-run for COMPLE
6590: 54 45 44 20 6f 72 20 2a 61 6e 79 74 68 69 6e 67 TED or *anything
65a0: 2a 20 2b 20 50 41 53 53 2c 57 41 52 4e 20 6f 72 * + PASS,WARN or
65b0: 20 43 48 45 43 4b 0a 09 09 20 20 28 6f 72 20 28 CHECK... (or (
65c0: 6d 65 6d 62 65 72 20 28 74 65 73 74 3a 67 65 74 member (test:get
65d0: 2d 73 74 61 74 75 73 20 74 65 73 74 64 61 74 29 -status testdat)
65e0: 20 27 28 22 50 41 53 53 22 20 22 57 41 52 4e 22 '("PASS" "WARN"
65f0: 20 22 43 48 45 43 4b 22 29 29 0a 09 09 20 20 20 "CHECK"))...
6600: 20 20 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 (member (test
6610: 3a 67 65 74 2d 73 74 61 74 65 20 20 74 65 73 74 :get-state test
6620: 64 61 74 29 20 27 28 22 43 4f 4d 50 4c 45 54 45 dat) '("COMPLETE
6630: 44 22 29 29 29 29 20 0a 09 20 20 20 20 20 28 64 D")))) .. (d
6640: 65 62 75 67 3a 70 72 69 6e 74 20 32 20 22 49 4e ebug:print 2 "IN
6650: 46 4f 3a 20 72 75 6e 6e 69 6e 67 20 74 65 73 74 FO: running test
6660: 20 22 20 74 65 73 74 2d 6e 61 6d 65 20 22 2f 22 " test-name "/"
6670: 20 69 74 65 6d 2d 70 61 74 68 20 22 20 73 75 70 item-path " sup
6680: 70 72 65 73 73 65 64 20 61 73 20 69 74 20 69 73 pressed as it is
6690: 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 " (test:get-sta
66a0: 74 65 20 74 65 73 74 64 61 74 29 20 22 20 61 6e te testdat) " an
66b0: 64 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 d " (test:get-st
66c0: 61 74 75 73 20 74 65 73 74 64 61 74 29 29 0a 09 atus testdat))..
66d0: 20 20 20 20 20 28 73 65 74 21 20 72 75 6e 66 6c (set! runfl
66e0: 61 67 20 23 66 29 29 0a 09 20 20 20 20 3b 3b 20 ag #f)).. ;;
66f0: 2d 72 65 72 75 6e 20 61 6e 64 20 73 74 61 74 75 -rerun and statu
6700: 73 20 69 73 20 6f 6e 65 20 6f 66 20 74 68 65 20 s is one of the
6710: 73 70 65 63 69 66 65 64 2c 20 72 75 6e 20 69 74 specifed, run it
6720: 0a 09 20 20 20 20 28 28 61 6e 64 20 72 65 72 75 .. ((and reru
6730: 6e 0a 09 09 20 20 28 6c 65 74 2a 20 28 28 72 65 n... (let* ((re
6740: 72 75 6e 6c 73 74 20 20 20 28 73 74 72 69 6e 67 runlst (string
6750: 2d 73 70 6c 69 74 20 72 65 72 75 6e 20 22 2c 22 -split rerun ","
6760: 29 29 0a 09 09 09 20 28 6d 75 73 74 2d 72 65 72 )).... (must-rer
6770: 75 6e 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 un (member (test
6780: 3a 67 65 74 2d 73 74 61 74 75 73 20 74 65 73 74 :get-status test
6790: 64 61 74 29 20 72 65 72 75 6e 6c 73 74 29 29 29 dat) rerunlst)))
67a0: 0a 09 09 20 20 20 20 28 64 65 62 75 67 3a 70 72 ... (debug:pr
67b0: 69 6e 74 20 33 20 22 49 4e 46 4f 3a 20 2d 72 65 int 3 "INFO: -re
67c0: 72 75 6e 20 6c 69 73 74 3a 20 22 20 72 65 72 75 run list: " reru
67d0: 6e 20 22 2c 20 74 65 73 74 2d 73 74 61 74 75 73 n ", test-status
67e0: 3a 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 : " (test:get-st
67f0: 61 74 75 73 20 74 65 73 74 64 61 74 29 22 2c 20 atus testdat)",
6800: 6d 75 73 74 2d 72 65 72 75 6e 3a 20 22 20 6d 75 must-rerun: " mu
6810: 73 74 2d 72 65 72 75 6e 29 0a 09 09 20 20 20 20 st-rerun)...
6820: 6d 75 73 74 2d 72 65 72 75 6e 29 29 0a 09 20 20 must-rerun))..
6830: 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 (debug:print
6840: 32 20 22 49 4e 46 4f 3a 20 52 65 72 75 6e 20 66 2 "INFO: Rerun f
6850: 6f 72 63 65 64 20 66 6f 72 20 74 65 73 74 20 22 orced for test "
6860: 20 74 65 73 74 2d 6e 61 6d 65 20 22 2f 22 20 69 test-name "/" i
6870: 74 65 6d 2d 70 61 74 68 29 0a 09 20 20 20 20 20 tem-path)..
6880: 28 73 65 74 21 20 72 75 6e 66 6c 61 67 20 23 74 (set! runflag #t
6890: 29 29 0a 09 20 20 20 20 3b 3b 20 2d 6b 65 65 70 )).. ;; -keep
68a0: 67 6f 69 6e 67 2c 20 64 6f 20 6e 6f 74 20 72 65 going, do not re
68b0: 72 75 6e 20 46 41 49 4c 0a 09 20 20 20 20 28 28 run FAIL.. ((
68c0: 61 6e 64 20 6b 65 65 70 67 6f 69 6e 67 0a 09 09 and keepgoing...
68d0: 20 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a (member (test:
68e0: 67 65 74 2d 73 74 61 74 75 73 20 74 65 73 74 64 get-status testd
68f0: 61 74 29 20 27 28 22 46 41 49 4c 22 29 29 29 0a at) '("FAIL"))).
6900: 09 20 20 20 20 20 28 73 65 74 21 20 72 75 6e 66 . (set! runf
6910: 6c 61 67 20 23 66 29 29 0a 09 20 20 20 20 28 28 lag #f)).. ((
6920: 61 6e 64 20 28 6e 6f 74 20 72 65 72 75 6e 29 0a and (not rerun).
6930: 09 09 20 20 28 6d 65 6d 62 65 72 20 28 74 65 73 .. (member (tes
6940: 74 3a 67 65 74 2d 73 74 61 74 75 73 20 74 65 73 t:get-status tes
6950: 74 64 61 74 29 20 27 28 22 46 41 49 4c 22 20 22 tdat) '("FAIL" "
6960: 6e 2f 61 22 29 29 29 0a 09 20 20 20 20 20 28 73 n/a"))).. (s
6970: 65 74 21 20 72 75 6e 66 6c 61 67 20 23 74 29 29 et! runflag #t))
6980: 0a 09 20 20 20 20 28 65 6c 73 65 20 28 73 65 74 .. (else (set
6990: 21 20 72 75 6e 66 6c 61 67 20 23 66 29 29 29 0a ! runflag #f))).
69a0: 09 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 . (debug:print
69b0: 20 36 20 22 52 55 4e 4e 49 4e 47 20 3d 3e 20 72 6 "RUNNING => r
69c0: 75 6e 66 6c 61 67 3a 20 22 20 72 75 6e 66 6c 61 unflag: " runfla
69d0: 67 20 22 20 53 54 41 54 45 3a 20 22 20 28 74 65 g " STATE: " (te
69e0: 73 74 3a 67 65 74 2d 73 74 61 74 65 20 74 65 73 st:get-state tes
69f0: 74 64 61 74 29 20 22 20 53 54 41 54 55 53 3a 20 tdat) " STATUS:
6a00: 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 " (test:get-stat
6a10: 75 73 20 74 65 73 74 64 61 74 29 29 0a 09 20 20 us testdat))..
6a20: 20 28 69 66 20 28 6e 6f 74 20 72 75 6e 66 6c 61 (if (not runfla
6a30: 67 29 0a 09 20 20 20 20 20 20 20 28 69 66 20 28 g).. (if (
6a40: 6e 6f 74 20 70 61 72 65 6e 74 2d 74 65 73 74 29 not parent-test)
6a50: 0a 09 09 20 20 20 28 64 65 62 75 67 3a 70 72 69 ... (debug:pri
6a60: 6e 74 20 31 20 22 4e 4f 54 45 3a 20 4e 6f 74 20 nt 1 "NOTE: Not
6a70: 73 74 61 72 74 69 6e 67 20 74 65 73 74 20 22 20 starting test "
6a80: 6e 65 77 2d 74 65 73 74 2d 6e 61 6d 65 20 22 20 new-test-name "
6a90: 61 73 20 69 74 20 69 73 20 73 74 61 74 65 20 5c as it is state \
6aa0: 22 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 "" (test:get-sta
6ab0: 74 65 20 74 65 73 74 64 61 74 29 20 0a 09 09 09 te testdat) ....
6ac0: 09 22 5c 22 20 61 6e 64 20 73 74 61 74 75 73 20 ."\" and status
6ad0: 5c 22 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 \"" (test:get-st
6ae0: 61 74 75 73 20 74 65 73 74 64 61 74 29 20 22 5c atus testdat) "\
6af0: 22 2c 20 75 73 65 20 2d 72 65 72 75 6e 20 5c 22 ", use -rerun \"
6b00: 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 " (test:get-stat
6b10: 75 73 20 74 65 73 74 64 61 74 29 0a 20 20 20 20 us testdat).
6b20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
6b30: 20 20 20 20 20 20 20 20 20 20 20 20 22 5c 22 20 "\"
6b40: 6f 72 20 2d 66 6f 72 63 65 20 74 6f 20 6f 76 65 or -force to ove
6b50: 72 72 69 64 65 22 29 29 0a 09 20 20 20 20 20 20 rride"))..
6b60: 20 3b 3b 20 4e 4f 54 45 3a 20 4e 6f 20 6c 6f 6e ;; NOTE: No lon
6b70: 67 65 72 20 62 65 20 63 68 65 63 6b 69 6e 67 20 ger be checking
6b80: 70 72 65 72 65 71 75 69 73 69 74 65 73 20 68 65 prerequisites he
6b90: 72 65 21 20 57 69 6c 6c 20 6e 65 76 65 72 20 67 re! Will never g
6ba0: 65 74 20 68 65 72 65 20 75 6e 6c 65 73 73 20 70 et here unless p
6bb0: 72 65 72 65 71 73 20 61 72 65 0a 09 20 20 20 20 rereqs are..
6bc0: 20 20 20 3b 3b 20 20 20 20 20 20 20 61 6c 72 65 ;; alre
6bd0: 61 64 79 20 6d 65 74 2e 0a 09 20 20 20 20 20 20 ady met...
6be0: 20 28 69 66 20 28 6e 6f 74 20 28 6f 70 65 6e 2d (if (not (open-
6bf0: 72 75 6e 2d 63 6c 6f 73 65 20 6c 61 75 6e 63 68 run-close launch
6c00: 2d 74 65 73 74 20 64 62 20 72 75 6e 2d 69 64 20 -test db run-id
6c10: 72 75 6e 6e 61 6d 65 20 74 65 73 74 2d 63 6f 6e runname test-con
6c20: 66 20 6b 65 79 76 61 6c 6c 73 74 20 74 65 73 74 f keyvallst test
6c30: 2d 6e 61 6d 65 20 74 65 73 74 2d 70 61 74 68 20 -name test-path
6c40: 69 74 65 6d 64 61 74 20 66 6c 61 67 73 29 29 0a itemdat flags)).
6c50: 09 09 20 20 20 28 62 65 67 69 6e 0a 09 09 20 20 .. (begin...
6c60: 20 20 20 28 70 72 69 6e 74 20 22 45 52 52 4f 52 (print "ERROR
6c70: 3a 20 46 61 69 6c 65 64 20 74 6f 20 6c 61 75 6e : Failed to laun
6c80: 63 68 20 74 68 65 20 74 65 73 74 2e 20 45 78 69 ch the test. Exi
6c90: 74 69 6e 67 20 61 73 20 73 6f 6f 6e 20 61 73 20 ting as soon as
6ca0: 70 6f 73 73 69 62 6c 65 22 29 0a 09 09 20 20 20 possible")...
6cb0: 20 20 28 73 65 74 21 20 2a 67 6c 6f 62 61 6c 65 (set! *globale
6cc0: 78 69 74 73 74 61 74 75 73 2a 20 31 29 20 3b 3b xitstatus* 1) ;;
6cd0: 20 0a 09 09 20 20 20 20 20 28 70 72 6f 63 65 73 ... (proces
6ce0: 73 2d 73 69 67 6e 61 6c 20 28 63 75 72 72 65 6e s-signal (curren
6cf0: 74 2d 70 72 6f 63 65 73 73 2d 69 64 29 20 73 69 t-process-id) si
6d00: 67 6e 61 6c 2f 6b 69 6c 6c 29 29 29 29 29 29 0a gnal/kill)))))).
6d10: 09 28 28 4b 49 4c 4c 45 44 29 20 0a 09 20 28 64 .((KILLED) .. (d
6d20: 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 4e 4f ebug:print 1 "NO
6d30: 54 45 3a 20 22 20 6e 65 77 2d 74 65 73 74 2d 6e TE: " new-test-n
6d40: 61 6d 65 20 22 20 69 73 20 61 6c 72 65 61 64 79 ame " is already
6d50: 20 72 75 6e 6e 69 6e 67 20 6f 72 20 77 61 73 20 running or was
6d60: 65 78 70 6c 69 63 74 6c 79 20 6b 69 6c 6c 65 64 explictly killed
6d70: 2c 20 75 73 65 20 2d 66 6f 72 63 65 20 74 6f 20 , use -force to
6d80: 6c 61 75 6e 63 68 20 69 74 2e 22 29 29 0a 09 28 launch it."))..(
6d90: 28 4c 41 55 4e 43 48 45 44 20 52 45 4d 4f 54 45 (LAUNCHED REMOTE
6da0: 48 4f 53 54 53 54 41 52 54 20 52 55 4e 4e 49 4e HOSTSTART RUNNIN
6db0: 47 29 20 20 0a 09 20 28 69 66 20 28 3e 20 28 2d G) .. (if (> (-
6dc0: 20 28 63 75 72 72 65 6e 74 2d 73 65 63 6f 6e 64 (current-second
6dd0: 73 29 28 2b 20 28 64 62 3a 74 65 73 74 2d 67 65 s)(+ (db:test-ge
6de0: 74 2d 65 76 65 6e 74 5f 74 69 6d 65 20 74 65 73 t-event_time tes
6df0: 74 64 61 74 29 0a 09 09 09 09 20 20 20 20 20 20 tdat).....
6e00: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 72 75 (db:test-get-ru
6e10: 6e 5f 64 75 72 61 74 69 6f 6e 20 74 65 73 74 64 n_duration testd
6e20: 61 74 29 29 29 0a 09 09 36 30 30 29 20 3b 3b 20 at)))...600) ;;
6e30: 69 2e 65 2e 20 6e 6f 20 75 70 64 61 74 65 20 66 i.e. no update f
6e40: 6f 72 20 6d 6f 72 65 20 74 68 61 6e 20 36 30 30 or more than 600
6e50: 20 73 65 63 6f 6e 64 73 0a 09 20 20 20 20 20 28 seconds.. (
6e60: 62 65 67 69 6e 0a 09 20 20 20 20 20 20 20 28 64 begin.. (d
6e70: 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 57 41 ebug:print 0 "WA
6e80: 52 4e 49 4e 47 3a 20 54 65 73 74 20 22 20 74 65 RNING: Test " te
6e90: 73 74 2d 6e 61 6d 65 20 22 20 61 70 70 65 61 72 st-name " appear
6ea0: 73 20 74 6f 20 62 65 20 64 65 61 64 2e 20 46 6f s to be dead. Fo
6eb0: 72 63 69 6e 67 20 69 74 20 74 6f 20 73 74 61 74 rcing it to stat
6ec0: 65 20 49 4e 43 4f 4d 50 4c 45 54 45 20 61 6e 64 e INCOMPLETE and
6ed0: 20 73 74 61 74 75 73 20 53 54 55 43 4b 2f 44 45 status STUCK/DE
6ee0: 41 44 22 29 0a 09 20 20 20 20 20 20 20 28 6f 70 AD").. (op
6ef0: 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 74 65 73 en-run-close tes
6f00: 74 2d 73 65 74 2d 73 74 61 74 75 73 21 20 64 62 t-set-status! db
6f10: 20 74 65 73 74 2d 69 64 20 22 49 4e 43 4f 4d 50 test-id "INCOMP
6f20: 4c 45 54 45 22 20 22 53 54 55 43 4b 2f 44 45 41 LETE" "STUCK/DEA
6f30: 44 22 20 22 54 65 73 74 20 69 73 20 73 74 75 63 D" "Test is stuc
6f40: 6b 20 6f 72 20 64 65 61 64 22 20 23 66 29 29 0a k or dead" #f)).
6f50: 09 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 . (debug:pri
6f60: 6e 74 20 32 20 22 4e 4f 54 45 3a 20 22 20 74 65 nt 2 "NOTE: " te
6f70: 73 74 2d 6e 61 6d 65 20 22 20 69 73 20 61 6c 72 st-name " is alr
6f80: 65 61 64 79 20 72 75 6e 6e 69 6e 67 22 29 29 29 eady running")))
6f90: 0a 09 28 65 6c 73 65 20 20 20 20 20 20 20 28 64 ..(else (d
6fa0: 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 ebug:print 0 "ER
6fb0: 52 4f 52 3a 20 46 61 69 6c 65 64 20 74 6f 20 6c ROR: Failed to l
6fc0: 61 75 6e 63 68 20 74 65 73 74 20 22 20 6e 65 77 aunch test " new
6fd0: 2d 74 65 73 74 2d 6e 61 6d 65 20 22 2e 20 55 6e -test-name ". Un
6fe0: 72 65 63 6f 67 6e 69 73 65 64 20 73 74 61 74 65 recognised state
6ff0: 20 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 " (test:get-sta
7000: 74 65 20 74 65 73 74 64 61 74 29 29 29 29 29 29 te testdat))))))
7010: 29 0a 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d )..;;===========
7020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
7030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
7040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
7050: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 45 ===========.;; E
7060: 4e 44 20 4f 46 20 4e 45 57 20 53 54 55 46 46 0a ND OF NEW STUFF.
7070: 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ;;==============
7080: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
7090: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
70a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
70b0: 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a 28 64 65 66 69 6e ========..(defin
70c0: 65 20 28 67 65 74 2d 64 69 72 2d 75 70 2d 6e 20 e (get-dir-up-n
70d0: 64 69 72 20 2e 20 70 61 72 61 6d 73 29 20 0a 20 dir . params) .
70e0: 20 28 6c 65 74 20 28 28 64 70 61 72 74 73 20 20 (let ((dparts
70f0: 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 20 64 69 (string-split di
7100: 72 20 22 2f 22 29 29 0a 09 28 63 6f 75 6e 74 20 r "/"))..(count
7110: 20 20 28 69 66 20 28 6e 75 6c 6c 3f 20 70 61 72 (if (null? par
7120: 61 6d 73 29 20 31 20 28 63 61 72 20 70 61 72 61 ams) 1 (car para
7130: 6d 73 29 29 29 29 0a 20 20 20 20 28 63 6f 6e 63 ms)))). (conc
7140: 20 22 2f 22 20 28 73 74 72 69 6e 67 2d 69 6e 74 "/" (string-int
7150: 65 72 73 70 65 72 73 65 20 0a 09 20 20 20 20 20 ersperse ..
7160: 20 20 28 74 61 6b 65 20 64 70 61 72 74 73 20 28 (take dparts (
7170: 2d 20 28 6c 65 6e 67 74 68 20 64 70 61 72 74 73 - (length dparts
7180: 29 20 63 6f 75 6e 74 29 29 0a 09 20 20 20 20 20 ) count))..
7190: 20 20 22 2f 22 29 29 29 29 0a 3b 3b 20 52 65 6d "/")))).;; Rem
71a0: 6f 76 65 20 72 75 6e 73 0a 3b 3b 20 66 69 65 6c ove runs.;; fiel
71b0: 64 73 20 61 72 65 20 70 61 73 73 69 6e 67 20 69 ds are passing i
71c0: 6e 20 74 68 72 6f 75 67 68 20 0a 3b 3b 20 61 63 n through .;; ac
71d0: 74 69 6f 6e 3a 0a 3b 3b 20 20 20 20 27 72 65 6d tion:.;; 'rem
71e0: 6f 76 65 2d 72 75 6e 73 0a 3b 3b 20 20 20 20 27 ove-runs.;; '
71f0: 73 65 74 2d 73 74 61 74 65 2d 73 74 61 74 75 73 set-state-status
7200: 0a 3b 3b 0a 3b 3b 20 4e 42 2f 2f 20 73 68 6f 75 .;;.;; NB// shou
7210: 6c 64 20 70 61 73 73 20 69 6e 20 6b 65 79 73 3f ld pass in keys?
7220: 0a 3b 3b 0a 28 64 65 66 69 6e 65 20 28 72 75 6e .;;.(define (run
7230: 73 3a 6f 70 65 72 61 74 65 2d 6f 6e 20 64 62 20 s:operate-on db
7240: 61 63 74 69 6f 6e 20 72 75 6e 6e 61 6d 65 70 61 action runnamepa
7250: 74 74 20 74 65 73 74 70 61 74 74 20 69 74 65 6d tt testpatt item
7260: 70 61 74 74 20 23 21 6b 65 79 20 28 73 74 61 74 patt #!key (stat
7270: 65 20 23 66 29 28 73 74 61 74 75 73 20 23 66 29 e #f)(status #f)
7280: 28 6e 65 77 2d 73 74 61 74 65 2d 73 74 61 74 75 (new-state-statu
7290: 73 20 23 66 29 29 0a 20 20 28 6c 65 74 2a 20 28 s #f)). (let* (
72a0: 28 6b 65 79 73 20 20 20 20 20 20 20 20 20 28 72 (keys (r
72b0: 64 62 3a 67 65 74 2d 6b 65 79 73 20 64 62 29 29 db:get-keys db))
72c0: 0a 09 20 28 72 75 6e 64 61 74 20 20 20 20 20 20 .. (rundat
72d0: 20 28 72 75 6e 73 3a 67 65 74 2d 72 75 6e 73 2d (runs:get-runs-
72e0: 62 79 2d 70 61 74 74 20 64 62 20 6b 65 79 73 20 by-patt db keys
72f0: 72 75 6e 6e 61 6d 65 70 61 74 74 29 29 0a 09 20 runnamepatt))..
7300: 28 68 65 61 64 65 72 20 20 20 20 20 20 20 28 76 (header (v
7310: 65 63 74 6f 72 2d 72 65 66 20 72 75 6e 64 61 74 ector-ref rundat
7320: 20 30 29 29 0a 09 20 28 72 75 6e 73 20 20 20 20 0)).. (runs
7330: 20 20 20 20 20 28 76 65 63 74 6f 72 2d 72 65 66 (vector-ref
7340: 20 72 75 6e 64 61 74 20 31 29 29 0a 09 20 28 73 rundat 1)).. (s
7350: 74 61 74 65 73 20 20 20 20 20 20 20 28 69 66 20 tates (if
7360: 73 74 61 74 65 20 20 28 73 74 72 69 6e 67 2d 73 state (string-s
7370: 70 6c 69 74 20 73 74 61 74 65 20 20 22 2c 22 29 plit state ",")
7380: 20 27 28 29 29 29 0a 09 20 28 73 74 61 74 75 73 '())).. (status
7390: 65 73 20 20 20 20 20 28 69 66 20 73 74 61 74 75 es (if statu
73a0: 73 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 20 s (string-split
73b0: 73 74 61 74 75 73 20 22 2c 22 29 20 27 28 29 29 status ",") '())
73c0: 29 0a 09 20 28 73 74 61 74 65 2d 73 74 61 74 75 ).. (state-statu
73d0: 73 20 28 69 66 20 28 73 74 72 69 6e 67 3f 20 6e s (if (string? n
73e0: 65 77 2d 73 74 61 74 65 2d 73 74 61 74 75 73 29 ew-state-status)
73f0: 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 20 6e (string-split n
7400: 65 77 2d 73 74 61 74 65 2d 73 74 61 74 75 73 20 ew-state-status
7410: 22 2c 22 29 20 27 28 23 66 20 23 66 29 29 29 29 ",") '(#f #f))))
7420: 0a 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e . (debug:prin
7430: 74 20 32 20 22 48 65 61 64 65 72 3a 20 22 20 68 t 2 "Header: " h
7440: 65 61 64 65 72 20 22 20 61 63 74 69 6f 6e 3a 20 eader " action:
7450: 22 20 61 63 74 69 6f 6e 20 22 20 6e 65 77 2d 73 " action " new-s
7460: 74 61 74 65 2d 73 74 61 74 75 73 3a 20 22 20 6e tate-status: " n
7470: 65 77 2d 73 74 61 74 65 2d 73 74 61 74 75 73 29 ew-state-status)
7480: 0a 20 20 20 20 28 66 6f 72 2d 65 61 63 68 0a 20 . (for-each.
7490: 20 20 20 20 28 6c 61 6d 62 64 61 20 28 72 75 6e (lambda (run
74a0: 29 0a 20 20 20 20 20 20 20 28 6c 65 74 20 28 28 ). (let ((
74b0: 72 75 6e 6b 65 79 20 28 73 74 72 69 6e 67 2d 69 runkey (string-i
74c0: 6e 74 65 72 73 70 65 72 73 65 20 28 6d 61 70 20 ntersperse (map
74d0: 28 6c 61 6d 62 64 61 20 28 6b 29 0a 09 09 09 09 (lambda (k).....
74e0: 09 09 28 64 62 3a 67 65 74 2d 76 61 6c 75 65 2d ..(db:get-value-
74f0: 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 68 65 by-header run he
7500: 61 64 65 72 20 28 76 65 63 74 6f 72 2d 72 65 66 ader (vector-ref
7510: 20 6b 20 30 29 29 29 20 6b 65 79 73 29 20 22 2f k 0))) keys) "/
7520: 22 29 29 0a 09 20 20 20 20 20 28 64 69 72 73 2d ")).. (dirs-
7530: 74 6f 2d 72 65 6d 6f 76 65 20 28 6d 61 6b 65 2d to-remove (make-
7540: 68 61 73 68 2d 74 61 62 6c 65 29 29 29 0a 09 20 hash-table)))..
7550: 28 6c 65 74 2a 20 28 28 72 75 6e 2d 69 64 20 20 (let* ((run-id
7560: 20 20 28 64 62 3a 67 65 74 2d 76 61 6c 75 65 2d (db:get-value-
7570: 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 68 65 by-header run he
7580: 61 64 65 72 20 22 69 64 22 29 29 0a 09 09 28 72 ader "id"))...(r
7590: 75 6e 2d 73 74 61 74 65 20 28 64 62 3a 67 65 74 un-state (db:get
75a0: 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 -value-by-header
75b0: 20 72 75 6e 20 68 65 61 64 65 72 20 22 73 74 61 run header "sta
75c0: 74 65 22 29 29 0a 09 09 28 74 65 73 74 73 20 20 te"))...(tests
75d0: 20 20 20 28 69 66 20 28 6e 6f 74 20 28 65 71 75 (if (not (equ
75e0: 61 6c 3f 20 72 75 6e 2d 73 74 61 74 65 20 22 6c al? run-state "l
75f0: 6f 63 6b 65 64 22 29 29 0a 09 09 09 20 20 20 20 ocked"))....
7600: 20 20 20 28 72 64 62 3a 67 65 74 2d 74 65 73 74 (rdb:get-test
7610: 73 2d 66 6f 72 2d 72 75 6e 20 64 62 20 28 64 62 s-for-run db (db
7620: 3a 67 65 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 :get-value-by-he
7630: 61 64 65 72 20 72 75 6e 20 68 65 61 64 65 72 20 ader run header
7640: 22 69 64 22 29 0a 09 09 09 09 09 09 20 20 20 20 "id").......
7650: 20 20 74 65 73 74 70 61 74 74 20 69 74 65 6d 70 testpatt itemp
7660: 61 74 74 20 73 74 61 74 65 73 20 73 74 61 74 75 att states statu
7670: 73 65 73 0a 09 09 09 09 09 09 20 20 20 20 20 20 ses.......
7680: 6e 6f 74 2d 69 6e 3a 20 20 23 66 0a 09 09 09 09 not-in: #f.....
7690: 09 09 20 20 20 20 20 20 73 6f 72 74 2d 62 79 3a .. sort-by:
76a0: 20 28 63 61 73 65 20 61 63 74 69 6f 6e 0a 09 09 (case action...
76b0: 09 09 09 09 09 09 20 28 28 72 65 6d 6f 76 65 2d ...... ((remove-
76c0: 72 75 6e 73 29 20 27 72 75 6e 64 69 72 29 0a 09 runs) 'rundir)..
76d0: 09 09 09 09 09 09 09 20 28 65 6c 73 65 20 20 20 ....... (else
76e0: 20 20 20 20 20 20 20 27 65 76 65 6e 74 5f 74 69 'event_ti
76f0: 6d 65 29 29 29 0a 09 09 09 20 20 20 20 20 20 20 me)))....
7700: 27 28 29 29 29 0a 09 09 28 6c 61 73 74 74 70 61 '()))...(lasttpa
7710: 74 68 20 22 2f 64 6f 65 73 2f 6e 6f 74 2f 65 78 th "/does/not/ex
7720: 69 73 74 2f 49 2f 68 6f 70 65 22 29 29 0a 0a 09 ist/I/hope"))...
7730: 20 20 20 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c (if (not (nul
7740: 6c 3f 20 74 65 73 74 73 29 29 0a 09 20 20 20 20 l? tests))..
7750: 20 20 20 28 62 65 67 69 6e 0a 09 09 20 28 63 61 (begin... (ca
7760: 73 65 20 61 63 74 69 6f 6e 0a 09 09 20 20 20 28 se action... (
7770: 28 72 65 6d 6f 76 65 2d 72 75 6e 73 29 0a 09 09 (remove-runs)...
7780: 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 (debug:print
7790: 20 31 20 22 52 65 6d 6f 76 69 6e 67 20 74 65 73 1 "Removing tes
77a0: 74 73 20 66 6f 72 20 72 75 6e 3a 20 22 20 72 75 ts for run: " ru
77b0: 6e 6b 65 79 20 22 20 22 20 28 64 62 3a 67 65 74 nkey " " (db:get
77c0: 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 -value-by-header
77d0: 20 72 75 6e 20 68 65 61 64 65 72 20 22 72 75 6e run header "run
77e0: 6e 61 6d 65 22 29 29 29 0a 09 09 20 20 20 28 28 name")))... ((
77f0: 73 65 74 2d 73 74 61 74 65 2d 73 74 61 74 75 73 set-state-status
7800: 29 0a 09 09 20 20 20 20 28 64 65 62 75 67 3a 70 )... (debug:p
7810: 72 69 6e 74 20 31 20 22 4d 6f 64 69 66 79 69 6e rint 1 "Modifyin
7820: 67 20 73 74 61 74 65 20 61 6e 64 20 73 74 61 75 g state and stau
7830: 73 20 66 6f 72 20 74 65 73 74 73 20 66 6f 72 20 s for tests for
7840: 72 75 6e 3a 20 22 20 72 75 6e 6b 65 79 20 22 20 run: " runkey "
7850: 22 20 28 64 62 3a 67 65 74 2d 76 61 6c 75 65 2d " (db:get-value-
7860: 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 68 65 by-header run he
7870: 61 64 65 72 20 22 72 75 6e 6e 61 6d 65 22 29 29 ader "runname"))
7880: 29 0a 09 09 20 20 20 28 65 6c 73 65 0a 09 09 20 )... (else...
7890: 20 20 20 28 70 72 69 6e 74 20 22 49 4e 46 4f 3a (print "INFO:
78a0: 20 61 63 74 69 6f 6e 20 6e 6f 74 20 72 65 63 6f action not reco
78b0: 67 6e 69 73 65 64 20 22 20 61 63 74 69 6f 6e 29 gnised " action)
78c0: 29 29 0a 09 09 20 28 66 6f 72 2d 65 61 63 68 0a ))... (for-each.
78d0: 09 09 20 20 28 6c 61 6d 62 64 61 20 28 74 65 73 .. (lambda (tes
78e0: 74 29 0a 09 09 20 20 20 20 28 6c 65 74 2a 20 28 t)... (let* (
78f0: 28 69 74 65 6d 2d 70 61 74 68 20 28 64 62 3a 74 (item-path (db:t
7900: 65 73 74 2d 67 65 74 2d 69 74 65 6d 2d 70 61 74 est-get-item-pat
7910: 68 20 74 65 73 74 29 29 0a 09 09 09 20 20 20 28 h test)).... (
7920: 74 65 73 74 2d 6e 61 6d 65 20 28 64 62 3a 74 65 test-name (db:te
7930: 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 st-get-testname
7940: 74 65 73 74 29 29 0a 09 09 09 20 20 20 28 72 75 test)).... (ru
7950: 6e 2d 64 69 72 20 20 20 28 64 62 3a 74 65 73 74 n-dir (db:test
7960: 2d 67 65 74 2d 72 75 6e 64 69 72 20 74 65 73 74 -get-rundir test
7970: 29 29 29 0a 09 09 20 20 20 20 20 20 28 64 65 62 )))... (deb
7980: 75 67 3a 70 72 69 6e 74 20 31 20 22 20 20 22 20 ug:print 1 " "
7990: 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 74 65 73 (db:test-get-tes
79a0: 74 6e 61 6d 65 20 74 65 73 74 29 20 22 20 69 64 tname test) " id
79b0: 3a 20 22 20 28 64 62 3a 74 65 73 74 2d 67 65 74 : " (db:test-get
79c0: 2d 69 64 20 74 65 73 74 29 20 22 20 22 20 69 74 -id test) " " it
79d0: 65 6d 2d 70 61 74 68 20 22 20 61 63 74 69 6f 6e em-path " action
79e0: 3a 20 22 20 61 63 74 69 6f 6e 29 0a 09 09 20 20 : " action)...
79f0: 20 20 20 20 28 63 61 73 65 20 61 63 74 69 6f 6e (case action
7a00: 0a 09 09 09 28 28 72 65 6d 6f 76 65 2d 72 75 6e ....((remove-run
7a10: 73 29 0a 09 09 09 20 28 72 64 62 3a 64 65 6c 65 s).... (rdb:dele
7a20: 74 65 2d 74 65 73 74 2d 72 65 63 6f 72 64 73 20 te-test-records
7a30: 64 62 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d db (db:test-get-
7a40: 69 64 20 74 65 73 74 29 29 0a 09 09 09 20 28 64 id test)).... (d
7a50: 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 49 4e ebug:print 1 "IN
7a60: 46 4f 3a 20 41 74 74 65 6d 70 74 69 6e 67 20 74 FO: Attempting t
7a70: 6f 20 72 65 6d 6f 76 65 20 64 69 72 20 22 20 72 o remove dir " r
7a80: 75 6e 2d 64 69 72 29 0a 09 09 09 20 28 69 66 20 un-dir).... (if
7a90: 28 61 6e 64 20 28 3e 20 28 73 74 72 69 6e 67 2d (and (> (string-
7aa0: 6c 65 6e 67 74 68 20 72 75 6e 2d 64 69 72 29 20 length run-dir)
7ab0: 35 29 0a 09 09 09 09 20 20 28 66 69 6c 65 2d 65 5)..... (file-e
7ac0: 78 69 73 74 73 3f 20 72 75 6e 2d 64 69 72 29 29 xists? run-dir))
7ad0: 20 3b 3b 20 62 61 64 20 68 65 75 72 69 73 74 69 ;; bad heuristi
7ae0: 63 20 62 75 74 20 73 68 6f 75 6c 64 20 70 72 65 c but should pre
7af0: 76 65 6e 74 20 2f 74 6d 70 20 2f 68 6f 6d 65 20 vent /tmp /home
7b00: 65 74 63 2e 0a 09 09 09 20 20 20 20 20 28 6c 65 etc..... (le
7b10: 74 2a 20 28 28 72 65 61 6c 70 61 74 68 20 28 72 t* ((realpath (r
7b20: 65 73 6f 6c 76 65 2d 70 61 74 68 6e 61 6d 65 20 esolve-pathname
7b30: 72 75 6e 2d 64 69 72 29 29 29 0a 09 09 09 20 20 run-dir)))....
7b40: 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e (debug:prin
7b50: 74 20 31 20 22 49 4e 46 4f 3a 20 52 65 61 6c 20 t 1 "INFO: Real
7b60: 70 61 74 68 20 6f 66 20 69 73 20 22 20 72 65 61 path of is " rea
7b70: 6c 70 61 74 68 29 0a 09 09 09 20 20 20 20 20 20 lpath)....
7b80: 20 28 69 66 20 28 66 69 6c 65 2d 65 78 69 73 74 (if (file-exist
7b90: 73 3f 20 72 65 61 6c 70 61 74 68 29 0a 09 09 09 s? realpath)....
7ba0: 09 20 20 20 28 69 66 20 28 3e 20 28 73 79 73 74 . (if (> (syst
7bb0: 65 6d 20 28 63 6f 6e 63 20 22 72 6d 20 2d 72 66 em (conc "rm -rf
7bc0: 20 22 20 72 65 61 6c 70 61 74 68 29 29 20 30 29 " realpath)) 0)
7bd0: 0a 09 09 09 09 20 20 20 20 20 20 20 28 64 65 62 ..... (deb
7be0: 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f ug:print 0 "ERRO
7bf0: 52 3a 20 54 68 65 72 65 20 77 61 73 20 61 20 70 R: There was a p
7c00: 72 6f 62 6c 65 6d 20 72 65 6d 6f 76 69 6e 67 20 roblem removing
7c10: 22 20 72 65 61 6c 70 61 74 68 20 22 20 77 69 74 " realpath " wit
7c20: 68 20 72 6d 20 2d 66 22 29 29 0a 09 09 09 09 20 h rm -f")).....
7c30: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 (debug:print 0
7c40: 20 22 57 41 52 4e 49 4e 47 3a 20 74 65 73 74 20 "WARNING: test
7c50: 72 75 6e 20 64 69 72 20 22 20 72 65 61 6c 70 61 run dir " realpa
7c60: 74 68 20 22 20 61 70 70 65 61 72 73 20 74 6f 20 th " appears to
7c70: 6e 6f 74 20 65 78 69 73 74 22 29 29 0a 09 09 09 not exist"))....
7c80: 20 20 20 20 20 20 20 28 69 66 20 28 66 69 6c 65 (if (file
7c90: 2d 65 78 69 73 74 73 3f 20 72 75 6e 2d 64 69 72 -exists? run-dir
7ca0: 29 20 3b 3b 20 74 68 65 20 6c 69 6e 6b 0a 09 09 ) ;; the link...
7cb0: 09 09 20 20 20 28 69 66 20 28 73 79 6d 62 6f 6c .. (if (symbol
7cc0: 69 63 2d 6c 69 6e 6b 3f 20 72 75 6e 2d 64 69 72 ic-link? run-dir
7cd0: 29 0a 09 09 09 09 20 20 20 20 20 20 20 28 64 65 )..... (de
7ce0: 6c 65 74 65 2d 66 69 6c 65 20 72 75 6e 2d 64 69 lete-file run-di
7cf0: 72 29 0a 09 09 09 09 20 20 20 20 20 20 20 28 69 r)..... (i
7d00: 66 20 28 64 69 72 65 63 74 6f 72 79 3f 20 72 75 f (directory? ru
7d10: 6e 2d 64 69 72 29 0a 09 09 09 09 09 20 20 20 28 n-dir)...... (
7d20: 69 66 20 28 3e 20 28 64 69 72 65 63 74 6f 72 79 if (> (directory
7d30: 2d 66 6f 6c 64 20 28 6c 61 6d 62 64 61 20 28 66 -fold (lambda (f
7d40: 20 78 29 28 2b 20 31 20 78 29 29 20 30 20 72 75 x)(+ 1 x)) 0 ru
7d50: 6e 2d 64 69 72 29 20 30 29 0a 09 09 09 09 09 20 n-dir) 0)......
7d60: 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 (debug:pri
7d70: 6e 74 20 30 20 22 57 41 52 4e 49 4e 47 3a 20 72 nt 0 "WARNING: r
7d80: 65 66 75 73 69 6e 67 20 74 6f 20 72 65 6d 6f 76 efusing to remov
7d90: 65 20 22 20 72 75 6e 2d 64 69 72 20 22 20 61 73 e " run-dir " as
7da0: 20 69 74 20 69 73 20 6e 6f 74 20 65 6d 70 74 79 it is not empty
7db0: 22 29 0a 09 09 09 09 09 20 20 20 20 20 20 20 28 ")...... (
7dc0: 64 65 6c 65 74 65 2d 64 69 72 65 63 74 6f 72 79 delete-directory
7dd0: 20 72 75 6e 2d 64 69 72 29 29 20 3b 3b 20 69 74 run-dir)) ;; it
7de0: 20 73 68 6f 75 6c 64 20 62 65 20 65 6d 70 74 79 should be empty
7df0: 20 62 79 20 68 65 72 65 20 42 55 47 20 42 55 47 by here BUG BUG
7e00: 2c 20 61 64 64 20 65 72 72 6f 72 20 63 61 74 63 , add error catc
7e10: 68 0a 09 09 09 09 09 20 20 20 28 64 65 62 75 67 h...... (debug
7e20: 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a :print 0 "ERROR:
7e30: 20 72 65 66 75 73 69 6e 67 20 74 6f 20 72 65 6d refusing to rem
7e40: 6f 76 65 20 22 20 72 75 6e 2d 64 69 72 20 22 20 ove " run-dir "
7e50: 61 73 20 69 74 20 69 73 20 6e 65 69 74 68 65 72 as it is neither
7e60: 20 61 20 73 79 6d 6c 69 6e 6b 20 6e 6f 72 20 61 a symlink nor a
7e70: 20 64 69 72 65 63 74 6f 72 79 22 29 0a 09 09 09 directory")....
7e80: 09 09 20 20 20 29 29 29 29 0a 09 09 09 20 20 20 .. ))))....
7e90: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 (debug:print 0
7ea0: 20 22 57 41 52 4e 49 4e 47 3a 20 64 69 72 65 63 "WARNING: direc
7eb0: 74 6f 72 79 20 61 6c 72 65 61 64 79 20 72 65 6d tory already rem
7ec0: 6f 76 65 64 20 22 20 72 75 6e 2d 64 69 72 29 29 oved " run-dir))
7ed0: 29 0a 09 09 09 28 28 73 65 74 2d 73 74 61 74 65 )....((set-state
7ee0: 2d 73 74 61 74 75 73 29 0a 09 09 09 20 28 64 65 -status).... (de
7ef0: 62 75 67 3a 70 72 69 6e 74 20 32 20 22 49 4e 46 bug:print 2 "INF
7f00: 4f 3a 20 6e 65 77 20 73 74 61 74 65 20 22 20 28 O: new state " (
7f10: 63 61 72 20 73 74 61 74 65 2d 73 74 61 74 75 73 car state-status
7f20: 29 20 22 2c 20 6e 65 77 20 73 74 61 74 75 73 20 ) ", new status
7f30: 22 20 28 63 61 64 72 20 73 74 61 74 65 2d 73 74 " (cadr state-st
7f40: 61 74 75 73 29 29 0a 09 09 09 20 28 64 62 3a 74 atus)).... (db:t
7f50: 65 73 74 2d 73 65 74 2d 73 74 61 74 65 2d 73 74 est-set-state-st
7f60: 61 74 75 73 2d 62 79 2d 69 64 20 64 62 20 28 64 atus-by-id db (d
7f70: 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 b:test-get-id te
7f80: 73 74 29 20 28 63 61 72 20 73 74 61 74 65 2d 73 st) (car state-s
7f90: 74 61 74 75 73 29 28 63 61 64 72 20 73 74 61 74 tatus)(cadr stat
7fa0: 65 2d 73 74 61 74 75 73 29 20 23 66 29 29 29 29 e-status) #f))))
7fb0: 29 0a 09 09 20 20 74 65 73 74 73 29 29 29 0a 09 )... tests)))..
7fc0: 20 20 20 0a 09 20 20 20 3b 3b 20 72 65 6d 6f 76 .. ;; remov
7fd0: 65 20 74 68 65 20 72 75 6e 20 69 66 20 7a 65 72 e the run if zer
7fe0: 6f 20 74 65 73 74 73 20 72 65 6d 61 69 6e 0a 09 o tests remain..
7ff0: 20 20 20 28 69 66 20 28 65 71 3f 20 61 63 74 69 (if (eq? acti
8000: 6f 6e 20 27 72 65 6d 6f 76 65 2d 72 75 6e 73 29 on 'remove-runs)
8010: 0a 09 20 20 20 20 20 20 20 28 6c 65 74 20 28 28 .. (let ((
8020: 72 65 6d 74 65 73 74 73 20 28 72 64 62 3a 67 65 remtests (rdb:ge
8030: 74 2d 74 65 73 74 73 2d 66 6f 72 2d 72 75 6e 20 t-tests-for-run
8040: 64 62 20 28 64 62 3a 67 65 74 2d 76 61 6c 75 65 db (db:get-value
8050: 2d 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 68 -by-header run h
8060: 65 61 64 65 72 20 22 69 64 22 29 20 23 66 20 23 eader "id") #f #
8070: 66 20 27 28 29 20 27 28 29 29 29 29 0a 09 09 20 f '() '())))...
8080: 28 69 66 20 28 6e 75 6c 6c 3f 20 72 65 6d 74 65 (if (null? remte
8090: 73 74 73 29 20 3b 3b 20 6e 6f 20 6d 6f 72 65 20 sts) ;; no more
80a0: 74 65 73 74 73 20 72 65 6d 61 69 6e 69 6e 67 0a tests remaining.
80b0: 09 09 20 20 20 20 20 28 6c 65 74 2a 20 28 28 64 .. (let* ((d
80c0: 70 61 72 74 73 20 20 28 73 74 72 69 6e 67 2d 73 parts (string-s
80d0: 70 6c 69 74 20 6c 61 73 74 74 70 61 74 68 20 22 plit lasttpath "
80e0: 2f 22 29 29 0a 09 09 09 20 20 20 20 28 72 75 6e /")).... (run
80f0: 70 61 74 68 20 28 63 6f 6e 63 20 22 2f 22 20 28 path (conc "/" (
8100: 73 74 72 69 6e 67 2d 69 6e 74 65 72 73 70 65 72 string-intersper
8110: 73 65 20 0a 09 09 09 09 09 09 28 74 61 6b 65 20 se .......(take
8120: 64 70 61 72 74 73 20 28 2d 20 28 6c 65 6e 67 74 dparts (- (lengt
8130: 68 20 64 70 61 72 74 73 29 20 31 29 29 0a 09 09 h dparts) 1))...
8140: 09 09 09 09 22 2f 22 29 29 29 29 0a 09 09 20 20 ...."/"))))...
8150: 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e (debug:prin
8160: 74 20 31 20 22 52 65 6d 6f 76 69 6e 67 20 72 75 t 1 "Removing ru
8170: 6e 3a 20 22 20 72 75 6e 6b 65 79 20 22 20 22 20 n: " runkey " "
8180: 28 64 62 3a 67 65 74 2d 76 61 6c 75 65 2d 62 79 (db:get-value-by
8190: 2d 68 65 61 64 65 72 20 72 75 6e 20 68 65 61 64 -header run head
81a0: 65 72 20 22 72 75 6e 6e 61 6d 65 22 29 29 0a 09 er "runname"))..
81b0: 09 20 20 20 20 20 20 20 28 64 62 3a 64 65 6c 65 . (db:dele
81c0: 74 65 2d 72 75 6e 20 64 62 20 72 75 6e 2d 69 64 te-run db run-id
81d0: 29 0a 09 09 20 20 20 20 20 20 20 3b 3b 20 6e 65 )... ;; ne
81e0: 65 64 20 74 6f 20 66 69 67 75 72 65 20 6f 75 74 ed to figure out
81f0: 20 74 68 65 20 70 61 74 68 20 74 6f 20 74 68 65 the path to the
8200: 20 72 75 6e 20 64 69 72 20 61 6e 64 20 72 65 6d run dir and rem
8210: 6f 76 65 20 69 74 20 69 66 20 65 6d 70 74 79 0a ove it if empty.
8220: 09 09 20 20 20 20 20 20 20 3b 3b 20 20 20 20 28 .. ;; (
8230: 69 66 20 28 6e 75 6c 6c 3f 20 28 67 6c 6f 62 20 if (null? (glob
8240: 28 63 6f 6e 63 20 72 75 6e 70 61 74 68 20 22 2f (conc runpath "/
8250: 2a 22 29 29 29 0a 09 09 20 20 20 20 20 20 20 3b *")))... ;
8260: 3b 20 20 20 20 20 20 20 20 28 62 65 67 69 6e 0a ; (begin.
8270: 09 09 20 20 20 20 20 20 20 3b 3b 20 09 20 28 64 .. ;; . (d
8280: 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 52 65 ebug:print 1 "Re
8290: 6d 6f 76 69 6e 67 20 72 75 6e 20 64 69 72 20 22 moving run dir "
82a0: 20 72 75 6e 70 61 74 68 29 0a 09 09 20 20 20 20 runpath)...
82b0: 20 20 20 3b 3b 20 09 20 28 73 79 73 74 65 6d 20 ;; . (system
82c0: 28 63 6f 6e 63 20 22 72 6d 64 69 72 20 2d 70 20 (conc "rmdir -p
82d0: 22 20 72 75 6e 70 61 74 68 29 29 29 29 0a 09 09 " runpath))))...
82e0: 20 20 20 20 20 20 20 29 29 29 29 29 0a 09 20 29 ))))).. )
82f0: 29 0a 20 20 20 20 20 72 75 6e 73 29 29 29 0a 0a ). runs)))..
8300: 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ;;==============
8310: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8320: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8330: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8340: 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 52 6f 75 74 ========.;; Rout
8350: 69 6e 65 73 20 66 6f 72 20 6d 61 6e 69 70 75 6c ines for manipul
8360: 61 74 69 6e 67 20 72 75 6e 73 0a 3b 3b 3d 3d 3d ating runs.;;===
8370: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8380: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8390: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
83a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
83b0: 3d 3d 3d 0a 0a 3b 3b 20 53 69 6e 63 65 20 6d 61 ===..;; Since ma
83c0: 6e 79 20 63 61 6c 6c 73 20 74 6f 20 61 20 72 75 ny calls to a ru
83d0: 6e 20 72 65 71 75 69 72 65 20 70 72 65 74 74 79 n require pretty
83e0: 20 6d 75 63 68 20 74 68 65 20 73 61 6d 65 20 73 much the same s
83f0: 65 74 75 70 20 0a 3b 3b 20 74 68 69 73 20 77 72 etup .;; this wr
8400: 61 70 70 65 72 20 69 73 20 75 73 65 64 20 74 6f apper is used to
8410: 20 72 65 64 75 63 65 20 74 68 65 20 72 65 70 6c reduce the repl
8420: 69 63 61 74 69 6f 6e 20 6f 66 20 63 6f 64 65 0a ication of code.
8430: 28 64 65 66 69 6e 65 20 28 67 65 6e 65 72 61 6c (define (general
8440: 2d 72 75 6e 2d 63 61 6c 6c 20 73 77 69 74 63 68 -run-call switch
8450: 6e 61 6d 65 20 61 63 74 69 6f 6e 2d 64 65 73 63 name action-desc
8460: 20 70 72 6f 63 29 0a 20 20 28 6c 65 74 20 28 28 proc). (let ((
8470: 72 75 6e 6e 61 6d 65 20 28 61 72 67 73 3a 67 65 runname (args:ge
8480: 74 2d 61 72 67 20 22 3a 72 75 6e 6e 61 6d 65 22 t-arg ":runname"
8490: 29 29 0a 09 28 74 61 72 67 65 74 20 20 28 69 66 ))..(target (if
84a0: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
84b0: 2d 74 61 72 67 65 74 22 29 0a 09 09 20 20 20 20 -target")...
84c0: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
84d0: 2d 74 61 72 67 65 74 22 29 0a 09 09 20 20 20 20 -target")...
84e0: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
84f0: 2d 72 65 71 74 61 72 67 22 29 29 29 0a 09 28 74 -reqtarg")))..(t
8500: 68 31 20 20 20 20 20 23 66 29 29 0a 20 20 20 20 h1 #f)).
8510: 28 63 6f 6e 64 0a 20 20 20 20 20 28 28 6e 6f 74 (cond. ((not
8520: 20 74 61 72 67 65 74 29 0a 20 20 20 20 20 20 28 target). (
8530: 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 debug:print 0 "E
8540: 52 52 4f 52 3a 20 4d 69 73 73 69 6e 67 20 72 65 RROR: Missing re
8550: 71 75 69 72 65 64 20 70 61 72 61 6d 65 74 65 72 quired parameter
8560: 20 66 6f 72 20 22 20 73 77 69 74 63 68 6e 61 6d for " switchnam
8570: 65 20 22 2c 20 79 6f 75 20 6d 75 73 74 20 73 70 e ", you must sp
8580: 65 63 69 66 79 20 74 68 65 20 74 61 72 67 65 74 ecify the target
8590: 20 77 69 74 68 20 2d 74 61 72 67 65 74 22 29 0a with -target").
85a0: 20 20 20 20 20 20 28 65 78 69 74 20 33 29 29 0a (exit 3)).
85b0: 20 20 20 20 20 28 28 6e 6f 74 20 72 75 6e 6e 61 ((not runna
85c0: 6d 65 29 0a 20 20 20 20 20 20 28 64 65 62 75 67 me). (debug
85d0: 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a :print 0 "ERROR:
85e0: 20 4d 69 73 73 69 6e 67 20 72 65 71 75 69 72 65 Missing require
85f0: 64 20 70 61 72 61 6d 65 74 65 72 20 66 6f 72 20 d parameter for
8600: 22 20 73 77 69 74 63 68 6e 61 6d 65 20 22 2c 20 " switchname ",
8610: 79 6f 75 20 6d 75 73 74 20 73 70 65 63 69 66 79 you must specify
8620: 20 74 68 65 20 72 75 6e 20 6e 61 6d 65 20 77 69 the run name wi
8630: 74 68 20 3a 72 75 6e 6e 61 6d 65 20 72 75 6e 6e th :runname runn
8640: 61 6d 65 22 29 0a 20 20 20 20 20 20 28 65 78 69 ame"). (exi
8650: 74 20 33 29 29 0a 20 20 20 20 20 28 65 6c 73 65 t 3)). (else
8660: 0a 20 20 20 20 20 20 28 6c 65 74 20 28 28 64 62 . (let ((db
8670: 20 20 20 23 66 29 0a 09 20 20 20 20 28 6b 65 79 #f).. (key
8680: 73 20 23 66 29 29 0a 09 28 69 66 20 28 6e 6f 74 s #f))..(if (not
8690: 20 28 73 65 74 75 70 2d 66 6f 72 2d 72 75 6e 29 (setup-for-run)
86a0: 29 0a 09 20 20 20 20 28 62 65 67 69 6e 20 0a 09 ).. (begin ..
86b0: 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 (debug:pri
86c0: 6e 74 20 30 20 22 46 61 69 6c 65 64 20 74 6f 20 nt 0 "Failed to
86d0: 73 65 74 75 70 2c 20 65 78 69 74 69 6e 67 22 29 setup, exiting")
86e0: 0a 09 20 20 20 20 20 20 28 65 78 69 74 20 31 29 .. (exit 1)
86f0: 29 29 0a 09 28 73 65 74 21 20 64 62 20 20 20 28 ))..(set! db (
8700: 6f 70 65 6e 2d 64 62 29 29 0a 09 28 69 66 20 28 open-db))..(if (
8710: 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 73 args:get-arg "-s
8720: 65 72 76 65 72 22 29 0a 09 20 20 20 20 28 73 65 erver").. (se
8730: 72 76 65 72 3a 73 74 61 72 74 20 64 62 20 28 61 rver:start db (a
8740: 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 73 65 rgs:get-arg "-se
8750: 72 76 65 72 22 29 29 0a 09 20 20 20 20 28 69 66 rver")).. (if
8760: 20 28 6e 6f 74 20 28 6f 72 20 28 61 72 67 73 3a (not (or (args:
8770: 67 65 74 2d 61 72 67 20 22 2d 72 75 6e 61 6c 6c get-arg "-runall
8780: 22 29 0a 09 09 09 20 20 28 61 72 67 73 3a 67 65 ").... (args:ge
8790: 74 2d 61 72 67 20 22 2d 72 75 6e 74 65 73 74 73 t-arg "-runtests
87a0: 22 29 29 29 0a 09 09 28 73 65 72 76 65 72 3a 63 ")))...(server:c
87b0: 6c 69 65 6e 74 2d 73 65 74 75 70 20 64 62 29 29 lient-setup db))
87c0: 29 0a 09 28 73 65 74 21 20 6b 65 79 73 20 28 72 )..(set! keys (r
87d0: 64 62 3a 67 65 74 2d 6b 65 79 73 20 64 62 29 29 db:get-keys db))
87e0: 0a 09 3b 3b 20 68 61 76 65 20 65 6e 6f 75 67 68 ..;; have enough
87f0: 20 74 6f 20 70 72 6f 63 65 73 73 20 2d 74 61 72 to process -tar
8800: 67 65 74 20 6f 72 20 2d 72 65 71 74 61 72 67 20 get or -reqtarg
8810: 68 65 72 65 0a 09 28 69 66 20 28 61 72 67 73 3a here..(if (args:
8820: 67 65 74 2d 61 72 67 20 22 2d 72 65 71 74 61 72 get-arg "-reqtar
8830: 67 22 29 0a 09 20 20 20 20 28 6c 65 74 2a 20 28 g").. (let* (
8840: 28 72 75 6e 63 6f 6e 66 69 67 66 20 28 63 6f 6e (runconfigf (con
8850: 63 20 20 2a 74 6f 70 70 61 74 68 2a 20 22 2f 72 c *toppath* "/r
8860: 75 6e 63 6f 6e 66 69 67 73 2e 63 6f 6e 66 69 67 unconfigs.config
8870: 22 29 29 20 3b 3b 20 44 4f 20 4e 4f 54 20 45 56 ")) ;; DO NOT EV
8880: 41 4c 55 41 54 45 20 41 4c 4c 20 0a 09 09 20 20 ALUATE ALL ...
8890: 20 28 72 75 6e 63 6f 6e 66 69 67 20 20 28 72 65 (runconfig (re
88a0: 61 64 2d 63 6f 6e 66 69 67 20 72 75 6e 63 6f 6e ad-config runcon
88b0: 66 69 67 66 20 23 66 20 23 66 20 65 6e 76 69 72 figf #f #f envir
88c0: 6f 6e 2d 70 61 74 74 3a 20 23 66 29 29 29 20 0a on-patt: #f))) .
88d0: 09 20 20 20 20 20 20 28 69 66 20 28 68 61 73 68 . (if (hash
88e0: 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 -table-ref/defau
88f0: 6c 74 20 72 75 6e 63 6f 6e 66 69 67 20 28 61 72 lt runconfig (ar
8900: 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 72 65 71 gs:get-arg "-req
8910: 74 61 72 67 22 29 20 23 66 29 0a 09 09 20 20 28 targ") #f)... (
8920: 6b 65 79 73 3a 74 61 72 67 65 74 2d 73 65 74 2d keys:target-set-
8930: 61 72 67 73 20 6b 65 79 73 20 28 61 72 67 73 3a args keys (args:
8940: 67 65 74 2d 61 72 67 20 22 2d 72 65 71 74 61 72 get-arg "-reqtar
8950: 67 22 29 20 61 72 67 73 3a 61 72 67 2d 68 61 73 g") args:arg-has
8960: 68 29 0a 09 09 20 20 28 62 65 67 69 6e 0a 09 09 h)... (begin...
8970: 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 (debug:print
8980: 20 30 20 22 45 52 52 4f 52 3a 20 5b 22 20 28 61 0 "ERROR: [" (a
8990: 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 72 65 rgs:get-arg "-re
89a0: 71 74 61 72 67 22 29 20 22 5d 20 6e 6f 74 20 66 qtarg") "] not f
89b0: 6f 75 6e 64 20 69 6e 20 22 20 72 75 6e 63 6f 6e ound in " runcon
89c0: 66 69 67 66 29 0a 09 09 20 20 20 20 28 73 71 6c figf)... (sql
89d0: 69 74 65 33 3a 66 69 6e 61 6c 69 7a 65 21 20 64 ite3:finalize! d
89e0: 62 29 0a 09 09 20 20 20 20 28 65 78 69 74 20 31 b)... (exit 1
89f0: 29 29 29 29 0a 09 20 20 20 20 28 69 66 20 28 61 )))).. (if (a
8a00: 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 74 61 rgs:get-arg "-ta
8a10: 72 67 65 74 22 29 0a 09 09 28 6b 65 79 73 3a 74 rget")...(keys:t
8a20: 61 72 67 65 74 2d 73 65 74 2d 61 72 67 73 20 6b arget-set-args k
8a30: 65 79 73 20 28 61 72 67 73 3a 67 65 74 2d 61 72 eys (args:get-ar
8a40: 67 20 22 2d 74 61 72 67 65 74 22 20 61 72 67 73 g "-target" args
8a50: 3a 61 72 67 2d 68 61 73 68 29 20 61 72 67 73 3a :arg-hash) args:
8a60: 61 72 67 2d 68 61 73 68 29 29 29 0a 09 28 69 66 arg-hash)))..(if
8a70: 20 28 6e 6f 74 20 28 63 61 72 20 2a 63 6f 6e 66 (not (car *conf
8a80: 69 67 69 6e 66 6f 2a 29 29 0a 09 20 20 20 20 28 iginfo*)).. (
8a90: 62 65 67 69 6e 0a 09 20 20 20 20 20 20 28 64 65 begin.. (de
8aa0: 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 bug:print 0 "ERR
8ab0: 4f 52 3a 20 41 74 74 65 6d 70 74 65 64 20 74 6f OR: Attempted to
8ac0: 20 22 20 61 63 74 69 6f 6e 2d 64 65 73 63 20 22 " action-desc "
8ad0: 20 62 75 74 20 72 75 6e 20 61 72 65 61 20 63 6f but run area co
8ae0: 6e 66 69 67 20 66 69 6c 65 20 6e 6f 74 20 66 6f nfig file not fo
8af0: 75 6e 64 22 29 0a 09 20 20 20 20 20 20 28 65 78 und").. (ex
8b00: 69 74 20 31 29 29 0a 09 20 20 20 20 3b 3b 20 45 it 1)).. ;; E
8b10: 78 74 72 61 63 74 20 6f 75 74 20 73 74 75 66 66 xtract out stuff
8b20: 20 6e 65 65 64 65 64 20 69 6e 20 6d 6f 73 74 20 needed in most
8b30: 6f 72 20 6d 61 6e 79 20 63 61 6c 6c 73 0a 09 20 or many calls..
8b40: 20 20 20 3b 3b 20 68 65 72 65 20 74 68 65 6e 20 ;; here then
8b50: 63 61 6c 6c 20 70 72 6f 63 0a 09 20 20 20 20 28 call proc.. (
8b60: 6c 65 74 2a 20 28 28 6b 65 79 6e 61 6d 65 73 20 let* ((keynames
8b70: 20 20 28 6d 61 70 20 6b 65 79 3a 67 65 74 2d 66 (map key:get-f
8b80: 69 65 6c 64 6e 61 6d 65 20 6b 65 79 73 29 29 0a ieldname keys)).
8b90: 09 09 20 20 20 28 6b 65 79 76 61 6c 6c 73 74 20 .. (keyvallst
8ba0: 20 28 6b 65 79 73 2d 3e 76 61 6c 6c 69 73 74 20 (keys->vallist
8bb0: 6b 65 79 73 20 23 74 29 29 29 0a 09 20 20 20 20 keys #t)))..
8bc0: 20 20 28 70 72 6f 63 20 64 62 20 74 61 72 67 65 (proc db targe
8bd0: 74 20 72 75 6e 6e 61 6d 65 20 6b 65 79 73 20 6b t runname keys k
8be0: 65 79 6e 61 6d 65 73 20 6b 65 79 76 61 6c 6c 73 eynames keyvalls
8bf0: 74 29 29 29 0a 09 28 69 66 20 74 68 31 20 28 74 t)))..(if th1 (t
8c00: 68 72 65 61 64 2d 6a 6f 69 6e 21 20 74 68 31 29 hread-join! th1)
8c10: 29 0a 09 28 73 71 6c 69 74 65 33 3a 66 69 6e 61 )..(sqlite3:fina
8c20: 6c 69 7a 65 21 20 64 62 29 0a 09 28 73 65 74 21 lize! db)..(set!
8c30: 20 2a 64 69 64 73 6f 6d 65 74 68 69 6e 67 2a 20 *didsomething*
8c40: 23 74 29 29 29 29 29 29 0a 0a 3b 3b 3d 3d 3d 3d #t))))))..;;====
8c50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8c60: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8c70: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8c80: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8c90: 3d 3d 0a 3b 3b 20 4c 6f 63 6b 2f 75 6e 6c 6f 63 ==.;; Lock/unloc
8ca0: 6b 20 72 75 6e 73 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d k runs.;;=======
8cb0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8cc0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8cd0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8ce0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a ===============.
8cf0: 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 3a 68 .(define (runs:h
8d00: 61 6e 64 6c 65 2d 6c 6f 63 6b 69 6e 67 20 64 62 andle-locking db
8d10: 20 74 61 72 67 65 74 20 6b 65 79 73 20 72 75 6e target keys run
8d20: 6e 61 6d 65 20 6c 6f 63 6b 20 75 6e 6c 6f 63 6b name lock unlock
8d30: 20 75 73 65 72 29 0a 20 20 28 6c 65 74 2a 20 28 user). (let* (
8d40: 28 72 75 6e 64 61 74 20 20 20 28 72 75 6e 73 3a (rundat (runs:
8d50: 67 65 74 2d 72 75 6e 73 2d 62 79 2d 70 61 74 74 get-runs-by-patt
8d60: 20 64 62 20 6b 65 79 73 20 72 75 6e 6e 61 6d 65 db keys runname
8d70: 29 29 0a 09 20 28 68 65 61 64 65 72 20 20 20 28 )).. (header (
8d80: 76 65 63 74 6f 72 2d 72 65 66 20 72 75 6e 64 61 vector-ref runda
8d90: 74 20 30 29 29 0a 09 20 28 72 75 6e 73 20 20 20 t 0)).. (runs
8da0: 20 20 28 76 65 63 74 6f 72 2d 72 65 66 20 72 75 (vector-ref ru
8db0: 6e 64 61 74 20 31 29 29 29 0a 20 20 20 20 28 66 ndat 1))). (f
8dc0: 6f 72 2d 65 61 63 68 20 28 6c 61 6d 62 64 61 20 or-each (lambda
8dd0: 28 72 75 6e 29 0a 09 09 28 6c 65 74 20 28 28 72 (run)...(let ((r
8de0: 75 6e 2d 69 64 20 28 64 62 3a 67 65 74 2d 76 61 un-id (db:get-va
8df0: 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 20 72 75 lue-by-header ru
8e00: 6e 20 68 65 61 64 65 72 20 22 69 64 22 29 29 29 n header "id")))
8e10: 0a 09 09 20 20 28 69 66 20 28 6f 72 20 6c 6f 63 ... (if (or loc
8e20: 6b 0a 09 09 09 20 20 28 61 6e 64 20 75 6e 6c 6f k.... (and unlo
8e30: 63 6b 0a 09 09 09 20 20 20 20 20 20 20 28 62 65 ck.... (be
8e40: 67 69 6e 0a 09 09 09 09 20 28 70 72 69 6e 74 20 gin..... (print
8e50: 22 44 6f 20 79 6f 75 20 72 65 61 6c 6c 79 20 77 "Do you really w
8e60: 69 73 68 20 74 6f 20 75 6e 6c 6f 63 6b 20 72 75 ish to unlock ru
8e70: 6e 20 22 20 72 75 6e 2d 69 64 20 22 3f 5c 6e 20 n " run-id "?\n
8e80: 20 20 79 2f 6e 3a 20 22 29 0a 09 09 09 09 20 28 y/n: ")..... (
8e90: 65 71 75 61 6c 3f 20 22 79 22 20 28 72 65 61 64 equal? "y" (read
8ea0: 2d 6c 69 6e 65 29 29 29 29 29 0a 09 09 20 20 20 -line)))))...
8eb0: 20 20 20 28 64 62 3a 6c 6f 63 6b 2f 75 6e 6c 6f (db:lock/unlo
8ec0: 63 6b 2d 72 75 6e 20 64 62 20 72 75 6e 2d 69 64 ck-run db run-id
8ed0: 20 6c 6f 63 6b 20 75 6e 6c 6f 63 6b 20 75 73 65 lock unlock use
8ee0: 72 29 0a 09 09 20 20 20 20 20 20 28 64 65 62 75 r)... (debu
8ef0: 67 3a 70 72 69 6e 74 20 30 20 22 49 4e 46 4f 3a g:print 0 "INFO:
8f00: 20 53 6b 69 70 70 69 6e 67 20 6c 6f 63 6b 2f 75 Skipping lock/u
8f10: 6e 6c 6f 63 6b 20 6f 6e 20 22 20 72 75 6e 2d 69 nlock on " run-i
8f20: 64 29 29 29 29 0a 09 20 20 20 20 20 20 72 75 6e d)))).. run
8f30: 73 29 29 29 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d s))).;;=========
8f40: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8f50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8f60: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8f70: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b =============.;;
8f80: 20 52 6f 6c 6c 75 70 20 72 75 6e 73 0a 3b 3b 3d Rollup runs.;;=
8f90: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8fa0: 3d 3d 3d 3d 3d 3d 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 0a 0a 3b 3b 20 55 70 64 61 74 65 =====..;; Update
8fe0: 20 74 68 65 20 74 65 73 74 5f 6d 65 74 61 20 74 the test_meta t
8ff0: 61 62 6c 65 20 66 6f 72 20 74 68 69 73 20 74 65 able for this te
9000: 73 74 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 st.(define (runs
9010: 3a 75 70 64 61 74 65 2d 74 65 73 74 5f 6d 65 74 :update-test_met
9020: 61 20 64 62 20 74 65 73 74 2d 6e 61 6d 65 20 74 a db test-name t
9030: 65 73 74 2d 63 6f 6e 66 29 0a 20 20 28 6c 65 74 est-conf). (let
9040: 20 28 28 63 75 72 72 72 65 63 6f 72 64 20 28 64 ((currrecord (d
9050: 62 3a 74 65 73 74 6d 65 74 61 2d 67 65 74 2d 72 b:testmeta-get-r
9060: 65 63 6f 72 64 20 64 62 20 74 65 73 74 2d 6e 61 ecord db test-na
9070: 6d 65 29 29 29 0a 20 20 20 20 28 69 66 20 28 6e me))). (if (n
9080: 6f 74 20 63 75 72 72 72 65 63 6f 72 64 29 0a 09 ot currrecord)..
9090: 28 62 65 67 69 6e 0a 09 20 20 28 73 65 74 21 20 (begin.. (set!
90a0: 63 75 72 72 72 65 63 6f 72 64 20 28 6d 61 6b 65 currrecord (make
90b0: 2d 76 65 63 74 6f 72 20 31 30 20 23 66 29 29 0a -vector 10 #f)).
90c0: 09 20 20 28 64 62 3a 74 65 73 74 6d 65 74 61 2d . (db:testmeta-
90d0: 61 64 64 2d 72 65 63 6f 72 64 20 64 62 20 74 65 add-record db te
90e0: 73 74 2d 6e 61 6d 65 29 29 29 0a 20 20 20 20 28 st-name))). (
90f0: 66 6f 72 2d 65 61 63 68 20 0a 20 20 20 20 20 28 for-each . (
9100: 6c 61 6d 62 64 61 20 28 6b 65 79 29 0a 20 20 20 lambda (key).
9110: 20 20 20 20 28 6c 65 74 2a 20 28 28 69 64 78 20 (let* ((idx
9120: 28 63 61 64 72 20 6b 65 79 29 29 0a 09 20 20 20 (cadr key))..
9130: 20 20 20 28 66 6c 64 20 28 63 61 72 20 20 6b 65 (fld (car ke
9140: 79 29 29 0a 09 20 20 20 20 20 20 28 76 61 6c 20 y)).. (val
9150: 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 74 (config-lookup t
9160: 65 73 74 2d 63 6f 6e 66 20 22 74 65 73 74 5f 6d est-conf "test_m
9170: 65 74 61 22 20 66 6c 64 29 29 29 0a 09 20 3b 3b eta" fld))).. ;;
9180: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 35 20 (debug:print 5
9190: 22 69 64 78 3a 20 22 20 69 64 78 20 22 20 66 6c "idx: " idx " fl
91a0: 64 3a 20 22 20 66 6c 64 20 22 20 76 61 6c 3a 20 d: " fld " val:
91b0: 22 20 76 61 6c 29 0a 09 20 28 69 66 20 28 61 6e " val).. (if (an
91c0: 64 20 76 61 6c 20 28 6e 6f 74 20 28 65 71 75 61 d val (not (equa
91d0: 6c 3f 20 28 76 65 63 74 6f 72 2d 72 65 66 20 63 l? (vector-ref c
91e0: 75 72 72 72 65 63 6f 72 64 20 69 64 78 29 20 76 urrrecord idx) v
91f0: 61 6c 29 29 29 0a 09 20 20 20 20 20 28 62 65 67 al))).. (beg
9200: 69 6e 0a 09 20 20 20 20 20 20 20 28 70 72 69 6e in.. (prin
9210: 74 20 22 55 70 64 61 74 69 6e 67 20 22 20 74 65 t "Updating " te
9220: 73 74 2d 6e 61 6d 65 20 22 20 22 20 66 6c 64 20 st-name " " fld
9230: 22 20 74 6f 20 22 20 76 61 6c 29 0a 09 20 20 20 " to " val)..
9240: 20 20 20 20 28 64 62 3a 74 65 73 74 6d 65 74 61 (db:testmeta
9250: 2d 75 70 64 61 74 65 2d 66 69 65 6c 64 20 64 62 -update-field db
9260: 20 74 65 73 74 2d 6e 61 6d 65 20 66 6c 64 20 76 test-name fld v
9270: 61 6c 29 29 29 29 29 0a 20 20 20 20 20 27 28 28 al))))). '((
9280: 22 61 75 74 68 6f 72 22 20 32 29 28 22 6f 77 6e "author" 2)("own
9290: 65 72 22 20 33 29 28 22 64 65 73 63 72 69 70 74 er" 3)("descript
92a0: 69 6f 6e 22 20 34 29 28 22 72 65 76 69 65 77 65 ion" 4)("reviewe
92b0: 64 22 20 35 29 28 22 74 61 67 73 22 20 39 29 29 d" 5)("tags" 9))
92c0: 29 29 29 0a 0a 3b 3b 20 55 70 64 61 74 65 20 74 )))..;; Update t
92d0: 65 73 74 5f 6d 65 74 61 20 66 6f 72 20 61 6c 6c est_meta for all
92e0: 20 74 65 73 74 73 0a 28 64 65 66 69 6e 65 20 28 tests.(define (
92f0: 72 75 6e 73 3a 75 70 64 61 74 65 2d 61 6c 6c 2d runs:update-all-
9300: 74 65 73 74 5f 6d 65 74 61 20 64 62 29 0a 20 20 test_meta db).
9310: 28 6c 65 74 20 28 28 74 65 73 74 2d 6e 61 6d 65 (let ((test-name
9320: 73 20 28 67 65 74 2d 61 6c 6c 2d 6c 65 67 61 6c s (get-all-legal
9330: 2d 74 65 73 74 73 29 29 29 0a 20 20 20 20 28 66 -tests))). (f
9340: 6f 72 2d 65 61 63 68 20 0a 20 20 20 20 20 28 6c or-each . (l
9350: 61 6d 62 64 61 20 28 74 65 73 74 2d 6e 61 6d 65 ambda (test-name
9360: 29 0a 20 20 20 20 20 20 20 28 6c 65 74 2a 20 28 ). (let* (
9370: 28 74 65 73 74 2d 70 61 74 68 20 20 20 20 28 63 (test-path (c
9380: 6f 6e 63 20 2a 74 6f 70 70 61 74 68 2a 20 22 2f onc *toppath* "/
9390: 74 65 73 74 73 2f 22 20 74 65 73 74 2d 6e 61 6d tests/" test-nam
93a0: 65 29 29 0a 09 20 20 20 20 20 20 28 74 65 73 74 e)).. (test
93b0: 2d 63 6f 6e 66 69 67 66 20 28 63 6f 6e 63 20 74 -configf (conc t
93c0: 65 73 74 2d 70 61 74 68 20 22 2f 74 65 73 74 63 est-path "/testc
93d0: 6f 6e 66 69 67 22 29 29 0a 09 20 20 20 20 20 20 onfig"))..
93e0: 28 74 65 73 74 65 78 69 73 74 73 20 20 20 28 61 (testexists (a
93f0: 6e 64 20 28 66 69 6c 65 2d 65 78 69 73 74 73 3f nd (file-exists?
9400: 20 74 65 73 74 2d 63 6f 6e 66 69 67 66 29 28 66 test-configf)(f
9410: 69 6c 65 2d 72 65 61 64 2d 61 63 63 65 73 73 3f ile-read-access?
9420: 20 74 65 73 74 2d 63 6f 6e 66 69 67 66 29 29 29 test-configf)))
9430: 0a 09 20 20 20 20 20 20 3b 3b 20 72 65 61 64 20 .. ;; read
9440: 63 6f 6e 66 69 67 73 20 77 69 74 68 20 74 72 69 configs with tri
9450: 63 6b 73 20 74 75 72 6e 65 64 20 6f 66 66 20 28 cks turned off (
9460: 69 2e 65 2e 20 6e 6f 20 73 79 73 74 65 6d 29 0a i.e. no system).
9470: 09 20 20 20 20 20 20 28 74 65 73 74 2d 63 6f 6e . (test-con
9480: 66 20 20 20 20 28 69 66 20 74 65 73 74 65 78 69 f (if testexi
9490: 73 74 73 20 28 72 65 61 64 2d 63 6f 6e 66 69 67 sts (read-config
94a0: 20 74 65 73 74 2d 63 6f 6e 66 69 67 66 20 23 66 test-configf #f
94b0: 20 23 66 29 28 6d 61 6b 65 2d 68 61 73 68 2d 74 #f)(make-hash-t
94c0: 61 62 6c 65 29 29 29 29 0a 09 20 28 72 75 6e 73 able)))).. (runs
94d0: 3a 75 70 64 61 74 65 2d 74 65 73 74 5f 6d 65 74 :update-test_met
94e0: 61 20 64 62 20 74 65 73 74 2d 6e 61 6d 65 20 74 a db test-name t
94f0: 65 73 74 2d 63 6f 6e 66 29 29 29 0a 20 20 20 20 est-conf))).
9500: 20 74 65 73 74 2d 6e 61 6d 65 73 29 29 29 0a 0a test-names)))..
9510: 3b 3b 20 54 68 69 73 20 63 6f 75 6c 64 20 70 72 ;; This could pr
9520: 6f 62 61 62 6c 79 20 62 65 20 72 65 66 61 63 74 obably be refact
9530: 6f 72 65 64 20 69 6e 74 6f 20 6f 6e 65 20 63 6f ored into one co
9540: 6d 70 6c 65 78 20 71 75 65 72 79 20 2e 2e 2e 0a mplex query ....
9550: 28 64 65 66 69 6e 65 20 28 72 75 6e 73 3a 72 6f (define (runs:ro
9560: 6c 6c 75 70 2d 72 75 6e 20 64 62 20 6b 65 79 73 llup-run db keys
9570: 20 6b 65 79 76 61 6c 6c 73 74 20 72 75 6e 6e 61 keyvallst runna
9580: 6d 65 20 75 73 65 72 29 20 3b 3b 20 77 61 73 20 me user) ;; was
9590: 74 61 72 67 65 74 2c 20 6e 6f 77 20 6b 65 79 76 target, now keyv
95a0: 61 6c 6c 73 74 0a 20 20 28 64 65 62 75 67 3a 70 allst. (debug:p
95b0: 72 69 6e 74 20 34 20 22 72 75 6e 73 3a 72 6f 6c rint 4 "runs:rol
95c0: 6c 75 70 2d 72 75 6e 2c 20 6b 65 79 73 3a 20 22 lup-run, keys: "
95d0: 20 6b 65 79 73 20 22 20 6b 65 79 76 61 6c 6c 73 keys " keyvalls
95e0: 74 3a 20 22 20 6b 65 79 76 61 6c 6c 73 74 20 22 t: " keyvallst "
95f0: 20 3a 72 75 6e 6e 61 6d 65 20 22 20 72 75 6e 6e :runname " runn
9600: 61 6d 65 20 22 20 75 73 65 72 3a 20 22 20 75 73 ame " user: " us
9610: 65 72 29 0a 20 20 28 6c 65 74 2a 20 28 3b 20 28 er). (let* (; (
9620: 6b 65 79 76 61 6c 6c 6c 73 74 20 20 20 20 20 20 keyvalllst
9630: 28 6b 65 79 73 3a 74 61 72 67 65 74 2d 3e 6b 65 (keys:target->ke
9640: 79 76 61 6c 20 6b 65 79 73 20 74 61 72 67 65 74 yval keys target
9650: 29 29 0a 09 20 28 6e 65 77 2d 72 75 6e 2d 69 64 )).. (new-run-id
9660: 20 20 20 20 20 20 28 72 75 6e 73 3a 72 65 67 69 (runs:regi
9670: 73 74 65 72 2d 72 75 6e 20 64 62 20 6b 65 79 73 ster-run db keys
9680: 20 6b 65 79 76 61 6c 6c 73 74 20 72 75 6e 6e 61 keyvallst runna
9690: 6d 65 20 22 6e 65 77 22 20 22 6e 2f 61 22 20 75 me "new" "n/a" u
96a0: 73 65 72 29 29 0a 09 20 28 70 72 65 76 2d 74 65 ser)).. (prev-te
96b0: 73 74 73 20 20 20 20 20 20 28 74 65 73 74 3a 67 sts (test:g
96c0: 65 74 2d 6d 61 74 63 68 69 6e 67 2d 70 72 65 76 et-matching-prev
96d0: 69 6f 75 73 2d 74 65 73 74 2d 72 75 6e 2d 72 65 ious-test-run-re
96e0: 63 6f 72 64 73 20 64 62 20 6e 65 77 2d 72 75 6e cords db new-run
96f0: 2d 69 64 20 22 25 22 20 22 25 22 29 29 0a 09 20 -id "%" "%"))..
9700: 28 63 75 72 72 2d 74 65 73 74 73 20 20 20 20 20 (curr-tests
9710: 20 28 72 64 62 3a 67 65 74 2d 74 65 73 74 73 2d (rdb:get-tests-
9720: 66 6f 72 2d 72 75 6e 20 64 62 20 6e 65 77 2d 72 for-run db new-r
9730: 75 6e 2d 69 64 20 22 25 22 20 22 25 22 20 27 28 un-id "%" "%" '(
9740: 29 20 27 28 29 29 29 0a 09 20 28 63 75 72 72 2d ) '())).. (curr-
9750: 74 65 73 74 73 2d 68 61 73 68 20 28 6d 61 6b 65 tests-hash (make
9760: 2d 68 61 73 68 2d 74 61 62 6c 65 29 29 29 0a 20 -hash-table))).
9770: 20 20 20 28 64 62 3a 75 70 64 61 74 65 2d 72 75 (db:update-ru
9780: 6e 2d 65 76 65 6e 74 5f 74 69 6d 65 20 64 62 20 n-event_time db
9790: 6e 65 77 2d 72 75 6e 2d 69 64 29 0a 20 20 20 20 new-run-id).
97a0: 3b 3b 20 69 6e 64 65 78 20 74 68 65 20 61 6c 72 ;; index the alr
97b0: 65 61 64 79 20 73 61 76 65 64 20 74 65 73 74 73 eady saved tests
97c0: 20 62 79 20 74 65 73 74 6e 61 6d 65 20 61 6e 64 by testname and
97d0: 20 69 74 65 6d 64 61 74 20 69 6e 20 63 75 72 72 itemdat in curr
97e0: 2d 74 65 73 74 73 2d 68 61 73 68 0a 20 20 20 20 -tests-hash.
97f0: 28 66 6f 72 2d 65 61 63 68 0a 20 20 20 20 20 28 (for-each. (
9800: 6c 61 6d 62 64 61 20 28 74 65 73 74 64 61 74 29 lambda (testdat)
9810: 0a 20 20 20 20 20 20 20 28 6c 65 74 2a 20 28 28 . (let* ((
9820: 74 65 73 74 6e 61 6d 65 20 20 28 64 62 3a 74 65 testname (db:te
9830: 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 st-get-testname
9840: 74 65 73 74 64 61 74 29 29 0a 09 20 20 20 20 20 testdat))..
9850: 20 28 69 74 65 6d 2d 70 61 74 68 20 28 64 62 3a (item-path (db:
9860: 74 65 73 74 2d 67 65 74 2d 69 74 65 6d 2d 70 61 test-get-item-pa
9870: 74 68 20 74 65 73 74 64 61 74 29 29 0a 09 20 20 th testdat))..
9880: 20 20 20 20 28 66 75 6c 6c 2d 6e 61 6d 65 20 28 (full-name (
9890: 63 6f 6e 63 20 74 65 73 74 6e 61 6d 65 20 22 2f conc testname "/
98a0: 22 20 69 74 65 6d 2d 70 61 74 68 29 29 29 0a 09 " item-path)))..
98b0: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 (hash-table-set
98c0: 21 20 63 75 72 72 2d 74 65 73 74 73 2d 68 61 73 ! curr-tests-has
98d0: 68 20 66 75 6c 6c 2d 6e 61 6d 65 20 74 65 73 74 h full-name test
98e0: 64 61 74 29 29 29 0a 20 20 20 20 20 63 75 72 72 dat))). curr
98f0: 2d 74 65 73 74 73 29 0a 20 20 20 20 3b 3b 20 4e -tests). ;; N
9900: 4f 50 45 3a 20 4e 6f 6e 2d 6f 70 74 69 6d 61 6c OPE: Non-optimal
9910: 20 61 70 70 72 6f 61 63 68 2e 20 54 72 79 20 74 approach. Try t
9920: 68 69 73 20 69 6e 73 74 65 61 64 2e 0a 20 20 20 his instead..
9930: 20 3b 3b 20 20 20 31 2e 20 74 65 73 74 73 20 61 ;; 1. tests a
9940: 72 65 20 72 65 63 65 69 76 65 64 20 69 6e 20 61 re received in a
9950: 20 6c 69 73 74 2c 20 6d 6f 73 74 20 72 65 63 65 list, most rece
9960: 6e 74 20 66 69 72 73 74 0a 20 20 20 20 3b 3b 20 nt first. ;;
9970: 20 20 32 2e 20 72 65 70 6c 61 63 65 20 74 68 65 2. replace the
9980: 20 72 6f 6c 6c 75 70 20 74 65 73 74 20 77 69 74 rollup test wit
9990: 68 20 74 68 65 20 6e 65 77 20 2a 61 6c 77 61 79 h the new *alway
99a0: 73 2a 0a 20 20 20 20 28 66 6f 72 2d 65 61 63 68 s*. (for-each
99b0: 20 0a 20 20 20 20 20 28 6c 61 6d 62 64 61 20 28 . (lambda (
99c0: 74 65 73 74 64 61 74 29 0a 20 20 20 20 20 20 20 testdat).
99d0: 28 6c 65 74 2a 20 28 28 74 65 73 74 6e 61 6d 65 (let* ((testname
99e0: 20 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 74 (db:test-get-t
99f0: 65 73 74 6e 61 6d 65 20 74 65 73 74 64 61 74 29 estname testdat)
9a00: 29 0a 09 20 20 20 20 20 20 28 69 74 65 6d 2d 70 ).. (item-p
9a10: 61 74 68 20 28 64 62 3a 74 65 73 74 2d 67 65 74 ath (db:test-get
9a20: 2d 69 74 65 6d 2d 70 61 74 68 20 74 65 73 74 64 -item-path testd
9a30: 61 74 29 29 0a 09 20 20 20 20 20 20 28 66 75 6c at)).. (ful
9a40: 6c 2d 6e 61 6d 65 20 28 63 6f 6e 63 20 74 65 73 l-name (conc tes
9a50: 74 6e 61 6d 65 20 22 2f 22 20 69 74 65 6d 2d 70 tname "/" item-p
9a60: 61 74 68 29 29 0a 09 20 20 20 20 20 20 28 70 72 ath)).. (pr
9a70: 65 76 2d 74 65 73 74 2d 64 61 74 20 28 68 61 73 ev-test-dat (has
9a80: 68 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 h-table-ref/defa
9a90: 75 6c 74 20 63 75 72 72 2d 74 65 73 74 73 2d 68 ult curr-tests-h
9aa0: 61 73 68 20 66 75 6c 6c 2d 6e 61 6d 65 20 23 66 ash full-name #f
9ab0: 29 29 0a 09 20 20 20 20 20 20 28 74 65 73 74 2d )).. (test-
9ac0: 73 74 65 70 73 20 20 20 20 20 20 28 64 62 3a 67 steps (db:g
9ad0: 65 74 2d 73 74 65 70 73 2d 66 6f 72 2d 74 65 73 et-steps-for-tes
9ae0: 74 20 64 62 20 28 64 62 3a 74 65 73 74 2d 67 65 t db (db:test-ge
9af0: 74 2d 69 64 20 74 65 73 74 64 61 74 29 29 29 0a t-id testdat))).
9b00: 09 20 20 20 20 20 20 28 6e 65 77 2d 74 65 73 74 . (new-test
9b10: 2d 72 65 63 6f 72 64 20 23 66 29 29 0a 09 20 3b -record #f)).. ;
9b20: 3b 20 72 65 70 6c 61 63 65 20 74 68 65 73 65 20 ; replace these
9b30: 77 69 74 68 20 69 6e 73 65 72 74 20 2e 2e 2e 20 with insert ...
9b40: 73 65 6c 65 63 74 0a 09 20 28 61 70 70 6c 79 20 select.. (apply
9b50: 73 71 6c 69 74 65 33 3a 65 78 65 63 75 74 65 20 sqlite3:execute
9b60: 0a 09 09 64 62 20 0a 09 09 28 63 6f 6e 63 20 22 ...db ...(conc "
9b70: 49 4e 53 45 52 54 20 4f 52 20 52 45 50 4c 41 43 INSERT OR REPLAC
9b80: 45 20 49 4e 54 4f 20 74 65 73 74 73 20 28 72 75 E INTO tests (ru
9b90: 6e 5f 69 64 2c 74 65 73 74 6e 61 6d 65 2c 73 74 n_id,testname,st
9ba0: 61 74 65 2c 73 74 61 74 75 73 2c 65 76 65 6e 74 ate,status,event
9bb0: 5f 74 69 6d 65 2c 68 6f 73 74 2c 63 70 75 6c 6f _time,host,cpulo
9bc0: 61 64 2c 64 69 73 6b 66 72 65 65 2c 75 6e 61 6d ad,diskfree,unam
9bd0: 65 2c 72 75 6e 64 69 72 2c 69 74 65 6d 5f 70 61 e,rundir,item_pa
9be0: 74 68 2c 72 75 6e 5f 64 75 72 61 74 69 6f 6e 2c th,run_duration,
9bf0: 66 69 6e 61 6c 5f 6c 6f 67 66 2c 63 6f 6d 6d 65 final_logf,comme
9c00: 6e 74 29 20 22 0a 09 09 20 20 20 20 20 20 22 56 nt) "... "V
9c10: 41 4c 55 45 53 20 28 3f 2c 3f 2c 3f 2c 3f 2c 3f ALUES (?,?,?,?,?
9c20: 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f ,?,?,?,?,?,?,?,?
9c30: 2c 3f 29 3b 22 29 0a 09 09 6e 65 77 2d 72 75 6e ,?);")...new-run
9c40: 2d 69 64 20 28 63 64 64 72 20 28 76 65 63 74 6f -id (cddr (vecto
9c50: 72 2d 3e 6c 69 73 74 20 74 65 73 74 64 61 74 29 r->list testdat)
9c60: 29 29 0a 09 20 28 73 65 74 21 20 6e 65 77 2d 74 )).. (set! new-t
9c70: 65 73 74 64 61 74 20 28 63 61 72 20 28 72 64 62 estdat (car (rdb
9c80: 3a 67 65 74 2d 74 65 73 74 73 2d 66 6f 72 2d 72 :get-tests-for-r
9c90: 75 6e 20 64 62 20 6e 65 77 2d 72 75 6e 2d 69 64 un db new-run-id
9ca0: 20 74 65 73 74 6e 61 6d 65 20 69 74 65 6d 2d 70 testname item-p
9cb0: 61 74 68 20 27 28 29 20 27 28 29 29 29 29 0a 09 ath '() '())))..
9cc0: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 (hash-table-set
9cd0: 21 20 63 75 72 72 2d 74 65 73 74 73 2d 68 61 73 ! curr-tests-has
9ce0: 68 20 66 75 6c 6c 2d 6e 61 6d 65 20 6e 65 77 2d h full-name new-
9cf0: 74 65 73 74 64 61 74 29 20 3b 3b 20 74 68 69 73 testdat) ;; this
9d00: 20 63 6f 75 6c 64 20 62 65 20 63 6f 6e 66 75 73 could be confus
9d10: 69 6e 67 2c 20 77 68 69 63 68 20 72 65 63 6f 72 ing, which recor
9d20: 64 20 73 68 6f 75 6c 64 20 67 6f 20 69 6e 74 6f d should go into
9d30: 20 74 68 65 20 6c 6f 6f 6b 75 70 20 74 61 62 6c the lookup tabl
9d40: 65 3f 0a 09 20 3b 3b 20 4e 6f 77 20 64 75 70 6c e?.. ;; Now dupl
9d50: 69 63 61 74 65 20 74 68 65 20 74 65 73 74 20 73 icate the test s
9d60: 74 65 70 73 0a 09 20 28 64 65 62 75 67 3a 70 72 teps.. (debug:pr
9d70: 69 6e 74 20 34 20 22 43 6f 70 79 69 6e 67 20 72 int 4 "Copying r
9d80: 65 63 6f 72 64 73 20 69 6e 20 74 65 73 74 5f 73 ecords in test_s
9d90: 74 65 70 73 20 66 72 6f 6d 20 74 65 73 74 5f 69 teps from test_i
9da0: 64 3d 22 20 28 64 62 3a 74 65 73 74 2d 67 65 74 d=" (db:test-get
9db0: 2d 69 64 20 74 65 73 74 64 61 74 29 20 22 20 74 -id testdat) " t
9dc0: 6f 20 22 20 28 64 62 3a 74 65 73 74 2d 67 65 74 o " (db:test-get
9dd0: 2d 69 64 20 6e 65 77 2d 74 65 73 74 64 61 74 29 -id new-testdat)
9de0: 29 0a 09 20 28 73 71 6c 69 74 65 33 3a 65 78 65 ).. (sqlite3:exe
9df0: 63 75 74 65 20 0a 09 20 20 64 62 20 0a 09 20 20 cute .. db ..
9e00: 28 63 6f 6e 63 20 22 49 4e 53 45 52 54 20 4f 52 (conc "INSERT OR
9e10: 20 52 45 50 4c 41 43 45 20 49 4e 54 4f 20 74 65 REPLACE INTO te
9e20: 73 74 5f 73 74 65 70 73 20 28 74 65 73 74 5f 69 st_steps (test_i
9e30: 64 2c 73 74 65 70 6e 61 6d 65 2c 73 74 61 74 65 d,stepname,state
9e40: 2c 73 74 61 74 75 73 2c 65 76 65 6e 74 5f 74 69 ,status,event_ti
9e50: 6d 65 2c 63 6f 6d 6d 65 6e 74 29 20 22 0a 09 09 me,comment) "...
9e60: 22 53 45 4c 45 43 54 20 22 20 28 64 62 3a 74 65 "SELECT " (db:te
9e70: 73 74 2d 67 65 74 2d 69 64 20 6e 65 77 2d 74 65 st-get-id new-te
9e80: 73 74 64 61 74 29 20 22 2c 73 74 65 70 6e 61 6d stdat) ",stepnam
9e90: 65 2c 73 74 61 74 65 2c 73 74 61 74 75 73 2c 65 e,state,status,e
9ea0: 76 65 6e 74 5f 74 69 6d 65 2c 63 6f 6d 6d 65 6e vent_time,commen
9eb0: 74 20 46 52 4f 4d 20 74 65 73 74 5f 73 74 65 70 t FROM test_step
9ec0: 73 20 57 48 45 52 45 20 74 65 73 74 5f 69 64 3d s WHERE test_id=
9ed0: 3f 3b 22 29 0a 09 20 20 28 64 62 3a 74 65 73 74 ?;").. (db:test
9ee0: 2d 67 65 74 2d 69 64 20 74 65 73 74 64 61 74 29 -get-id testdat)
9ef0: 29 0a 09 20 3b 3b 20 4e 6f 77 20 64 75 70 6c 69 ).. ;; Now dupli
9f00: 63 61 74 65 20 74 68 65 20 74 65 73 74 20 64 61 cate the test da
9f10: 74 61 0a 09 20 28 64 65 62 75 67 3a 70 72 69 6e ta.. (debug:prin
9f20: 74 20 34 20 22 43 6f 70 79 69 6e 67 20 72 65 63 t 4 "Copying rec
9f30: 6f 72 64 73 20 69 6e 20 74 65 73 74 5f 64 61 74 ords in test_dat
9f40: 61 20 66 72 6f 6d 20 74 65 73 74 5f 69 64 3d 22 a from test_id="
9f50: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 (db:test-get-id
9f60: 20 74 65 73 74 64 61 74 29 20 22 20 74 6f 20 22 testdat) " to "
9f70: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 (db:test-get-id
9f80: 20 6e 65 77 2d 74 65 73 74 64 61 74 29 29 0a 09 new-testdat))..
9f90: 20 28 73 71 6c 69 74 65 33 3a 65 78 65 63 75 74 (sqlite3:execut
9fa0: 65 20 0a 09 20 20 64 62 20 0a 09 20 20 28 63 6f e .. db .. (co
9fb0: 6e 63 20 22 49 4e 53 45 52 54 20 4f 52 20 52 45 nc "INSERT OR RE
9fc0: 50 4c 41 43 45 20 49 4e 54 4f 20 74 65 73 74 5f PLACE INTO test_
9fd0: 64 61 74 61 20 28 74 65 73 74 5f 69 64 2c 63 61 data (test_id,ca
9fe0: 74 65 67 6f 72 79 2c 76 61 72 69 61 62 6c 65 2c tegory,variable,
9ff0: 76 61 6c 75 65 2c 65 78 70 65 63 74 65 64 2c 74 value,expected,t
a000: 6f 6c 2c 75 6e 69 74 73 2c 63 6f 6d 6d 65 6e 74 ol,units,comment
a010: 29 20 22 0a 09 09 22 53 45 4c 45 43 54 20 22 20 ) "..."SELECT "
a020: 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 (db:test-get-id
a030: 6e 65 77 2d 74 65 73 74 64 61 74 29 20 22 2c 63 new-testdat) ",c
a040: 61 74 65 67 6f 72 79 2c 76 61 72 69 61 62 6c 65 ategory,variable
a050: 2c 76 61 6c 75 65 2c 65 78 70 65 63 74 65 64 2c ,value,expected,
a060: 74 6f 6c 2c 75 6e 69 74 73 2c 63 6f 6d 6d 65 6e tol,units,commen
a070: 74 20 46 52 4f 4d 20 74 65 73 74 5f 64 61 74 61 t FROM test_data
a080: 20 57 48 45 52 45 20 74 65 73 74 5f 69 64 3d 3f WHERE test_id=?
a090: 3b 22 29 0a 09 20 20 28 64 62 3a 74 65 73 74 2d ;").. (db:test-
a0a0: 67 65 74 2d 69 64 20 74 65 73 74 64 61 74 29 29 get-id testdat))
a0b0: 0a 09 20 29 29 0a 20 20 20 20 20 70 72 65 76 2d .. )). prev-
a0c0: 74 65 73 74 73 29 29 29 0a 09 20 0a 20 20 20 20 tests))).. .
a0d0: 20 0a .