0000: 0a 3b 3b 20 43 6f 70 79 72 69 67 68 74 20 32 30 .;; Copyright 20
0010: 30 36 2d 32 30 31 32 2c 20 4d 61 74 74 68 65 77 06-2012, Matthew
0020: 20 57 65 6c 6c 61 6e 64 2e 0a 3b 3b 20 0a 3b 3b Welland..;; .;;
0030: 20 20 54 68 69 73 20 70 72 6f 67 72 61 6d 20 69 This program i
0040: 73 20 6d 61 64 65 20 61 76 61 69 6c 61 62 6c 65 s made available
0050: 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 20 47 under the GNU G
0060: 50 4c 20 76 65 72 73 69 6f 6e 20 32 2e 30 20 6f PL version 2.0 o
0070: 72 0a 3b 3b 20 20 67 72 65 61 74 65 72 2e 20 53 r.;; greater. S
0080: 65 65 20 74 68 65 20 61 63 63 6f 6d 70 61 6e 79 ee the accompany
0090: 69 6e 67 20 66 69 6c 65 20 43 4f 50 59 49 4e 47 ing file COPYING
00a0: 20 66 6f 72 20 64 65 74 61 69 6c 73 2e 0a 3b 3b for details..;;
00b0: 20 0a 3b 3b 20 20 54 68 69 73 20 70 72 6f 67 72 .;; This progr
00c0: 61 6d 20 69 73 20 64 69 73 74 72 69 62 75 74 65 am is distribute
00d0: 64 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 d WITHOUT ANY WA
00e0: 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 RRANTY; without
00f0: 65 76 65 6e 20 74 68 65 0a 3b 3b 20 20 69 6d 70 even the.;; imp
0100: 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 lied warranty of
0110: 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 MERCHANTABILITY
0120: 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 or FITNESS FOR
0130: 41 20 50 41 52 54 49 43 55 4c 41 52 0a 3b 3b 20 A PARTICULAR.;;
0140: 20 50 55 52 50 4f 53 45 2e 0a 0a 3b 3b 20 20 73 PURPOSE...;; s
0150: 74 72 66 74 69 6d 65 28 27 25 6d 2f 25 64 2f 25 trftime('%m/%d/%
0160: 59 20 25 48 3a 25 4d 3a 25 53 27 2c 27 6e 6f 77 Y %H:%M:%S','now
0170: 27 2c 27 6c 6f 63 61 6c 74 69 6d 65 27 29 0a 0a ','localtime')..
0180: 28 75 73 65 20 73 71 6c 69 74 65 33 20 73 72 66 (use sqlite3 srf
0190: 69 2d 31 20 70 6f 73 69 78 20 72 65 67 65 78 20 i-1 posix regex
01a0: 72 65 67 65 78 2d 63 61 73 65 20 73 72 66 69 2d regex-case srfi-
01b0: 36 39 20 64 6f 74 2d 6c 6f 63 6b 69 6e 67 20 28 69 dot-locking (
01c0: 73 72 66 69 20 31 38 29 20 70 6f 73 69 78 2d 65 srfi 18) posix-e
01d0: 78 74 72 61 73 20 64 69 72 65 63 74 6f 72 79 2d xtras directory-
01e0: 75 74 69 6c 73 29 0a 28 69 6d 70 6f 72 74 20 28 utils).(import (
01f0: 70 72 65 66 69 78 20 73 71 6c 69 74 65 33 20 73 prefix sqlite3 s
0200: 71 6c 69 74 65 33 3a 29 29 0a 0a 28 64 65 63 6c qlite3:))..(decl
0210: 61 72 65 20 28 75 6e 69 74 20 72 75 6e 73 29 29 are (unit runs))
0220: 0a 28 64 65 63 6c 61 72 65 20 28 75 73 65 73 20 .(declare (uses
0230: 64 62 29 29 0a 28 64 65 63 6c 61 72 65 20 28 75 db)).(declare (u
0240: 73 65 73 20 63 6f 6d 6d 6f 6e 29 29 0a 28 64 65 ses common)).(de
0250: 63 6c 61 72 65 20 28 75 73 65 73 20 69 74 65 6d clare (uses item
0260: 73 29 29 0a 28 64 65 63 6c 61 72 65 20 28 75 73 s)).(declare (us
0270: 65 73 20 72 75 6e 63 6f 6e 66 69 67 29 29 0a 28 es runconfig)).(
0280: 64 65 63 6c 61 72 65 20 28 75 73 65 73 20 74 65 declare (uses te
0290: 73 74 73 29 29 0a 28 64 65 63 6c 61 72 65 20 28 sts)).(declare (
02a0: 75 73 65 73 20 73 65 72 76 65 72 29 29 0a 0a 28 uses server))..(
02b0: 69 6e 63 6c 75 64 65 20 22 63 6f 6d 6d 6f 6e 5f include "common_
02c0: 72 65 63 6f 72 64 73 2e 73 63 6d 22 29 0a 28 69 records.scm").(i
02d0: 6e 63 6c 75 64 65 20 22 6b 65 79 5f 72 65 63 6f nclude "key_reco
02e0: 72 64 73 2e 73 63 6d 22 29 0a 28 69 6e 63 6c 75 rds.scm").(inclu
02f0: 64 65 20 22 64 62 5f 72 65 63 6f 72 64 73 2e 73 de "db_records.s
0300: 63 6d 22 29 0a 28 69 6e 63 6c 75 64 65 20 22 72 cm").(include "r
0310: 75 6e 5f 72 65 63 6f 72 64 73 2e 73 63 6d 22 29 un_records.scm")
0320: 0a 28 69 6e 63 6c 75 64 65 20 22 74 65 73 74 5f .(include "test_
0330: 72 65 63 6f 72 64 73 2e 73 63 6d 22 29 0a 0a 3b records.scm")..;
0340: 3b 20 72 75 6e 73 3a 67 65 74 2d 72 75 6e 73 2d ; runs:get-runs-
0350: 62 79 2d 70 61 74 74 0a 3b 3b 20 67 65 74 20 72 by-patt.;; get r
0360: 75 6e 73 20 62 79 20 6c 69 73 74 20 6f 66 20 63 uns by list of c
0370: 72 69 74 65 72 69 61 0a 3b 3b 20 72 65 67 69 73 riteria.;; regis
0380: 74 65 72 20 61 20 74 65 73 74 20 72 75 6e 20 77 ter a test run w
0390: 69 74 68 20 74 68 65 20 64 62 0a 3b 3b 0a 3b 3b ith the db.;;.;;
03a0: 20 55 73 65 3a 20 28 64 62 2d 67 65 74 2d 76 61 Use: (db-get-va
03b0: 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 20 28 64 lue-by-header (d
03c0: 62 3a 67 65 74 2d 68 65 61 64 65 72 20 72 75 6e b:get-header run
03d0: 69 6e 66 6f 29 28 64 62 3a 67 65 74 2d 72 6f 77 info)(db:get-row
03e0: 20 72 75 6e 69 6e 66 6f 29 29 0a 3b 3b 20 20 74 runinfo)).;; t
03f0: 6f 20 65 78 74 72 61 63 74 20 69 6e 66 6f 20 66 o extract info f
0400: 72 6f 6d 20 74 68 65 20 73 74 72 75 63 74 75 72 rom the structur
0410: 65 20 72 65 74 75 72 6e 65 64 0a 3b 3b 0a 28 64 e returned.;;.(d
0420: 65 66 69 6e 65 20 28 72 75 6e 73 3a 67 65 74 2d efine (runs:get-
0430: 72 75 6e 73 2d 62 79 2d 70 61 74 74 20 64 62 20 runs-by-patt db
0440: 6b 65 79 73 20 72 75 6e 6e 61 6d 65 70 61 74 74 keys runnamepatt
0450: 29 20 3b 3b 20 74 65 73 74 2d 6e 61 6d 65 29 0a ) ;; test-name).
0460: 20 20 28 6c 65 74 2a 20 28 28 6b 65 79 76 61 6c (let* ((keyval
0470: 6c 73 74 20 28 6b 65 79 73 2d 3e 76 61 6c 6c 69 lst (keys->valli
0480: 73 74 20 6b 65 79 73 29 29 0a 09 20 28 74 6d 70 st keys)).. (tmp
0490: 20 20 20 20 20 20 28 72 75 6e 73 3a 67 65 74 2d (runs:get-
04a0: 73 74 64 2d 72 75 6e 2d 66 69 65 6c 64 73 20 6b std-run-fields k
04b0: 65 79 73 20 27 28 22 69 64 22 20 22 72 75 6e 6e eys '("id" "runn
04c0: 61 6d 65 22 20 22 73 74 61 74 65 22 20 22 73 74 ame" "state" "st
04d0: 61 74 75 73 22 20 22 6f 77 6e 65 72 22 20 22 65 atus" "owner" "e
04e0: 76 65 6e 74 5f 74 69 6d 65 22 29 29 29 0a 09 20 vent_time")))..
04f0: 28 6b 65 79 73 74 72 20 20 20 28 63 61 72 20 74 (keystr (car t
0500: 6d 70 29 29 0a 09 20 28 68 65 61 64 65 72 20 20 mp)).. (header
0510: 20 28 63 61 64 72 20 74 6d 70 29 29 0a 09 20 28 (cadr tmp)).. (
0520: 72 65 73 20 20 20 20 20 27 28 29 29 0a 09 20 28 res '()).. (
0530: 6b 65 79 2d 70 61 74 74 20 22 22 29 0a 09 20 28 key-patt "").. (
0540: 72 75 6e 77 69 6c 64 74 79 70 65 20 28 69 66 20 runwildtype (if
0550: 28 73 75 62 73 74 72 69 6e 67 2d 69 6e 64 65 78 (substring-index
0560: 20 22 25 22 20 72 75 6e 6e 61 6d 65 70 61 74 74 "%" runnamepatt
0570: 29 20 22 6c 69 6b 65 22 20 22 67 6c 6f 62 22 29 ) "like" "glob")
0580: 29 0a 09 20 28 71 72 79 2d 73 74 72 20 20 23 66 ).. (qry-str #f
0590: 29 29 0a 20 20 20 20 28 66 6f 72 2d 65 61 63 68 )). (for-each
05a0: 20 28 6c 61 6d 62 64 61 20 28 6b 65 79 76 61 6c (lambda (keyval
05b0: 29 0a 09 09 28 6c 65 74 2a 20 28 28 6b 65 79 20 )...(let* ((key
05c0: 20 20 20 28 76 65 63 74 6f 72 2d 72 65 66 20 6b (vector-ref k
05d0: 65 79 76 61 6c 20 30 29 29 0a 09 09 20 20 20 20 eyval 0))...
05e0: 20 20 20 28 66 75 6c 6b 65 79 20 28 63 6f 6e 63 (fulkey (conc
05f0: 20 22 3a 22 20 6b 65 79 29 29 0a 09 09 20 20 20 ":" key))...
0600: 20 20 20 20 28 70 61 74 74 20 20 20 28 61 72 67 (patt (arg
0610: 73 3a 67 65 74 2d 61 72 67 20 66 75 6c 6b 65 79 s:get-arg fulkey
0620: 29 29 0a 09 09 20 20 20 20 20 20 20 28 77 69 6c ))... (wil
0630: 64 74 79 70 65 20 28 69 66 20 28 73 75 62 73 74 dtype (if (subst
0640: 72 69 6e 67 2d 69 6e 64 65 78 20 22 25 22 20 70 ring-index "%" p
0650: 61 74 74 29 20 22 6c 69 6b 65 22 20 22 67 6c 6f att) "like" "glo
0660: 62 22 29 29 29 0a 09 09 20 20 28 69 66 20 70 61 b")))... (if pa
0670: 74 74 0a 09 09 20 20 20 20 20 20 28 73 65 74 21 tt... (set!
0680: 20 6b 65 79 2d 70 61 74 74 20 28 63 6f 6e 63 20 key-patt (conc
0690: 6b 65 79 2d 70 61 74 74 20 22 20 41 4e 44 20 22 key-patt " AND "
06a0: 20 6b 65 79 20 22 20 22 20 77 69 6c 64 74 79 70 key " " wildtyp
06b0: 65 20 22 20 27 22 20 70 61 74 74 20 22 27 22 29 e " '" patt "'")
06c0: 29 0a 09 09 20 20 20 20 20 20 28 62 65 67 69 6e )... (begin
06d0: 0a 09 09 09 28 64 65 62 75 67 3a 70 72 69 6e 74 ....(debug:print
06e0: 20 30 20 22 45 52 52 4f 52 3a 20 73 65 61 72 63 0 "ERROR: searc
06f0: 68 69 6e 67 20 66 6f 72 20 72 75 6e 73 20 77 69 hing for runs wi
0700: 74 68 20 6e 6f 20 70 61 74 74 65 72 6e 20 73 65 th no pattern se
0710: 74 20 66 6f 72 20 22 20 66 75 6c 6b 65 79 29 0a t for " fulkey).
0720: 09 09 09 28 65 78 69 74 20 36 29 29 29 29 29 0a ...(exit 6))))).
0730: 09 20 20 20 20 20 20 6b 65 79 73 29 0a 20 20 20 . keys).
0740: 20 28 73 65 74 21 20 71 72 79 2d 73 74 72 20 28 (set! qry-str (
0750: 63 6f 6e 63 20 22 53 45 4c 45 43 54 20 22 20 6b conc "SELECT " k
0760: 65 79 73 74 72 20 22 20 46 52 4f 4d 20 72 75 6e eystr " FROM run
0770: 73 20 57 48 45 52 45 20 72 75 6e 6e 61 6d 65 20 s WHERE runname
0780: 22 20 72 75 6e 77 69 6c 64 74 79 70 65 20 22 20 " runwildtype "
0790: 3f 20 22 20 6b 65 79 2d 70 61 74 74 20 22 3b 22 ? " key-patt ";"
07a0: 29 29 0a 20 20 20 20 28 64 65 62 75 67 3a 70 72 )). (debug:pr
07b0: 69 6e 74 20 34 20 22 49 4e 46 4f 3a 20 72 75 6e int 4 "INFO: run
07c0: 73 3a 67 65 74 2d 72 75 6e 73 2d 62 79 2d 70 61 s:get-runs-by-pa
07d0: 74 74 20 71 72 79 3d 22 20 71 72 79 2d 73 74 72 tt qry=" qry-str
07e0: 20 22 20 22 20 72 75 6e 6e 61 6d 65 70 61 74 74 " " runnamepatt
07f0: 29 0a 20 20 20 20 28 73 71 6c 69 74 65 33 3a 66 ). (sqlite3:f
0800: 6f 72 2d 65 61 63 68 2d 72 6f 77 20 0a 20 20 20 or-each-row .
0810: 20 20 28 6c 61 6d 62 64 61 20 28 61 20 2e 20 72 (lambda (a . r
0820: 29 0a 20 20 20 20 20 20 20 28 73 65 74 21 20 72 ). (set! r
0830: 65 73 20 28 63 6f 6e 73 20 28 6c 69 73 74 2d 3e es (cons (list->
0840: 76 65 63 74 6f 72 20 28 63 6f 6e 73 20 61 20 72 vector (cons a r
0850: 29 29 20 72 65 73 29 29 29 0a 20 20 20 20 20 64 )) res))). d
0860: 62 20 0a 20 20 20 20 20 71 72 79 2d 73 74 72 0a b . qry-str.
0870: 20 20 20 20 20 72 75 6e 6e 61 6d 65 70 61 74 74 runnamepatt
0880: 29 0a 20 20 20 20 28 76 65 63 74 6f 72 20 68 65 ). (vector he
0890: 61 64 65 72 20 72 65 73 29 29 29 0a 0a 28 64 65 ader res)))..(de
08a0: 66 69 6e 65 20 28 72 75 6e 73 3a 74 65 73 74 2d fine (runs:test-
08b0: 67 65 74 2d 66 75 6c 6c 2d 70 61 74 68 20 74 65 get-full-path te
08c0: 73 74 29 0a 20 20 28 6c 65 74 2a 20 28 28 74 65 st). (let* ((te
08d0: 73 74 6e 61 6d 65 20 28 64 62 3a 74 65 73 74 2d stname (db:test-
08e0: 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 20 20 74 get-testname t
08f0: 65 73 74 29 29 0a 09 20 28 69 74 65 6d 70 61 74 est)).. (itempat
0900: 68 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 h (db:test-get-i
0910: 74 65 6d 2d 70 61 74 68 20 74 65 73 74 29 29 29 tem-path test)))
0920: 0a 20 20 20 20 28 63 6f 6e 63 20 74 65 73 74 6e . (conc testn
0930: 61 6d 65 20 28 69 66 20 28 65 71 75 61 6c 3f 20 ame (if (equal?
0940: 69 74 65 6d 70 61 74 68 20 22 22 29 20 22 22 20 itempath "") ""
0950: 28 63 6f 6e 63 20 22 28 22 20 69 74 65 6d 70 61 (conc "(" itempa
0960: 74 68 20 22 29 22 29 29 29 29 29 0a 0a 3b 3b 20 th ")")))))..;;
0970: 41 77 66 75 6c 2e 20 50 6c 65 61 73 65 20 46 49 Awful. Please FI
0980: 58 4d 45 0a 28 64 65 66 69 6e 65 20 2a 65 6e 76 XME.(define *env
0990: 2d 76 61 72 73 2d 62 79 2d 72 75 6e 2d 69 64 2a -vars-by-run-id*
09a0: 20 28 6d 61 6b 65 2d 68 61 73 68 2d 74 61 62 6c (make-hash-tabl
09b0: 65 29 29 0a 28 64 65 66 69 6e 65 20 2a 63 75 72 e)).(define *cur
09c0: 72 65 6e 74 2d 72 75 6e 2d 6e 61 6d 65 2a 20 20 rent-run-name*
09d0: 20 23 66 29 0a 0a 28 64 65 66 69 6e 65 20 28 73 #f)..(define (s
09e0: 65 74 2d 6d 65 67 61 74 65 73 74 2d 65 6e 76 2d et-megatest-env-
09f0: 76 61 72 73 20 64 62 20 72 75 6e 2d 69 64 29 0a vars db run-id).
0a00: 20 20 28 6c 65 74 20 28 28 6b 65 79 73 20 28 64 (let ((keys (d
0a10: 62 3a 67 65 74 2d 6b 65 79 73 20 64 62 29 29 0a b:get-keys db)).
0a20: 09 28 76 61 6c 73 20 28 68 61 73 68 2d 74 61 62 .(vals (hash-tab
0a30: 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 2a le-ref/default *
0a40: 65 6e 76 2d 76 61 72 73 2d 62 79 2d 72 75 6e 2d env-vars-by-run-
0a50: 69 64 2a 20 72 75 6e 2d 69 64 20 23 66 29 29 29 id* run-id #f)))
0a60: 0a 20 20 20 20 3b 3b 20 67 65 74 20 74 68 65 20 . ;; get the
0a70: 69 6e 66 6f 20 66 72 6f 6d 20 74 68 65 20 64 62 info from the db
0a80: 20 61 6e 64 20 70 75 74 20 69 74 20 69 6e 20 74 and put it in t
0a90: 68 65 20 63 61 63 68 65 0a 20 20 20 20 28 69 66 he cache. (if
0aa0: 20 28 6e 6f 74 20 76 61 6c 73 29 0a 09 28 6c 65 (not vals)..(le
0ab0: 74 20 28 28 68 74 20 28 6d 61 6b 65 2d 68 61 73 t ((ht (make-has
0ac0: 68 2d 74 61 62 6c 65 29 29 29 0a 09 20 20 28 68 h-table))).. (h
0ad0: 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 2a ash-table-set! *
0ae0: 65 6e 76 2d 76 61 72 73 2d 62 79 2d 72 75 6e 2d env-vars-by-run-
0af0: 69 64 2a 20 72 75 6e 2d 69 64 20 68 74 29 0a 09 id* run-id ht)..
0b00: 20 20 28 73 65 74 21 20 76 61 6c 73 20 68 74 29 (set! vals ht)
0b10: 0a 09 20 20 28 66 6f 72 2d 65 61 63 68 0a 09 20 .. (for-each..
0b20: 20 20 28 6c 61 6d 62 64 61 20 28 6b 65 79 29 0a (lambda (key).
0b30: 09 20 20 20 20 20 28 73 71 6c 69 74 65 33 3a 66 . (sqlite3:f
0b40: 6f 72 2d 65 61 63 68 2d 72 6f 77 0a 09 20 20 20 or-each-row..
0b50: 20 20 20 28 6c 61 6d 62 64 61 20 28 76 61 6c 29 (lambda (val)
0b60: 0a 09 09 28 68 61 73 68 2d 74 61 62 6c 65 2d 73 ...(hash-table-s
0b70: 65 74 21 20 76 61 6c 73 20 6b 65 79 20 76 61 6c et! vals key val
0b80: 29 29 0a 09 20 20 20 20 20 20 64 62 20 0a 09 20 )).. db ..
0b90: 20 20 20 20 20 28 63 6f 6e 63 20 22 53 45 4c 45 (conc "SELE
0ba0: 43 54 20 22 20 28 6b 65 79 3a 67 65 74 2d 66 69 CT " (key:get-fi
0bb0: 65 6c 64 6e 61 6d 65 20 6b 65 79 29 20 22 20 46 eldname key) " F
0bc0: 52 4f 4d 20 72 75 6e 73 20 57 48 45 52 45 20 69 ROM runs WHERE i
0bd0: 64 3d 3f 3b 22 29 0a 09 20 20 20 20 20 20 72 75 d=?;").. ru
0be0: 6e 2d 69 64 29 29 0a 09 20 20 20 6b 65 79 73 29 n-id)).. keys)
0bf0: 29 29 0a 20 20 20 20 3b 3b 20 66 72 6f 6d 20 74 )). ;; from t
0c00: 68 65 20 63 61 63 68 65 64 20 64 61 74 61 20 73 he cached data s
0c10: 65 74 20 74 68 65 20 76 61 72 73 0a 20 20 20 20 et the vars.
0c20: 28 68 61 73 68 2d 74 61 62 6c 65 2d 66 6f 72 2d (hash-table-for-
0c30: 65 61 63 68 0a 20 20 20 20 20 76 61 6c 73 0a 20 each. vals.
0c40: 20 20 20 20 28 6c 61 6d 62 64 61 20 28 6b 65 79 (lambda (key
0c50: 20 76 61 6c 29 0a 20 20 20 20 20 20 20 28 64 65 val). (de
0c60: 62 75 67 3a 70 72 69 6e 74 20 32 20 22 73 65 74 bug:print 2 "set
0c70: 65 6e 76 20 22 20 28 6b 65 79 3a 67 65 74 2d 66 env " (key:get-f
0c80: 69 65 6c 64 6e 61 6d 65 20 6b 65 79 29 20 22 20 ieldname key) "
0c90: 22 20 76 61 6c 29 0a 20 20 20 20 20 20 20 28 73 " val). (s
0ca0: 65 74 65 6e 76 20 28 6b 65 79 3a 67 65 74 2d 66 etenv (key:get-f
0cb0: 69 65 6c 64 6e 61 6d 65 20 6b 65 79 29 20 76 61 ieldname key) va
0cc0: 6c 29 29 29 0a 20 20 20 20 28 61 6c 69 73 74 2d l))). (alist-
0cd0: 3e 65 6e 76 2d 76 61 72 73 20 28 68 61 73 68 2d >env-vars (hash-
0ce0: 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c table-ref/defaul
0cf0: 74 20 2a 63 6f 6e 66 69 67 64 61 74 2a 20 22 65 t *configdat* "e
0d00: 6e 76 2d 6f 76 65 72 72 69 64 65 22 20 27 28 29 nv-override" '()
0d10: 29 29 0a 20 20 20 20 3b 3b 20 4c 65 74 73 20 75 )). ;; Lets u
0d20: 73 65 20 74 68 69 73 20 61 73 20 61 6e 20 6f 70 se this as an op
0d30: 70 6f 72 74 75 6e 69 74 79 20 74 6f 20 70 75 74 portunity to put
0d40: 20 4d 54 5f 52 55 4e 4e 41 4d 45 20 69 6e 20 74 MT_RUNNAME in t
0d50: 68 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a 20 he environment.
0d60: 20 20 20 28 69 66 20 28 6e 6f 74 20 2a 63 75 72 (if (not *cur
0d70: 72 65 6e 74 2d 72 75 6e 2d 6e 61 6d 65 2a 29 0a rent-run-name*).
0d80: 09 28 73 71 6c 69 74 65 33 3a 66 6f 72 2d 65 61 .(sqlite3:for-ea
0d90: 63 68 2d 72 6f 77 0a 09 20 28 6c 61 6d 62 64 61 ch-row.. (lambda
0da0: 20 28 72 75 6e 6e 61 6d 65 29 0a 09 20 20 20 28 (runname).. (
0db0: 73 65 74 21 20 2a 63 75 72 72 65 6e 74 2d 72 75 set! *current-ru
0dc0: 6e 2d 6e 61 6d 65 2a 20 72 75 6e 6e 61 6d 65 29 n-name* runname)
0dd0: 29 0a 0a 09 20 64 62 0a 09 20 22 53 45 4c 45 43 )... db.. "SELEC
0de0: 54 20 72 75 6e 6e 61 6d 65 20 46 52 4f 4d 20 72 T runname FROM r
0df0: 75 6e 73 20 57 48 45 52 45 20 69 64 3d 3f 3b 22 uns WHERE id=?;"
0e00: 0a 09 20 72 75 6e 2d 69 64 29 29 0a 20 20 20 20 .. run-id)).
0e10: 28 73 65 74 65 6e 76 20 22 4d 54 5f 52 55 4e 4e (setenv "MT_RUNN
0e20: 41 4d 45 22 20 2a 63 75 72 72 65 6e 74 2d 72 75 AME" *current-ru
0e30: 6e 2d 6e 61 6d 65 2a 29 0a 20 20 20 20 28 73 65 n-name*). (se
0e40: 74 65 6e 76 20 22 4d 54 5f 52 55 4e 5f 41 52 45 tenv "MT_RUN_ARE
0e50: 41 5f 48 4f 4d 45 22 20 2a 74 6f 70 70 61 74 68 A_HOME" *toppath
0e60: 2a 29 0a 20 20 20 20 29 29 0a 0a 28 64 65 66 69 *). ))..(defi
0e70: 6e 65 20 28 73 65 74 2d 69 74 65 6d 2d 65 6e 76 ne (set-item-env
0e80: 2d 76 61 72 73 20 69 74 65 6d 64 61 74 29 0a 20 -vars itemdat).
0e90: 20 28 66 6f 72 2d 65 61 63 68 20 28 6c 61 6d 62 (for-each (lamb
0ea0: 64 61 20 28 69 74 65 6d 29 0a 09 20 20 20 20 20 da (item)..
0eb0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 32 20 (debug:print 2
0ec0: 22 73 65 74 65 6e 76 20 22 20 28 63 61 72 20 69 "setenv " (car i
0ed0: 74 65 6d 29 20 22 20 22 20 28 63 61 64 72 20 69 tem) " " (cadr i
0ee0: 74 65 6d 29 29 0a 09 20 20 20 20 20 20 28 73 65 tem)).. (se
0ef0: 74 65 6e 76 20 28 63 61 72 20 69 74 65 6d 29 20 tenv (car item)
0f00: 28 63 61 64 72 20 69 74 65 6d 29 29 29 0a 09 20 (cadr item)))..
0f10: 20 20 20 69 74 65 6d 64 61 74 29 29 0a 0a 28 64 itemdat))..(d
0f20: 65 66 69 6e 65 20 2a 6c 61 73 74 2d 6e 75 6d 2d efine *last-num-
0f30: 72 75 6e 6e 69 6e 67 2d 74 65 73 74 73 2a 20 30 running-tests* 0
0f40: 29 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 3a ).(define (runs:
0f50: 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 73 can-run-more-tes
0f60: 74 73 20 64 62 20 74 65 73 74 2d 72 65 63 6f 72 ts db test-recor
0f70: 64 29 0a 20 20 28 6c 65 74 2a 20 28 28 74 63 6f d). (let* ((tco
0f80: 6e 66 69 67 20 20 20 20 20 20 20 20 20 20 20 20 nfig
0f90: 20 20 20 20 20 28 74 65 73 74 73 3a 74 65 73 74 (tests:test
0fa0: 71 75 65 75 65 2d 67 65 74 2d 74 65 73 74 63 6f queue-get-testco
0fb0: 6e 66 69 67 20 74 65 73 74 2d 72 65 63 6f 72 64 nfig test-record
0fc0: 29 29 0a 09 20 28 6a 6f 62 67 72 6f 75 70 20 20 )).. (jobgroup
0fd0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 63 (c
0fe0: 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 74 63 6f onfig-lookup tco
0ff0: 6e 66 69 67 20 22 72 65 71 75 69 72 65 6d 65 6e nfig "requiremen
1000: 74 73 22 20 22 6a 6f 62 67 72 6f 75 70 22 29 29 ts" "jobgroup"))
1010: 0a 09 20 28 6e 75 6d 2d 72 75 6e 6e 69 6e 67 20 .. (num-running
1020: 20 20 20 20 20 20 20 20 20 20 20 20 28 64 62 3a (db:
1030: 67 65 74 2d 63 6f 75 6e 74 2d 74 65 73 74 73 2d get-count-tests-
1040: 72 75 6e 6e 69 6e 67 20 64 62 29 29 0a 09 20 28 running db)).. (
1050: 6e 75 6d 2d 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a num-running-in-j
1060: 6f 62 67 72 6f 75 70 20 28 64 62 3a 67 65 74 2d obgroup (db:get-
1070: 63 6f 75 6e 74 2d 74 65 73 74 73 2d 72 75 6e 6e count-tests-runn
1080: 69 6e 67 2d 69 6e 2d 6a 6f 62 67 72 6f 75 70 20 ing-in-jobgroup
1090: 64 62 20 6a 6f 62 67 72 6f 75 70 29 29 0a 09 20 db jobgroup))..
10a0: 28 6d 61 78 2d 63 6f 6e 63 75 72 72 65 6e 74 2d (max-concurrent-
10b0: 6a 6f 62 73 20 20 20 20 20 28 6c 65 74 20 28 28 jobs (let ((
10c0: 6d 63 6a 20 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b mcj (config-look
10d0: 75 70 20 2a 63 6f 6e 66 69 67 64 61 74 2a 20 22 up *configdat* "
10e0: 73 65 74 75 70 22 20 20 20 20 20 22 6d 61 78 5f setup" "max_
10f0: 63 6f 6e 63 75 72 72 65 6e 74 5f 6a 6f 62 73 22 concurrent_jobs"
1100: 29 29 29 0a 09 09 09 09 20 20 20 20 28 69 66 20 )))..... (if
1110: 28 61 6e 64 20 6d 63 6a 20 28 73 74 72 69 6e 67 (and mcj (string
1120: 2d 3e 6e 75 6d 62 65 72 20 6d 63 6a 29 29 0a 09 ->number mcj))..
1130: 09 09 09 09 28 73 74 72 69 6e 67 2d 3e 6e 75 6d ....(string->num
1140: 62 65 72 20 6d 63 6a 29 0a 09 09 09 09 09 23 66 ber mcj)......#f
1150: 29 29 29 0a 09 20 28 6a 6f 62 2d 67 72 6f 75 70 ))).. (job-group
1160: 2d 6c 69 6d 69 74 20 20 20 20 20 20 20 20 20 28 -limit (
1170: 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 2a 63 config-lookup *c
1180: 6f 6e 66 69 67 64 61 74 2a 20 22 6a 6f 62 67 72 onfigdat* "jobgr
1190: 6f 75 70 73 22 20 6a 6f 62 67 72 6f 75 70 29 29 oups" jobgroup))
11a0: 29 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 ). (if (not (
11b0: 65 71 3f 20 2a 6c 61 73 74 2d 6e 75 6d 2d 72 75 eq? *last-num-ru
11c0: 6e 6e 69 6e 67 2d 74 65 73 74 73 2a 20 6e 75 6d nning-tests* num
11d0: 2d 72 75 6e 6e 69 6e 67 29 29 0a 09 28 62 65 67 -running))..(beg
11e0: 69 6e 0a 09 20 20 28 64 65 62 75 67 3a 70 72 69 in.. (debug:pri
11f0: 6e 74 20 32 20 22 6d 61 78 2d 63 6f 6e 63 75 72 nt 2 "max-concur
1200: 72 65 6e 74 2d 6a 6f 62 73 3a 20 22 20 6d 61 78 rent-jobs: " max
1210: 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 -concurrent-jobs
1220: 20 22 2c 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 3a ", num-running:
1230: 20 22 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 29 0a " num-running).
1240: 09 20 20 28 73 65 74 21 20 2a 6c 61 73 74 2d 6e . (set! *last-n
1250: 75 6d 2d 72 75 6e 6e 69 6e 67 2d 74 65 73 74 73 um-running-tests
1260: 2a 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 29 29 29 * num-running)))
1270: 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 65 . (if (not (e
1280: 71 3f 20 30 20 2a 67 6c 6f 62 61 6c 65 78 69 74 q? 0 *globalexit
1290: 73 74 61 74 75 73 2a 29 29 0a 09 28 6c 69 73 74 status*))..(list
12a0: 20 23 66 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 20 #f num-running
12b0: 6e 75 6d 2d 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a num-running-in-j
12c0: 6f 62 67 72 6f 75 70 20 6d 61 78 2d 63 6f 6e 63 obgroup max-conc
12d0: 75 72 72 65 6e 74 2d 6a 6f 62 73 20 6a 6f 62 2d urrent-jobs job-
12e0: 67 72 6f 75 70 2d 6c 69 6d 69 74 29 0a 09 28 6c group-limit)..(l
12f0: 65 74 20 28 28 63 61 6e 2d 6e 6f 74 2d 72 75 6e et ((can-not-run
1300: 2d 6d 6f 72 65 20 28 63 6f 6e 64 0a 09 09 09 09 -more (cond.....
1310: 20 3b 3b 20 69 66 20 6d 61 78 2d 63 6f 6e 63 75 ;; if max-concu
1320: 72 72 65 6e 74 2d 6a 6f 62 73 20 69 73 20 73 65 rrent-jobs is se
1330: 74 20 61 6e 64 20 74 68 65 20 6e 75 6d 62 65 72 t and the number
1340: 20 72 75 6e 6e 69 6e 67 20 69 73 20 67 72 65 61 running is grea
1350: 74 65 72 20 0a 09 09 09 09 20 3b 3b 20 74 68 61 ter ..... ;; tha
1360: 6e 20 69 74 20 74 68 61 6e 20 63 61 6e 6e 6f 74 n it than cannot
1370: 20 72 75 6e 20 6d 6f 72 65 20 6a 6f 62 73 0a 09 run more jobs..
1380: 09 09 09 20 28 28 61 6e 64 20 6d 61 78 2d 63 6f ... ((and max-co
1390: 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 20 28 3e ncurrent-jobs (>
13a0: 3d 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 20 6d 61 = num-running ma
13b0: 78 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 x-concurrent-job
13c0: 73 29 29 0a 09 09 09 09 20 20 28 64 65 62 75 67 s))..... (debug
13d0: 3a 70 72 69 6e 74 20 30 20 22 57 41 52 4e 49 4e :print 0 "WARNIN
13e0: 47 3a 20 4d 61 78 20 72 75 6e 6e 69 6e 67 20 6a G: Max running j
13f0: 6f 62 73 20 65 78 63 65 65 64 65 64 2c 20 63 75 obs exceeded, cu
1400: 72 72 65 6e 74 20 6e 75 6d 62 65 72 20 72 75 6e rrent number run
1410: 6e 69 6e 67 3a 20 22 20 6e 75 6d 2d 72 75 6e 6e ning: " num-runn
1420: 69 6e 67 20 0a 09 09 09 09 09 20 20 20 20 20 20 ing ......
1430: 20 22 2c 20 6d 61 78 5f 63 6f 6e 63 75 72 72 65 ", max_concurre
1440: 6e 74 5f 6a 6f 62 73 3a 20 22 20 6d 61 78 2d 63 nt_jobs: " max-c
1450: 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 29 0a oncurrent-jobs).
1460: 09 09 09 09 20 20 23 74 29 0a 09 09 09 09 20 3b .... #t)..... ;
1470: 3b 20 69 66 20 6a 6f 62 2d 67 72 6f 75 70 2d 6c ; if job-group-l
1480: 69 6d 69 74 20 69 73 20 73 65 74 20 61 6e 64 20 imit is set and
1490: 6e 75 6d 62 65 72 20 6f 66 20 6a 6f 62 73 20 69 number of jobs i
14a0: 6e 20 74 68 65 20 67 72 6f 75 70 20 69 73 20 67 n the group is g
14b0: 72 65 61 74 65 72 0a 09 09 09 09 20 3b 3b 20 74 reater..... ;; t
14c0: 68 61 6e 20 74 68 65 20 6c 69 6d 69 74 20 74 68 han the limit th
14d0: 65 6e 20 63 61 6e 6e 6f 74 20 72 75 6e 20 6d 6f en cannot run mo
14e0: 72 65 20 6a 6f 62 73 20 6f 66 20 74 68 69 73 20 re jobs of this
14f0: 6b 69 6e 64 0a 09 09 09 09 20 28 28 61 6e 64 20 kind..... ((and
1500: 6a 6f 62 2d 67 72 6f 75 70 2d 6c 69 6d 69 74 0a job-group-limit.
1510: 09 09 09 09 20 20 20 20 20 20 20 28 3e 3d 20 6e .... (>= n
1520: 75 6d 2d 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a 6f um-running-in-jo
1530: 62 67 72 6f 75 70 20 6a 6f 62 2d 67 72 6f 75 70 bgroup job-group
1540: 2d 6c 69 6d 69 74 29 29 0a 09 09 09 09 20 20 28 -limit))..... (
1550: 64 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 57 debug:print 1 "W
1560: 41 52 4e 49 4e 47 3a 20 6e 75 6d 62 65 72 20 6f ARNING: number o
1570: 66 20 6a 6f 62 73 20 22 20 6e 75 6d 2d 72 75 6e f jobs " num-run
1580: 6e 69 6e 67 2d 69 6e 2d 6a 6f 62 67 72 6f 75 70 ning-in-jobgroup
1590: 20 0a 09 09 09 09 09 20 20 20 20 20 20 20 22 20 ...... "
15a0: 69 6e 20 22 20 6a 6f 62 67 72 6f 75 70 20 22 20 in " jobgroup "
15b0: 65 78 63 65 65 64 65 64 2c 20 77 69 6c 6c 20 6e exceeded, will n
15c0: 6f 74 20 72 75 6e 20 22 20 28 74 65 73 74 73 3a ot run " (tests:
15d0: 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d 74 65 testqueue-get-te
15e0: 73 74 6e 61 6d 65 20 74 65 73 74 2d 72 65 63 6f stname test-reco
15f0: 72 64 29 29 0a 09 09 09 09 20 20 23 74 29 0a 09 rd))..... #t)..
1600: 09 09 09 20 28 65 6c 73 65 20 23 66 29 29 29 29 ... (else #f))))
1610: 0a 09 20 20 28 6c 69 73 74 20 28 6e 6f 74 20 63 .. (list (not c
1620: 61 6e 2d 6e 6f 74 2d 72 75 6e 2d 6d 6f 72 65 29 an-not-run-more)
1630: 20 6e 75 6d 2d 72 75 6e 6e 69 6e 67 20 6e 75 6d num-running num
1640: 2d 72 75 6e 6e 69 6e 67 2d 69 6e 2d 6a 6f 62 67 -running-in-jobg
1650: 72 6f 75 70 20 6d 61 78 2d 63 6f 6e 63 75 72 72 roup max-concurr
1660: 65 6e 74 2d 6a 6f 62 73 20 6a 6f 62 2d 67 72 6f ent-jobs job-gro
1670: 75 70 2d 6c 69 6d 69 74 29 29 29 29 29 0a 0a 3b up-limit)))))..;
1680: 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ;===============
1690: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
16a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
16b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
16c0: 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 4e 65 77 20 6d =======.;; New m
16d0: 65 74 68 6f 64 6f 6c 6f 67 79 2e 20 54 68 65 73 ethodology. Thes
16e0: 65 20 72 6f 75 74 69 6e 65 73 20 77 69 6c 6c 20 e routines will
16f0: 72 65 70 6c 61 63 65 20 74 68 65 20 61 62 6f 76 replace the abov
1700: 65 20 69 6e 20 74 69 6d 65 2e 20 46 6f 72 0a 3b e in time. For.;
1710: 3b 20 6e 6f 77 20 74 68 65 20 63 6f 64 65 20 69 ; now the code i
1720: 73 20 64 75 70 6c 69 63 61 74 65 64 2e 20 54 68 s duplicated. Th
1730: 69 73 20 73 74 75 66 66 20 69 73 20 69 6e 69 74 is stuff is init
1740: 69 61 6c 6c 79 20 75 73 65 64 20 69 6e 20 74 68 ially used in th
1750: 65 20 6d 6f 6e 69 74 6f 72 0a 3b 3b 20 62 61 73 e monitor.;; bas
1760: 65 64 20 63 6f 64 65 2e 0a 3b 3b 3d 3d 3d 3d 3d ed code..;;=====
1770: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1780: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1790: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
17a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
17b0: 3d 0a 0a 3b 3b 20 72 65 67 69 73 74 65 72 20 61 =..;; register a
17c0: 20 74 65 73 74 20 72 75 6e 20 77 69 74 68 20 74 test run with t
17d0: 68 65 20 64 62 0a 28 64 65 66 69 6e 65 20 28 72 he db.(define (r
17e0: 75 6e 73 3a 72 65 67 69 73 74 65 72 2d 72 75 6e uns:register-run
17f0: 20 64 62 20 6b 65 79 73 20 6b 65 79 76 61 6c 6c db keys keyvall
1800: 73 74 20 72 75 6e 6e 61 6d 65 20 73 74 61 74 65 st runname state
1810: 20 73 74 61 74 75 73 20 75 73 65 72 29 0a 20 20 status user).
1820: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 33 20 22 (debug:print 3 "
1830: 72 75 6e 73 3a 72 65 67 69 73 74 65 72 2d 72 75 runs:register-ru
1840: 6e 2c 20 6b 65 79 73 3a 20 22 20 6b 65 79 73 20 n, keys: " keys
1850: 22 20 6b 65 79 76 61 6c 6c 73 74 3a 20 22 20 6b " keyvallst: " k
1860: 65 79 76 61 6c 6c 73 74 20 22 20 72 75 6e 6e 61 eyvallst " runna
1870: 6d 65 3a 20 22 20 72 75 6e 6e 61 6d 65 20 22 20 me: " runname "
1880: 73 74 61 74 65 3a 20 22 20 73 74 61 74 65 20 22 state: " state "
1890: 20 73 74 61 74 75 73 3a 20 22 20 73 74 61 74 75 status: " statu
18a0: 73 20 22 20 75 73 65 72 3a 20 22 20 75 73 65 72 s " user: " user
18b0: 29 0a 20 20 28 6c 65 74 2a 20 28 28 6b 65 79 73 ). (let* ((keys
18c0: 74 72 20 20 20 20 28 6b 65 79 73 2d 3e 6b 65 79 tr (keys->key
18d0: 73 74 72 20 6b 65 79 73 29 29 0a 09 20 28 63 6f str keys)).. (co
18e0: 6d 6d 61 20 20 20 20 20 28 69 66 20 28 3e 20 28 mma (if (> (
18f0: 6c 65 6e 67 74 68 20 6b 65 79 73 29 20 30 29 20 length keys) 0)
1900: 22 2c 22 20 22 22 29 29 0a 09 20 28 61 6e 64 73 "," "")).. (ands
1910: 74 72 20 20 20 20 28 69 66 20 28 3e 20 28 6c 65 tr (if (> (le
1920: 6e 67 74 68 20 6b 65 79 73 29 20 30 29 20 22 20 ngth keys) 0) "
1930: 41 4e 44 20 22 20 22 22 29 29 0a 09 20 28 76 61 AND " "")).. (va
1940: 6c 73 6c 6f 74 73 20 20 28 6b 65 79 73 2d 3e 76 lslots (keys->v
1950: 61 6c 73 6c 6f 74 73 20 6b 65 79 73 29 29 20 3b alslots keys)) ;
1960: 3b 20 3f 2c 3f 2c 3f 20 2e 2e 2e 0a 09 20 28 6b ; ?,?,? ..... (k
1970: 65 79 76 61 6c 73 20 20 20 28 6d 61 70 20 63 61 eyvals (map ca
1980: 64 72 20 6b 65 79 76 61 6c 6c 73 74 29 29 0a 09 dr keyvallst))..
1990: 20 28 61 6c 6c 76 61 6c 73 20 20 20 28 61 70 70 (allvals (app
19a0: 65 6e 64 20 28 6c 69 73 74 20 72 75 6e 6e 61 6d end (list runnam
19b0: 65 20 73 74 61 74 65 20 73 74 61 74 75 73 20 75 e state status u
19c0: 73 65 72 29 20 6b 65 79 76 61 6c 73 29 29 0a 09 ser) keyvals))..
19d0: 20 28 71 72 79 76 61 6c 73 20 20 20 28 61 70 70 (qryvals (app
19e0: 65 6e 64 20 28 6c 69 73 74 20 72 75 6e 6e 61 6d end (list runnam
19f0: 65 29 20 6b 65 79 76 61 6c 73 29 29 0a 09 20 28 e) keyvals)).. (
1a00: 6b 65 79 3d 3f 73 74 72 20 20 28 73 74 72 69 6e key=?str (strin
1a10: 67 2d 69 6e 74 65 72 73 70 65 72 73 65 20 28 6d g-intersperse (m
1a20: 61 70 20 28 6c 61 6d 62 64 61 20 28 6b 29 28 63 ap (lambda (k)(c
1a30: 6f 6e 63 20 28 6b 65 79 3a 67 65 74 2d 66 69 65 onc (key:get-fie
1a40: 6c 64 6e 61 6d 65 20 6b 29 20 22 3d 3f 22 29 29 ldname k) "=?"))
1a50: 20 6b 65 79 73 29 20 22 20 41 4e 44 20 22 29 29 keys) " AND "))
1a60: 29 0a 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 ). (debug:pri
1a70: 6e 74 20 33 20 22 6b 65 79 73 3a 20 22 20 6b 65 nt 3 "keys: " ke
1a80: 79 73 20 22 20 61 6c 6c 76 61 6c 73 3a 20 22 20 ys " allvals: "
1a90: 61 6c 6c 76 61 6c 73 20 22 20 6b 65 79 76 61 6c allvals " keyval
1aa0: 73 3a 20 22 20 6b 65 79 76 61 6c 73 29 0a 20 20 s: " keyvals).
1ab0: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 32 (debug:print 2
1ac0: 20 22 4e 4f 54 45 3a 20 75 73 69 6e 67 20 74 61 "NOTE: using ta
1ad0: 72 67 65 74 20 22 20 28 73 74 72 69 6e 67 2d 69 rget " (string-i
1ae0: 6e 74 65 72 73 70 65 72 73 65 20 6b 65 79 76 61 ntersperse keyva
1af0: 6c 73 20 22 2f 22 29 20 22 20 66 6f 72 20 74 68 ls "/") " for th
1b00: 69 73 20 72 75 6e 22 29 0a 20 20 20 20 28 69 66 is run"). (if
1b10: 20 28 61 6e 64 20 72 75 6e 6e 61 6d 65 20 28 6e (and runname (n
1b20: 75 6c 6c 3f 20 28 66 69 6c 74 65 72 20 28 6c 61 ull? (filter (la
1b30: 6d 62 64 61 20 28 78 29 28 6e 6f 74 20 78 29 29 mbda (x)(not x))
1b40: 20 6b 65 79 76 61 6c 73 29 29 29 20 3b 3b 20 74 keyvals))) ;; t
1b50: 68 65 72 65 20 6d 75 73 74 20 62 65 20 61 20 62 here must be a b
1b60: 65 74 74 65 72 20 77 61 79 20 74 6f 20 22 61 70 etter way to "ap
1b70: 70 6c 79 20 61 6e 64 22 0a 09 28 6c 65 74 20 28 ply and"..(let (
1b80: 28 72 65 73 20 23 66 29 29 0a 09 20 20 28 61 70 (res #f)).. (ap
1b90: 70 6c 79 20 73 71 6c 69 74 65 33 3a 65 78 65 63 ply sqlite3:exec
1ba0: 75 74 65 20 64 62 20 28 63 6f 6e 63 20 22 49 4e ute db (conc "IN
1bb0: 53 45 52 54 20 4f 52 20 49 47 4e 4f 52 45 20 49 SERT OR IGNORE I
1bc0: 4e 54 4f 20 72 75 6e 73 20 28 72 75 6e 6e 61 6d NTO runs (runnam
1bd0: 65 2c 73 74 61 74 65 2c 73 74 61 74 75 73 2c 6f e,state,status,o
1be0: 77 6e 65 72 2c 65 76 65 6e 74 5f 74 69 6d 65 22 wner,event_time"
1bf0: 20 63 6f 6d 6d 61 20 6b 65 79 73 74 72 20 22 29 comma keystr ")
1c00: 20 56 41 4c 55 45 53 20 28 3f 2c 3f 2c 3f 2c 3f VALUES (?,?,?,?
1c10: 2c 73 74 72 66 74 69 6d 65 28 27 25 73 27 2c 27 ,strftime('%s','
1c20: 6e 6f 77 27 29 22 20 63 6f 6d 6d 61 20 76 61 6c now')" comma val
1c30: 73 6c 6f 74 73 20 22 29 3b 22 29 0a 09 09 20 61 slots ");")... a
1c40: 6c 6c 76 61 6c 73 29 0a 09 20 20 28 61 70 70 6c llvals).. (appl
1c50: 79 20 73 71 6c 69 74 65 33 3a 66 6f 72 2d 65 61 y sqlite3:for-ea
1c60: 63 68 2d 72 6f 77 20 0a 09 20 20 20 28 6c 61 6d ch-row .. (lam
1c70: 62 64 61 20 28 69 64 29 0a 09 20 20 20 20 20 28 bda (id).. (
1c80: 73 65 74 21 20 72 65 73 20 69 64 29 29 0a 09 20 set! res id))..
1c90: 20 20 64 62 0a 09 20 20 20 28 6c 65 74 20 28 28 db.. (let ((
1ca0: 71 72 79 20 28 63 6f 6e 63 20 22 53 45 4c 45 43 qry (conc "SELEC
1cb0: 54 20 69 64 20 46 52 4f 4d 20 72 75 6e 73 20 57 T id FROM runs W
1cc0: 48 45 52 45 20 28 72 75 6e 6e 61 6d 65 3d 3f 20 HERE (runname=?
1cd0: 22 20 61 6e 64 73 74 72 20 6b 65 79 3d 3f 73 74 " andstr key=?st
1ce0: 72 20 22 29 3b 22 29 29 29 0a 09 20 20 20 20 20 r ");")))..
1cf0: 3b 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 ;(debug:print 4
1d00: 22 71 72 79 3a 20 22 20 71 72 79 29 20 0a 09 20 "qry: " qry) ..
1d10: 20 20 20 20 71 72 79 29 0a 09 20 20 20 71 72 79 qry).. qry
1d20: 76 61 6c 73 29 0a 09 20 20 28 73 71 6c 69 74 65 vals).. (sqlite
1d30: 33 3a 65 78 65 63 75 74 65 20 64 62 20 22 55 50 3:execute db "UP
1d40: 44 41 54 45 20 72 75 6e 73 20 53 45 54 20 73 74 DATE runs SET st
1d50: 61 74 65 3d 3f 2c 73 74 61 74 75 73 3d 3f 20 57 ate=?,status=? W
1d60: 48 45 52 45 20 69 64 3d 3f 3b 22 20 73 74 61 74 HERE id=?;" stat
1d70: 65 20 73 74 61 74 75 73 20 72 65 73 29 0a 09 20 e status res)..
1d80: 20 72 65 73 29 20 0a 09 28 62 65 67 69 6e 0a 09 res) ..(begin..
1d90: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 (debug:print 0
1da0: 20 22 45 52 52 4f 52 3a 20 43 61 6c 6c 65 64 20 "ERROR: Called
1db0: 77 69 74 68 6f 75 74 20 61 6c 6c 20 6e 65 63 65 without all nece
1dc0: 73 73 61 72 79 20 6b 65 79 73 22 29 0a 09 20 20 ssary keys")..
1dd0: 23 66 29 29 29 29 0a 0a 3b 3b 20 54 68 69 73 20 #f))))..;; This
1de0: 69 73 20 61 20 64 75 70 6c 69 63 61 74 65 20 6f is a duplicate o
1df0: 66 20 72 75 6e 2d 74 65 73 74 73 20 28 77 68 69 f run-tests (whi
1e00: 63 68 20 68 61 73 20 62 65 65 6e 20 64 65 70 72 ch has been depr
1e10: 65 63 61 74 65 64 29 2e 20 55 73 65 20 74 68 69 ecated). Use thi
1e20: 73 20 6f 6e 65 20 69 6e 73 74 65 61 64 20 6f 66 s one instead of
1e30: 20 72 75 6e 20 74 65 73 74 73 2e 0a 3b 3b 20 6b run tests..;; k
1e40: 65 79 76 61 6c 73 0a 28 64 65 66 69 6e 65 20 28 eyvals.(define (
1e50: 72 75 6e 73 3a 72 75 6e 2d 74 65 73 74 73 20 74 runs:run-tests t
1e60: 61 72 67 65 74 20 72 75 6e 6e 61 6d 65 20 74 65 arget runname te
1e70: 73 74 2d 70 61 74 74 73 20 75 73 65 72 20 66 6c st-patts user fl
1e80: 61 67 73 29 0a 20 20 28 6c 65 74 2a 20 28 28 64 ags). (let* ((d
1e90: 62 20 20 20 20 20 20 20 20 20 20 23 66 29 0a 09 b #f)..
1ea0: 20 28 6b 65 79 73 20 20 20 20 20 20 20 20 28 6f (keys (o
1eb0: 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 pen-run-close db
1ec0: 3a 67 65 74 2d 6b 65 79 73 20 64 62 29 29 0a 09 :get-keys db))..
1ed0: 20 28 6b 65 79 76 61 6c 6c 73 74 20 20 20 28 6b (keyvallst (k
1ee0: 65 79 73 3a 74 61 72 67 65 74 2d 3e 6b 65 79 76 eys:target->keyv
1ef0: 61 6c 20 6b 65 79 73 20 74 61 72 67 65 74 29 29 al keys target))
1f00: 0a 09 20 28 72 75 6e 2d 69 64 20 20 20 20 20 20 .. (run-id
1f10: 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 (open-run-close
1f20: 72 75 6e 73 3a 72 65 67 69 73 74 65 72 2d 72 75 runs:register-ru
1f30: 6e 20 64 62 20 6b 65 79 73 20 6b 65 79 76 61 6c n db keys keyval
1f40: 6c 73 74 20 72 75 6e 6e 61 6d 65 20 22 6e 65 77 lst runname "new
1f50: 22 20 22 6e 2f 61 22 20 75 73 65 72 29 29 20 20 " "n/a" user))
1f60: 3b 3b 20 20 74 65 73 74 2d 6e 61 6d 65 29 29 29 ;; test-name)))
1f70: 0a 09 20 28 64 65 66 65 72 72 65 64 20 20 20 20 .. (deferred
1f80: 27 28 29 29 20 3b 3b 20 64 65 6c 61 79 20 72 75 '()) ;; delay ru
1f90: 6e 6e 69 6e 67 20 74 68 65 73 65 20 73 69 6e 63 nning these sinc
1fa0: 65 20 74 68 65 79 20 68 61 76 65 20 61 20 77 61 e they have a wa
1fb0: 69 74 6f 6e 20 63 6c 61 75 73 65 0a 09 20 3b 3b iton clause.. ;;
1fc0: 20 6b 65 65 70 67 6f 69 6e 67 20 69 73 20 74 68 keepgoing is th
1fd0: 65 20 64 65 66 61 63 74 6f 20 6d 6f 64 61 6c 69 e defacto modali
1fe0: 74 79 20 6e 6f 77 2c 20 77 69 6c 6c 20 61 64 64 ty now, will add
1ff0: 20 68 69 74 2d 6e 2d 72 75 6e 20 61 20 62 69 74 hit-n-run a bit
2000: 20 6c 61 74 65 72 0a 09 20 3b 3b 20 28 6b 65 65 later.. ;; (kee
2010: 70 67 6f 69 6e 67 20 20 20 28 68 61 73 68 2d 74 pgoing (hash-t
2020: 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 able-ref/default
2030: 20 66 6c 61 67 73 20 22 2d 6b 65 65 70 67 6f 69 flags "-keepgoi
2040: 6e 67 22 20 23 66 29 29 0a 09 20 28 74 65 73 74 ng" #f)).. (test
2050: 2d 6e 61 6d 65 73 20 20 27 28 29 29 0a 09 20 28 -names '()).. (
2060: 72 75 6e 63 6f 6e 66 69 67 66 20 20 20 28 63 6f runconfigf (co
2070: 6e 63 20 20 2a 74 6f 70 70 61 74 68 2a 20 22 2f nc *toppath* "/
2080: 72 75 6e 63 6f 6e 66 69 67 73 2e 63 6f 6e 66 69 runconfigs.confi
2090: 67 22 29 29 0a 09 20 28 72 65 71 75 69 72 65 64 g")).. (required
20a0: 2d 74 65 73 74 73 20 27 28 29 29 0a 09 20 28 74 -tests '()).. (t
20b0: 65 73 74 2d 72 65 63 6f 72 64 73 20 28 6d 61 6b est-records (mak
20c0: 65 2d 68 61 73 68 2d 74 61 62 6c 65 29 29 29 0a e-hash-table))).
20d0: 0a 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 . (open-run-c
20e0: 6c 6f 73 65 20 73 65 74 2d 6d 65 67 61 74 65 73 lose set-megates
20f0: 74 2d 65 6e 76 2d 76 61 72 73 20 64 62 20 72 75 t-env-vars db ru
2100: 6e 2d 69 64 29 20 3b 3b 20 74 68 65 73 65 20 6d n-id) ;; these m
2110: 61 79 20 62 65 20 6e 65 65 64 65 64 20 62 79 20 ay be needed by
2120: 74 68 65 20 6c 61 75 6e 63 68 69 6e 67 20 70 72 the launching pr
2130: 6f 63 65 73 73 0a 0a 20 20 20 20 28 69 66 20 28 ocess.. (if (
2140: 66 69 6c 65 2d 65 78 69 73 74 73 3f 20 72 75 6e file-exists? run
2150: 63 6f 6e 66 69 67 66 29 0a 09 28 6f 70 65 6e 2d configf)..(open-
2160: 72 75 6e 2d 63 6c 6f 73 65 20 73 65 74 75 70 2d run-close setup-
2170: 65 6e 76 2d 64 65 66 61 75 6c 74 73 20 64 62 20 env-defaults db
2180: 72 75 6e 63 6f 6e 66 69 67 66 20 72 75 6e 2d 69 runconfigf run-i
2190: 64 20 2a 61 6c 72 65 61 64 79 2d 73 65 65 6e 2d d *already-seen-
21a0: 72 75 6e 63 6f 6e 66 69 67 2d 69 6e 66 6f 2a 20 runconfig-info*
21b0: 22 70 72 65 2d 6c 61 75 6e 63 68 2d 65 6e 76 2d "pre-launch-env-
21c0: 76 61 72 73 22 29 0a 09 28 64 65 62 75 67 3a 70 vars")..(debug:p
21d0: 72 69 6e 74 20 30 20 22 57 41 52 4e 49 4e 47 3a rint 0 "WARNING:
21e0: 20 59 6f 75 20 64 6f 20 6e 6f 74 20 68 61 76 65 You do not have
21f0: 20 61 20 72 75 6e 20 63 6f 6e 66 69 67 20 66 69 a run config fi
2200: 6c 65 3a 20 22 20 72 75 6e 63 6f 6e 66 69 67 66 le: " runconfigf
2210: 29 29 0a 20 20 20 20 0a 20 20 20 20 3b 3b 20 6c )). . ;; l
2220: 6f 6f 6b 20 75 70 20 61 6c 6c 20 74 65 73 74 73 ook up all tests
2230: 20 6d 61 74 63 68 69 6e 67 20 74 68 65 20 63 6f matching the co
2240: 6d 6d 61 20 73 65 70 61 72 61 74 65 64 20 6c 69 mma separated li
2250: 73 74 20 6f 66 20 67 6c 6f 62 73 20 69 6e 0a 20 st of globs in.
2260: 20 20 20 3b 3b 20 74 65 73 74 2d 70 61 74 74 73 ;; test-patts
2270: 20 28 75 73 69 6e 67 20 25 20 61 73 20 77 69 6c (using % as wil
2280: 64 63 61 72 64 29 0a 0a 20 20 20 20 28 73 65 74 dcard).. (set
2290: 21 20 74 65 73 74 2d 6e 61 6d 65 73 20 28 74 65 ! test-names (te
22a0: 73 74 73 3a 67 65 74 2d 76 61 6c 69 64 2d 74 65 sts:get-valid-te
22b0: 73 74 73 20 2a 74 6f 70 70 61 74 68 2a 20 74 65 sts *toppath* te
22c0: 73 74 2d 70 61 74 74 73 20 74 65 73 74 2d 6e 61 st-patts test-na
22d0: 6d 65 73 3a 20 74 65 73 74 2d 6e 61 6d 65 73 29 mes: test-names)
22e0: 29 0a 20 20 20 20 28 73 65 74 21 20 74 65 73 74 ). (set! test
22f0: 2d 6e 61 6d 65 73 20 28 64 65 6c 65 74 65 2d 64 -names (delete-d
2300: 75 70 6c 69 63 61 74 65 73 20 74 65 73 74 2d 6e uplicates test-n
2310: 61 6d 65 73 29 29 0a 0a 20 20 20 20 28 64 65 62 ames)).. (deb
2320: 75 67 3a 70 72 69 6e 74 20 30 20 22 49 4e 46 4f ug:print 0 "INFO
2330: 3a 20 74 65 73 74 20 6e 61 6d 65 73 20 22 20 74 : test names " t
2340: 65 73 74 2d 6e 61 6d 65 73 29 0a 0a 20 20 20 20 est-names)..
2350: 3b 3b 20 6f 6e 20 74 68 65 20 66 69 72 73 74 20 ;; on the first
2360: 70 61 73 73 20 6f 72 20 63 61 6c 6c 20 74 6f 20 pass or call to
2370: 72 75 6e 2d 74 65 73 74 73 20 73 65 74 20 46 41 run-tests set FA
2380: 49 4c 53 20 74 6f 20 4e 4f 54 5f 53 54 41 52 54 ILS to NOT_START
2390: 45 44 20 69 66 0a 20 20 20 20 3b 3b 20 2d 6b 65 ED if. ;; -ke
23a0: 65 70 67 6f 69 6e 67 20 69 73 20 73 70 65 63 69 epgoing is speci
23b0: 66 69 65 64 0a 20 20 20 20 28 69 66 20 28 65 71 fied. (if (eq
23c0: 3f 20 2a 70 61 73 73 6e 75 6d 2a 20 30 29 0a 09 ? *passnum* 0)..
23d0: 28 62 65 67 69 6e 0a 09 20 20 3b 3b 20 68 61 76 (begin.. ;; hav
23e0: 65 20 74 6f 20 64 65 6c 65 74 65 20 74 65 73 74 e to delete test
23f0: 20 72 65 63 6f 72 64 73 20 77 68 65 72 65 20 4e records where N
2400: 4f 54 5f 53 54 41 52 54 45 44 20 73 69 6e 63 65 OT_STARTED since
2410: 20 74 68 65 79 20 63 61 6e 20 63 61 75 73 65 20 they can cause
2420: 2d 6b 65 65 70 67 6f 69 6e 67 20 74 6f 20 0a 09 -keepgoing to ..
2430: 20 20 3b 3b 20 67 65 74 20 73 74 75 63 6b 20 64 ;; get stuck d
2440: 75 65 20 74 6f 20 62 65 63 6f 6d 69 6e 67 20 69 ue to becoming i
2450: 6e 61 63 63 65 73 73 69 62 6c 65 20 66 72 6f 6d naccessible from
2460: 20 61 20 66 61 69 6c 65 64 20 74 65 73 74 2e 20 a failed test.
2470: 49 2e 65 2e 20 69 66 20 74 65 73 74 20 42 20 64 I.e. if test B d
2480: 65 70 65 6e 64 73 20 0a 09 20 20 3b 3b 20 6f 6e epends .. ;; on
2490: 20 74 65 73 74 20 41 20 62 75 74 20 74 65 73 74 test A but test
24a0: 20 42 20 72 65 61 63 68 65 64 20 74 68 65 20 70 B reached the p
24b0: 6f 69 6e 74 20 6f 6e 20 62 65 69 6e 67 20 72 65 oint on being re
24c0: 67 69 73 74 65 72 65 64 20 61 73 20 4e 4f 54 5f gistered as NOT_
24d0: 53 54 41 52 54 45 44 20 61 6e 64 20 74 65 73 74 STARTED and test
24e0: 0a 09 20 20 3b 3b 20 41 20 66 61 69 6c 65 64 20 .. ;; A failed
24f0: 66 6f 72 20 73 6f 6d 65 20 72 65 61 73 6f 6e 20 for some reason
2500: 74 68 65 6e 20 6f 6e 20 72 65 2d 72 75 6e 20 75 then on re-run u
2510: 73 69 6e 67 20 2d 6b 65 65 70 67 6f 69 6e 67 20 sing -keepgoing
2520: 74 68 65 20 72 75 6e 20 63 61 6e 20 6e 65 76 65 the run can neve
2530: 72 20 63 6f 6d 70 6c 65 74 65 2e 0a 09 20 20 28 r complete... (
2540: 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 open-run-close d
2550: 62 3a 64 65 6c 65 74 65 2d 74 65 73 74 73 2d 69 b:delete-tests-i
2560: 6e 2d 73 74 61 74 65 20 64 62 20 72 75 6e 2d 69 n-state db run-i
2570: 64 20 22 4e 4f 54 5f 53 54 41 52 54 45 44 22 29 d "NOT_STARTED")
2580: 0a 09 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c .. (open-run-cl
2590: 6f 73 65 20 64 62 3a 73 65 74 2d 74 65 73 74 73 ose db:set-tests
25a0: 2d 73 74 61 74 65 2d 73 74 61 74 75 73 20 64 62 -state-status db
25b0: 20 72 75 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d run-id test-nam
25c0: 65 73 20 23 66 20 22 46 41 49 4c 22 20 22 4e 4f es #f "FAIL" "NO
25d0: 54 5f 53 54 41 52 54 45 44 22 20 22 46 41 49 4c T_STARTED" "FAIL
25e0: 22 29 29 29 0a 0a 20 20 20 20 3b 3b 20 66 72 6f "))).. ;; fro
25f0: 6d 20 68 65 72 65 20 6f 6e 20 6f 75 74 20 74 68 m here on out th
2600: 65 20 64 62 20 77 69 6c 6c 20 62 65 20 6f 70 65 e db will be ope
2610: 6e 65 64 20 61 6e 64 20 63 6c 6f 73 65 64 20 6f ned and closed o
2620: 6e 20 65 76 65 72 79 20 63 61 6c 6c 20 72 75 6e n every call run
2630: 73 3a 72 75 6e 2d 74 65 73 74 73 2d 71 75 65 75 s:run-tests-queu
2640: 65 0a 20 20 20 20 3b 3b 20 28 73 71 6c 69 74 65 e. ;; (sqlite
2650: 33 3a 66 69 6e 61 6c 69 7a 65 21 20 64 62 29 20 3:finalize! db)
2660: 0a 20 20 20 20 3b 3b 20 6e 6f 77 20 61 64 64 20 . ;; now add
2670: 6e 6f 6e 2d 64 69 72 65 63 74 6c 79 20 72 65 66 non-directly ref
2680: 65 72 65 6e 63 65 64 20 64 65 70 65 6e 64 65 6e erenced dependen
2690: 63 69 65 73 20 28 69 2e 65 2e 20 77 61 69 74 6f cies (i.e. waito
26a0: 6e 29 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 20 n). (if (not
26b0: 28 6e 75 6c 6c 3f 20 74 65 73 74 2d 6e 61 6d 65 (null? test-name
26c0: 73 29 29 0a 09 28 6c 65 74 20 6c 6f 6f 70 20 28 s))..(let loop (
26d0: 28 68 65 64 20 28 63 61 72 20 74 65 73 74 2d 6e (hed (car test-n
26e0: 61 6d 65 73 29 29 0a 09 09 20 20 20 28 74 61 6c ames))... (tal
26f0: 20 28 63 64 72 20 74 65 73 74 2d 6e 61 6d 65 73 (cdr test-names
2700: 29 29 29 20 20 20 20 20 20 20 20 20 3b 3b 20 27 ))) ;; '
2710: 72 65 74 75 72 6e 2d 70 72 6f 63 73 20 74 65 6c return-procs tel
2720: 6c 73 20 74 68 65 20 63 6f 6e 66 69 67 20 72 65 ls the config re
2730: 61 64 65 72 20 74 6f 20 70 72 65 70 20 72 75 6e ader to prep run
2740: 6e 69 6e 67 20 73 79 73 74 65 6d 20 62 75 74 20 ning system but
2750: 72 65 74 75 72 6e 20 61 20 70 72 6f 63 0a 09 20 return a proc..
2760: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 (debug:print 4
2770: 22 49 4e 46 4f 3a 20 68 65 64 3d 22 20 68 65 64 "INFO: hed=" hed
2780: 20 22 20 61 74 20 74 6f 70 20 6f 66 20 6c 6f 6f " at top of loo
2790: 70 22 29 0a 09 20 20 28 6c 65 74 2a 20 28 28 63 p").. (let* ((c
27a0: 6f 6e 66 69 67 20 20 28 74 65 73 74 73 3a 67 65 onfig (tests:ge
27b0: 74 2d 74 65 73 74 63 6f 6e 66 69 67 20 68 65 64 t-testconfig hed
27c0: 20 27 72 65 74 75 72 6e 2d 70 72 6f 63 73 29 29 'return-procs))
27d0: 0a 09 09 20 28 77 61 69 74 6f 6e 73 20 28 69 66 ... (waitons (if
27e0: 20 63 6f 6e 66 69 67 20 28 73 74 72 69 6e 67 2d config (string-
27f0: 73 70 6c 69 74 20 28 6c 65 74 20 28 28 77 20 28 split (let ((w (
2800: 63 6f 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 63 6f config-lookup co
2810: 6e 66 69 67 20 22 72 65 71 75 69 72 65 6d 65 6e nfig "requiremen
2820: 74 73 22 20 22 77 61 69 74 6f 6e 22 29 29 29 0a ts" "waiton"))).
2830: 09 09 09 09 09 09 20 20 20 20 20 28 69 66 20 77 ...... (if w
2840: 20 77 20 22 22 29 29 29 0a 09 09 09 20 20 20 20 w "")))....
2850: 20 20 28 62 65 67 69 6e 0a 09 09 09 09 28 64 65 (begin.....(de
2860: 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 bug:print 0 "ERR
2870: 4f 52 3a 20 6e 6f 6e 2d 65 78 69 73 74 65 6e 74 OR: non-existent
2880: 20 72 65 71 75 69 72 65 64 20 74 65 73 74 20 5c required test \
2890: 22 22 20 68 65 64 20 22 5c 22 22 29 0a 20 20 20 "" hed "\"").
28a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
28b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 28 69 66 (if
28c0: 20 64 62 20 28 73 71 6c 69 74 65 33 3a 66 69 6e db (sqlite3:fin
28d0: 61 6c 69 7a 65 21 20 64 62 29 29 0a 09 09 09 09 alize! db)).....
28e0: 28 65 78 69 74 20 31 29 29 29 29 29 0a 09 20 20 (exit 1)))))..
28f0: 20 20 3b 3b 20 63 68 65 63 6b 20 66 6f 72 20 68 ;; check for h
2900: 65 64 20 69 6e 20 77 61 69 74 6f 6e 73 20 3d 3e ed in waitons =>
2910: 20 74 68 69 73 20 77 6f 75 6c 64 20 62 65 20 63 this would be c
2920: 69 72 63 75 6c 61 72 2c 20 72 65 6d 6f 76 65 20 ircular, remove
2930: 69 74 20 61 6e 64 20 69 73 73 75 65 20 61 6e 0a it and issue an.
2940: 09 20 20 20 20 3b 3b 20 65 72 72 6f 72 0a 09 20 . ;; error..
2950: 20 20 20 28 69 66 20 28 6d 65 6d 62 65 72 20 68 (if (member h
2960: 65 64 20 77 61 69 74 6f 6e 73 29 0a 09 09 28 62 ed waitons)...(b
2970: 65 67 69 6e 0a 09 09 20 20 28 64 65 62 75 67 3a egin... (debug:
2980: 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a 20 print 0 "ERROR:
2990: 74 65 73 74 20 22 20 68 65 64 20 22 20 68 61 73 test " hed " has
29a0: 20 6c 69 73 74 65 64 20 69 74 73 65 6c 66 20 61 listed itself a
29b0: 73 20 61 20 77 61 69 74 6f 6e 2c 20 70 6c 65 61 s a waiton, plea
29c0: 73 65 20 63 6f 72 72 65 63 74 20 74 68 69 73 21 se correct this!
29d0: 22 29 0a 09 09 20 20 28 73 65 74 21 20 77 61 69 ")... (set! wai
29e0: 74 6f 6e 73 20 28 66 69 6c 74 65 72 20 28 6c 61 tons (filter (la
29f0: 6d 62 64 61 20 28 78 29 28 6e 6f 74 20 28 65 71 mbda (x)(not (eq
2a00: 75 61 6c 3f 20 78 20 68 65 64 29 29 29 20 77 61 ual? x hed))) wa
2a10: 69 74 6f 6e 73 29 29 29 29 0a 09 20 20 20 20 0a itons)))).. .
2a20: 09 20 20 20 20 3b 3b 20 28 69 74 65 6d 73 20 20 . ;; (items
2a30: 20 28 69 74 65 6d 73 3a 67 65 74 2d 69 74 65 6d (items:get-item
2a40: 73 2d 66 72 6f 6d 2d 63 6f 6e 66 69 67 20 63 6f s-from-config co
2a50: 6e 66 69 67 29 29 29 0a 09 20 20 20 20 28 69 66 nfig))).. (if
2a60: 20 28 6e 6f 74 20 28 68 61 73 68 2d 74 61 62 6c (not (hash-tabl
2a70: 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 74 65 e-ref/default te
2a80: 73 74 2d 72 65 63 6f 72 64 73 20 68 65 64 20 23 st-records hed #
2a90: 66 29 29 0a 09 09 28 68 61 73 68 2d 74 61 62 6c f))...(hash-tabl
2aa0: 65 2d 73 65 74 21 20 74 65 73 74 2d 72 65 63 6f e-set! test-reco
2ab0: 72 64 73 0a 09 09 09 09 20 68 65 64 20 28 76 65 rds..... hed (ve
2ac0: 63 74 6f 72 20 68 65 64 20 20 20 20 20 3b 3b 20 ctor hed ;;
2ad0: 30 0a 09 09 09 09 09 20 20 20 20 20 63 6f 6e 66 0...... conf
2ae0: 69 67 20 20 3b 3b 20 31 0a 09 09 09 09 09 20 20 ig ;; 1......
2af0: 20 20 20 77 61 69 74 6f 6e 73 20 3b 3b 20 32 0a waitons ;; 2.
2b00: 09 09 09 09 09 20 20 20 20 20 28 63 6f 6e 66 69 ..... (confi
2b10: 67 2d 6c 6f 6f 6b 75 70 20 63 6f 6e 66 69 67 20 g-lookup config
2b20: 22 72 65 71 75 69 72 65 6d 65 6e 74 73 22 20 22 "requirements" "
2b30: 70 72 69 6f 72 69 74 79 22 29 20 20 20 20 20 3b priority") ;
2b40: 3b 20 70 72 69 6f 72 69 74 79 20 33 0a 09 09 09 ; priority 3....
2b50: 09 09 20 20 20 20 20 28 6c 65 74 20 28 28 69 74 .. (let ((it
2b60: 65 6d 73 20 20 20 20 20 20 28 68 61 73 68 2d 74 ems (hash-t
2b70: 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 able-ref/default
2b80: 20 63 6f 6e 66 69 67 20 22 69 74 65 6d 73 22 20 config "items"
2b90: 23 66 29 29 20 3b 3b 20 69 74 65 6d 73 20 34 0a #f)) ;; items 4.
2ba0: 09 09 09 09 09 09 20 20 20 28 69 74 65 6d 73 74 ...... (itemst
2bb0: 61 62 6c 65 20 28 68 61 73 68 2d 74 61 62 6c 65 able (hash-table
2bc0: 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 63 6f 6e -ref/default con
2bd0: 66 69 67 20 22 69 74 65 6d 73 74 61 62 6c 65 22 fig "itemstable"
2be0: 20 23 66 29 29 29 20 0a 09 09 09 09 09 20 20 20 #f))) ......
2bf0: 20 20 20 20 3b 3b 20 69 66 20 65 69 74 68 65 72 ;; if either
2c00: 20 69 74 65 6d 73 20 6f 72 20 69 74 65 6d 73 20 items or items
2c10: 74 61 62 6c 65 20 69 73 20 61 20 70 72 6f 63 20 table is a proc
2c20: 72 65 74 75 72 6e 20 69 74 20 73 6f 20 74 65 73 return it so tes
2c30: 74 20 72 75 6e 6e 69 6e 67 0a 09 09 09 09 09 20 t running......
2c40: 20 20 20 20 20 20 3b 3b 20 70 72 6f 63 65 73 73 ;; process
2c50: 20 63 61 6e 20 6b 6e 6f 77 20 74 6f 20 63 61 6c can know to cal
2c60: 6c 20 69 74 65 6d 73 3a 67 65 74 2d 69 74 65 6d l items:get-item
2c70: 73 2d 66 72 6f 6d 2d 63 6f 6e 66 69 67 0a 09 09 s-from-config...
2c80: 09 09 09 20 20 20 20 20 20 20 3b 3b 20 69 66 20 ... ;; if
2c90: 65 69 74 68 65 72 20 69 73 20 61 20 6c 69 73 74 either is a list
2ca0: 20 61 6e 64 20 6e 6f 6e 65 20 69 73 20 61 20 70 and none is a p
2cb0: 72 6f 63 20 67 6f 20 61 68 65 61 64 20 61 6e 64 roc go ahead and
2cc0: 20 63 61 6c 6c 20 67 65 74 2d 69 74 65 6d 73 0a call get-items.
2cd0: 09 09 09 09 09 20 20 20 20 20 20 20 3b 3b 20 6f ..... ;; o
2ce0: 74 68 65 72 77 69 73 65 20 72 65 74 75 72 6e 20 therwise return
2cf0: 23 66 20 2d 20 74 68 69 73 20 69 73 20 6e 6f 74 #f - this is not
2d00: 20 61 6e 20 69 74 65 72 61 74 65 64 20 74 65 73 an iterated tes
2d10: 74 0a 09 09 09 09 09 20 20 20 20 20 20 20 28 63 t...... (c
2d20: 6f 6e 64 0a 09 09 09 09 09 09 28 28 70 72 6f 63 ond.......((proc
2d30: 65 64 75 72 65 3f 20 69 74 65 6d 73 29 20 20 20 edure? items)
2d40: 20 20 20 0a 09 09 09 09 09 09 20 28 64 65 62 75 ....... (debu
2d50: 67 3a 70 72 69 6e 74 20 34 20 22 49 4e 46 4f 3a g:print 4 "INFO:
2d60: 20 69 74 65 6d 73 20 69 73 20 61 20 70 72 6f 63 items is a proc
2d70: 65 64 75 72 65 2c 20 77 69 6c 6c 20 63 61 6c 63 edure, will calc
2d80: 20 6c 61 74 65 72 22 29 0a 09 09 09 09 09 09 20 later").......
2d90: 69 74 65 6d 73 29 20 20 20 20 20 20 20 20 20 20 items)
2da0: 20 20 3b 3b 20 63 61 6c 63 20 6c 61 74 65 72 0a ;; calc later.
2db0: 09 09 09 09 09 09 28 28 70 72 6f 63 65 64 75 72 ......((procedur
2dc0: 65 3f 20 69 74 65 6d 73 74 61 62 6c 65 29 0a 09 e? itemstable)..
2dd0: 09 09 09 09 09 20 28 64 65 62 75 67 3a 70 72 69 ..... (debug:pri
2de0: 6e 74 20 34 20 22 49 4e 46 4f 3a 20 69 74 65 6d nt 4 "INFO: item
2df0: 73 74 61 62 6c 65 20 69 73 20 61 20 70 72 6f 63 stable is a proc
2e00: 65 64 75 72 65 2c 20 77 69 6c 6c 20 63 61 6c 63 edure, will calc
2e10: 20 6c 61 74 65 72 22 29 0a 09 09 09 09 09 09 20 later").......
2e20: 69 74 65 6d 73 74 61 62 6c 65 29 20 20 20 20 20 itemstable)
2e30: 20 20 3b 3b 20 63 61 6c 63 20 6c 61 74 65 72 0a ;; calc later.
2e40: 09 09 09 09 09 09 28 28 66 69 6c 74 65 72 20 28 ......((filter (
2e50: 6c 61 6d 62 64 61 20 28 78 29 0a 09 09 09 09 09 lambda (x)......
2e60: 09 09 20 20 20 28 6c 65 74 20 28 28 76 61 6c 20 .. (let ((val
2e70: 28 63 61 72 20 78 29 29 29 0a 09 09 09 09 09 09 (car x))).......
2e80: 09 20 20 20 20 20 28 69 66 20 28 70 72 6f 63 65 . (if (proce
2e90: 64 75 72 65 3f 20 76 61 6c 29 20 76 61 6c 20 23 dure? val) val #
2ea0: 66 29 29 29 0a 09 09 09 09 09 09 09 20 28 61 70 f)))........ (ap
2eb0: 70 65 6e 64 20 28 69 66 20 28 6c 69 73 74 3f 20 pend (if (list?
2ec0: 69 74 65 6d 73 29 20 69 74 65 6d 73 20 27 28 29 items) items '()
2ed0: 29 0a 09 09 09 09 09 09 09 09 20 28 69 66 20 28 )......... (if (
2ee0: 6c 69 73 74 3f 20 69 74 65 6d 73 74 61 62 6c 65 list? itemstable
2ef0: 29 20 69 74 65 6d 73 74 61 62 6c 65 20 27 28 29 ) itemstable '()
2f00: 29 29 29 0a 09 09 09 09 09 09 20 27 68 61 76 65 )))....... 'have
2f10: 2d 70 72 6f 63 65 64 75 72 65 29 0a 09 09 09 09 -procedure).....
2f20: 09 09 28 28 6f 72 20 28 6c 69 73 74 3f 20 69 74 ..((or (list? it
2f30: 65 6d 73 29 28 6c 69 73 74 3f 20 69 74 65 6d 73 ems)(list? items
2f40: 74 61 62 6c 65 29 29 20 3b 3b 20 63 61 6c 63 20 table)) ;; calc
2f50: 6e 6f 77 0a 09 09 09 09 09 09 20 28 64 65 62 75 now....... (debu
2f60: 67 3a 70 72 69 6e 74 20 34 20 22 49 4e 46 4f 3a g:print 4 "INFO:
2f70: 20 69 74 65 6d 73 20 61 6e 64 20 69 74 65 6d 73 items and items
2f80: 74 61 62 6c 65 20 61 72 65 20 6c 69 73 74 73 2c table are lists,
2f90: 20 63 61 6c 63 20 6e 6f 77 5c 6e 22 0a 09 09 09 calc now\n"....
2fa0: 09 09 09 09 20 20 20 20 20 20 22 20 20 20 20 69 .... " i
2fb0: 74 65 6d 73 3a 20 22 20 69 74 65 6d 73 20 22 20 tems: " items "
2fc0: 69 74 65 6d 73 74 61 62 6c 65 3a 20 22 20 69 74 itemstable: " it
2fd0: 65 6d 73 74 61 62 6c 65 29 0a 09 09 09 09 09 09 emstable).......
2fe0: 20 28 69 74 65 6d 73 3a 67 65 74 2d 69 74 65 6d (items:get-item
2ff0: 73 2d 66 72 6f 6d 2d 63 6f 6e 66 69 67 20 63 6f s-from-config co
3000: 6e 66 69 67 29 29 0a 09 09 09 09 09 09 28 65 6c nfig)).......(el
3010: 73 65 20 23 66 29 29 29 20 20 20 20 20 20 20 20 se #f)))
3020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
3030: 20 20 20 3b 3b 20 6e 6f 74 20 69 74 65 72 61 74 ;; not iterat
3040: 65 64 0a 09 09 09 09 09 20 20 20 20 20 23 66 20 ed...... #f
3050: 20 20 20 20 20 3b 3b 20 69 74 65 6d 73 64 61 74 ;; itemsdat
3060: 20 35 0a 09 09 09 09 09 20 20 20 20 20 23 66 20 5...... #f
3070: 20 20 20 20 20 3b 3b 20 73 70 61 72 65 20 2d 20 ;; spare -
3080: 75 73 65 64 20 66 6f 72 20 69 74 65 6d 2d 70 61 used for item-pa
3090: 74 68 0a 09 09 09 09 09 20 20 20 20 20 29 29 29 th...... )))
30a0: 0a 09 20 20 20 20 28 66 6f 72 2d 65 61 63 68 20 .. (for-each
30b0: 0a 09 20 20 20 20 20 28 6c 61 6d 62 64 61 20 28 .. (lambda (
30c0: 77 61 69 74 6f 6e 29 0a 09 20 20 20 20 20 20 20 waiton)..
30d0: 28 69 66 20 28 61 6e 64 20 77 61 69 74 6f 6e 20 (if (and waiton
30e0: 28 6e 6f 74 20 28 6d 65 6d 62 65 72 20 77 61 69 (not (member wai
30f0: 74 6f 6e 20 74 65 73 74 2d 6e 61 6d 65 73 29 29 ton test-names))
3100: 29 0a 09 09 20 20 20 28 62 65 67 69 6e 0a 09 09 )... (begin...
3110: 20 20 20 20 20 28 73 65 74 21 20 72 65 71 75 69 (set! requi
3120: 72 65 64 2d 74 65 73 74 73 20 28 63 6f 6e 73 20 red-tests (cons
3130: 77 61 69 74 6f 6e 20 72 65 71 75 69 72 65 64 2d waiton required-
3140: 74 65 73 74 73 29 29 0a 09 09 20 20 20 20 20 28 tests))... (
3150: 73 65 74 21 20 74 65 73 74 2d 6e 61 6d 65 73 20 set! test-names
3160: 28 63 6f 6e 73 20 77 61 69 74 6f 6e 20 74 65 73 (cons waiton tes
3170: 74 2d 6e 61 6d 65 73 29 29 29 29 29 20 3b 3b 20 t-names))))) ;;
3180: 77 61 73 20 61 6e 20 61 70 70 65 6e 64 2c 20 6e was an append, n
3190: 6f 77 20 61 20 63 6f 6e 73 0a 09 20 20 20 20 20 ow a cons..
31a0: 77 61 69 74 6f 6e 73 29 0a 09 20 20 20 20 28 6c waitons).. (l
31b0: 65 74 20 28 28 72 65 6d 74 65 73 74 73 20 28 64 et ((remtests (d
31c0: 65 6c 65 74 65 2d 64 75 70 6c 69 63 61 74 65 73 elete-duplicates
31d0: 20 28 61 70 70 65 6e 64 20 77 61 69 74 6f 6e 73 (append waitons
31e0: 20 74 61 6c 29 29 29 29 0a 09 20 20 20 20 20 20 tal))))..
31f0: 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 (if (not (null?
3200: 72 65 6d 74 65 73 74 73 29 29 0a 09 09 20 20 28 remtests))... (
3210: 6c 6f 6f 70 20 28 63 61 72 20 72 65 6d 74 65 73 loop (car remtes
3220: 74 73 29 28 63 64 72 20 72 65 6d 74 65 73 74 73 ts)(cdr remtests
3230: 29 29 29 29 29 29 29 0a 0a 20 20 20 20 28 69 66 ))))))).. (if
3240: 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 72 65 71 (not (null? req
3250: 75 69 72 65 64 2d 74 65 73 74 73 29 29 0a 09 28 uired-tests))..(
3260: 64 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 49 debug:print 1 "I
3270: 4e 46 4f 3a 20 41 64 64 69 6e 67 20 22 20 72 65 NFO: Adding " re
3280: 71 75 69 72 65 64 2d 74 65 73 74 73 20 22 20 74 quired-tests " t
3290: 6f 20 74 68 65 20 72 75 6e 20 71 75 65 75 65 22 o the run queue"
32a0: 29 29 0a 20 20 20 20 3b 3b 20 4e 4f 54 45 3a 20 )). ;; NOTE:
32b0: 74 68 65 73 65 20 61 72 65 20 61 6c 6c 20 70 61 these are all pa
32c0: 72 65 6e 74 20 74 65 73 74 73 2c 20 69 74 65 6d rent tests, item
32d0: 73 20 61 72 65 20 6e 6f 74 20 65 78 70 61 6e 64 s are not expand
32e0: 65 64 20 79 65 74 2e 0a 20 20 20 20 28 64 65 62 ed yet.. (deb
32f0: 75 67 3a 70 72 69 6e 74 20 34 20 22 49 4e 46 4f ug:print 4 "INFO
3300: 3a 20 74 65 73 74 2d 72 65 63 6f 72 64 73 3d 22 : test-records="
3310: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 3e 61 6c (hash-table->al
3320: 69 73 74 20 74 65 73 74 2d 72 65 63 6f 72 64 73 ist test-records
3330: 29 29 0a 20 20 20 20 28 72 75 6e 73 3a 72 75 6e )). (runs:run
3340: 2d 74 65 73 74 73 2d 71 75 65 75 65 20 72 75 6e -tests-queue run
3350: 2d 69 64 20 72 75 6e 6e 61 6d 65 20 74 65 73 74 -id runname test
3360: 2d 72 65 63 6f 72 64 73 20 6b 65 79 76 61 6c 6c -records keyvall
3370: 73 74 20 66 6c 61 67 73 20 74 65 73 74 2d 70 61 st flags test-pa
3380: 74 74 73 29 0a 20 20 20 20 28 64 65 62 75 67 3a tts). (debug:
3390: 70 72 69 6e 74 20 34 20 22 49 4e 46 4f 3a 20 41 print 4 "INFO: A
33a0: 6c 6c 20 64 6f 6e 65 20 62 79 20 68 65 72 65 22 ll done by here"
33b0: 29 29 29 0a 0a 28 64 65 66 69 6e 65 20 28 72 75 )))..(define (ru
33c0: 6e 73 3a 63 61 6c 63 2d 66 61 69 6c 73 20 70 72 ns:calc-fails pr
33d0: 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 0a 20 ereqs-not-met).
33e0: 20 28 66 69 6c 74 65 72 20 28 6c 61 6d 62 64 61 (filter (lambda
33f0: 20 28 74 65 73 74 29 0a 09 20 20 20 20 28 61 6e (test).. (an
3400: 64 20 28 76 65 63 74 6f 72 3f 20 74 65 73 74 29 d (vector? test)
3410: 20 3b 3b 20 6e 6f 74 20 28 73 74 72 69 6e 67 3f ;; not (string?
3420: 20 74 65 73 74 29 29 0a 09 09 20 28 65 71 75 61 test))... (equa
3430: 6c 3f 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d l? (db:test-get-
3440: 73 74 61 74 65 20 74 65 73 74 29 20 22 43 4f 4d state test) "COM
3450: 50 4c 45 54 45 44 22 29 0a 09 09 20 28 6e 6f 74 PLETED")... (not
3460: 20 28 6d 65 6d 62 65 72 20 28 64 62 3a 74 65 73 (member (db:tes
3470: 74 2d 67 65 74 2d 73 74 61 74 75 73 20 74 65 73 t-get-status tes
3480: 74 29 0a 09 09 09 20 20 20 20 20 20 27 28 22 50 t).... '("P
3490: 41 53 53 22 20 22 57 41 52 4e 22 20 22 43 48 45 ASS" "WARN" "CHE
34a0: 43 4b 22 20 22 57 41 49 56 45 44 22 29 29 29 29 CK" "WAIVED"))))
34b0: 29 0a 09 20 20 70 72 65 72 65 71 73 2d 6e 6f 74 ).. prereqs-not
34c0: 2d 6d 65 74 29 29 0a 0a 28 64 65 66 69 6e 65 20 -met))..(define
34d0: 28 72 75 6e 73 3a 63 61 6c 63 2d 6e 6f 74 2d 63 (runs:calc-not-c
34e0: 6f 6d 70 6c 65 74 65 64 20 70 72 65 72 65 71 73 ompleted prereqs
34f0: 2d 6e 6f 74 2d 6d 65 74 29 0a 20 20 28 66 69 6c -not-met). (fil
3500: 74 65 72 0a 20 20 20 28 6c 61 6d 62 64 61 20 28 ter. (lambda (
3510: 74 29 0a 20 20 20 20 20 28 6f 72 20 28 6e 6f 74 t). (or (not
3520: 20 28 76 65 63 74 6f 72 3f 20 74 29 29 0a 09 20 (vector? t))..
3530: 28 6e 6f 74 20 28 65 71 75 61 6c 3f 20 22 43 4f (not (equal? "CO
3540: 4d 50 4c 45 54 45 44 22 20 28 64 62 3a 74 65 73 MPLETED" (db:tes
3550: 74 2d 67 65 74 2d 73 74 61 74 65 20 74 29 29 29 t-get-state t)))
3560: 29 29 0a 20 20 20 70 72 65 72 65 71 73 2d 6e 6f )). prereqs-no
3570: 74 2d 6d 65 74 29 29 0a 0a 28 64 65 66 69 6e 65 t-met))..(define
3580: 20 28 72 75 6e 73 3a 70 72 65 74 74 79 2d 73 74 (runs:pretty-st
3590: 72 69 6e 67 20 6c 73 74 29 0a 20 20 28 6d 61 70 ring lst). (map
35a0: 20 28 6c 61 6d 62 64 61 20 28 74 29 0a 09 20 28 (lambda (t).. (
35b0: 69 66 20 28 6e 6f 74 20 28 76 65 63 74 6f 72 3f if (not (vector?
35c0: 20 74 29 29 0a 09 20 20 20 20 20 28 63 6f 6e 63 t)).. (conc
35d0: 20 74 29 0a 09 20 20 20 20 20 28 63 6f 6e 63 20 t).. (conc
35e0: 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 74 65 73 (db:test-get-tes
35f0: 74 6e 61 6d 65 20 74 29 20 22 3a 22 20 28 64 62 tname t) ":" (db
3600: 3a 74 65 73 74 2d 67 65 74 2d 73 74 61 74 65 20 :test-get-state
3610: 74 29 20 22 2f 22 20 28 64 62 3a 74 65 73 74 2d t) "/" (db:test-
3620: 67 65 74 2d 73 74 61 74 75 73 20 74 29 29 29 29 get-status t))))
3630: 0a 20 20 20 20 20 20 20 6c 73 74 29 29 0a 0a 28 . lst))..(
3640: 64 65 66 69 6e 65 20 28 72 75 6e 73 3a 6d 61 6b define (runs:mak
3650: 65 2d 66 75 6c 6c 2d 74 65 73 74 2d 6e 61 6d 65 e-full-test-name
3660: 20 74 65 73 74 6e 61 6d 65 20 69 74 65 6d 70 61 testname itempa
3670: 74 68 29 0a 20 20 28 69 66 20 28 65 71 75 61 6c th). (if (equal
3680: 3f 20 69 74 65 6d 70 61 74 68 20 22 22 29 20 74 ? itempath "") t
3690: 65 73 74 6e 61 6d 65 20 28 63 6f 6e 63 20 74 65 estname (conc te
36a0: 73 74 6e 61 6d 65 20 22 2f 22 20 69 74 65 6d 70 stname "/" itemp
36b0: 61 74 68 29 29 29 0a 0a 3b 3b 20 74 65 73 74 2d ath)))..;; test-
36c0: 72 65 63 6f 72 64 73 20 69 73 20 61 20 68 61 73 records is a has
36d0: 68 20 74 61 62 6c 65 20 74 65 73 74 6e 61 6d 65 h table testname
36e0: 3a 69 74 65 6d 5f 70 61 74 68 20 3d 3e 20 76 65 :item_path => ve
36f0: 63 74 6f 72 20 3c 20 74 65 73 74 6e 61 6d 65 20 ctor < testname
3700: 74 65 73 74 63 6f 6e 66 69 67 20 77 61 69 74 6f testconfig waito
3710: 6e 73 20 70 72 69 6f 72 69 74 79 20 69 74 65 6d ns priority item
3720: 73 2d 69 6e 66 6f 20 2e 2e 2e 20 3e 0a 28 64 65 s-info ... >.(de
3730: 66 69 6e 65 20 28 72 75 6e 73 3a 72 75 6e 2d 74 fine (runs:run-t
3740: 65 73 74 73 2d 71 75 65 75 65 20 72 75 6e 2d 69 ests-queue run-i
3750: 64 20 72 75 6e 6e 61 6d 65 20 74 65 73 74 2d 72 d runname test-r
3760: 65 63 6f 72 64 73 20 6b 65 79 76 61 6c 6c 73 74 ecords keyvallst
3770: 20 66 6c 61 67 73 20 74 65 73 74 2d 70 61 74 74 flags test-patt
3780: 73 29 0a 20 20 20 20 3b 3b 20 41 74 20 74 68 69 s). ;; At thi
3790: 73 20 70 6f 69 6e 74 20 74 68 65 20 6c 69 73 74 s point the list
37a0: 20 6f 66 20 70 61 72 65 6e 74 20 74 65 73 74 73 of parent tests
37b0: 20 69 73 20 65 78 70 61 6e 64 65 64 20 0a 20 20 is expanded .
37c0: 20 20 3b 3b 20 4e 42 2f 2f 20 53 68 6f 75 6c 64 ;; NB// Should
37d0: 20 65 78 70 61 6e 64 20 69 74 65 6d 73 20 68 65 expand items he
37e0: 72 65 20 61 6e 64 20 74 68 65 6e 20 69 6e 73 65 re and then inse
37f0: 72 74 20 69 6e 74 6f 20 74 68 65 20 72 75 6e 20 rt into the run
3800: 71 75 65 75 65 2e 0a 20 20 28 64 65 62 75 67 3a queue.. (debug:
3810: 70 72 69 6e 74 20 35 20 22 74 65 73 74 2d 72 65 print 5 "test-re
3820: 63 6f 72 64 73 3a 20 22 20 74 65 73 74 2d 72 65 cords: " test-re
3830: 63 6f 72 64 73 20 22 2c 20 6b 65 79 76 61 6c 6c cords ", keyvall
3840: 73 74 3a 20 22 20 6b 65 79 76 61 6c 6c 73 74 20 st: " keyvallst
3850: 22 20 66 6c 61 67 73 3a 20 22 20 28 68 61 73 68 " flags: " (hash
3860: 2d 74 61 62 6c 65 2d 3e 61 6c 69 73 74 20 66 6c -table->alist fl
3870: 61 67 73 29 29 0a 20 20 28 6c 65 74 20 28 28 73 ags)). (let ((s
3880: 6f 72 74 65 64 2d 74 65 73 74 2d 6e 61 6d 65 73 orted-test-names
3890: 20 28 74 65 73 74 73 3a 73 6f 72 74 2d 62 79 2d (tests:sort-by-
38a0: 70 72 69 6f 72 69 74 79 2d 61 6e 64 2d 77 61 69 priority-and-wai
38b0: 74 6f 6e 20 74 65 73 74 2d 72 65 63 6f 72 64 73 ton test-records
38c0: 29 29 0a 09 28 74 65 73 74 2d 72 65 67 69 73 74 ))..(test-regist
38d0: 65 72 79 20 20 20 20 28 6d 61 6b 65 2d 68 61 73 ery (make-has
38e0: 68 2d 74 61 62 6c 65 29 29 0a 09 28 6e 75 6d 2d h-table))..(num-
38f0: 72 65 74 72 69 65 73 20 20 20 20 20 20 20 20 30 retries 0
3900: 29 0a 09 28 6d 61 78 2d 72 65 74 72 69 65 73 20 )..(max-retries
3910: 20 20 20 20 20 20 28 63 6f 6e 66 69 67 2d 6c 6f (config-lo
3920: 6f 6b 75 70 20 2a 63 6f 6e 66 69 67 64 61 74 2a okup *configdat*
3930: 20 22 73 65 74 75 70 22 20 22 6d 61 78 72 65 74 "setup" "maxret
3940: 72 69 65 73 22 29 29 29 0a 20 20 20 20 28 73 65 ries"))). (se
3950: 74 21 20 6d 61 78 2d 72 65 74 72 69 65 73 20 28 t! max-retries (
3960: 69 66 20 28 61 6e 64 20 6d 61 78 2d 72 65 74 72 if (and max-retr
3970: 69 65 73 20 28 73 74 72 69 6e 67 2d 3e 6e 75 6d ies (string->num
3980: 62 65 72 20 6d 61 78 2d 72 65 74 72 69 65 73 29 ber max-retries)
3990: 29 28 73 74 72 69 6e 67 2d 3e 6e 75 6d 62 65 72 )(string->number
39a0: 20 6d 61 78 2d 72 65 74 72 69 65 73 29 20 31 30 max-retries) 10
39b0: 30 29 29 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 0)). (if (not
39c0: 20 28 6e 75 6c 6c 3f 20 73 6f 72 74 65 64 2d 74 (null? sorted-t
39d0: 65 73 74 2d 6e 61 6d 65 73 29 29 0a 09 28 6c 65 est-names))..(le
39e0: 74 20 6c 6f 6f 70 20 28 28 68 65 64 20 20 20 20 t loop ((hed
39f0: 20 20 20 20 20 28 63 61 72 20 73 6f 72 74 65 64 (car sorted
3a00: 2d 74 65 73 74 2d 6e 61 6d 65 73 29 29 0a 09 09 -test-names))...
3a10: 20 20 20 28 74 61 6c 20 20 20 20 20 20 20 20 20 (tal
3a20: 28 63 64 72 20 73 6f 72 74 65 64 2d 74 65 73 74 (cdr sorted-test
3a30: 2d 6e 61 6d 65 73 29 29 0a 09 09 20 20 20 28 72 -names))... (r
3a40: 65 72 75 6e 73 20 20 20 20 20 20 27 28 29 29 29 eruns '()))
3a50: 0a 09 20 20 28 69 66 20 28 6e 6f 74 20 28 6e 75 .. (if (not (nu
3a60: 6c 6c 3f 20 72 65 72 75 6e 73 29 29 28 64 65 62 ll? reruns))(deb
3a70: 75 67 3a 70 72 69 6e 74 20 34 20 22 49 4e 46 4f ug:print 4 "INFO
3a80: 3a 20 72 65 72 75 6e 73 3d 22 20 72 65 72 75 6e : reruns=" rerun
3a90: 73 29 29 0a 09 20 20 3b 3b 20 28 70 72 69 6e 74 s)).. ;; (print
3aa0: 20 22 54 6f 70 20 6f 66 20 6c 6f 6f 70 2c 20 68 "Top of loop, h
3ab0: 65 64 3d 22 20 68 65 64 20 22 2c 20 74 61 6c 3d ed=" hed ", tal=
3ac0: 22 20 74 61 6c 20 22 20 2c 72 65 72 75 6e 73 3d " tal " ,reruns=
3ad0: 22 20 72 65 72 75 6e 73 29 0a 09 20 20 28 6c 65 " reruns).. (le
3ae0: 74 2a 20 28 28 74 65 73 74 2d 72 65 63 6f 72 64 t* ((test-record
3af0: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 66 (hash-table-ref
3b00: 20 74 65 73 74 2d 72 65 63 6f 72 64 73 20 68 65 test-records he
3b10: 64 29 29 0a 09 09 20 28 74 65 73 74 2d 6e 61 6d d))... (test-nam
3b20: 65 20 20 20 28 74 65 73 74 73 3a 74 65 73 74 71 e (tests:testq
3b30: 75 65 75 65 2d 67 65 74 2d 74 65 73 74 6e 61 6d ueue-get-testnam
3b40: 65 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a e test-record)).
3b50: 09 09 20 28 74 63 6f 6e 66 69 67 20 20 20 20 20 .. (tconfig
3b60: 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 (tests:testqueue
3b70: 2d 67 65 74 2d 74 65 73 74 63 6f 6e 66 69 67 20 -get-testconfig
3b80: 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 09 test-record))...
3b90: 20 28 74 65 73 74 6d 6f 64 65 20 20 20 20 28 6c (testmode (l
3ba0: 65 74 20 28 28 6d 20 28 63 6f 6e 66 69 67 2d 6c et ((m (config-l
3bb0: 6f 6f 6b 75 70 20 74 63 6f 6e 66 69 67 20 22 72 ookup tconfig "r
3bc0: 65 71 75 69 72 65 6d 65 6e 74 73 22 20 22 6d 6f equirements" "mo
3bd0: 64 65 22 29 29 29 0a 09 09 09 09 28 69 66 20 6d de"))).....(if m
3be0: 20 28 73 74 72 69 6e 67 2d 3e 73 79 6d 62 6f 6c (string->symbol
3bf0: 20 6d 29 20 27 6e 6f 72 6d 61 6c 29 29 29 0a 09 m) 'normal)))..
3c00: 09 20 28 77 61 69 74 6f 6e 73 20 20 20 20 20 28 . (waitons (
3c10: 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 2d tests:testqueue-
3c20: 67 65 74 2d 77 61 69 74 6f 6e 73 20 20 20 20 74 get-waitons t
3c30: 65 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 09 20 est-record))...
3c40: 28 70 72 69 6f 72 69 74 79 20 20 20 20 28 74 65 (priority (te
3c50: 73 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 sts:testqueue-ge
3c60: 74 2d 70 72 69 6f 72 69 74 79 20 20 20 74 65 73 t-priority tes
3c70: 74 2d 72 65 63 6f 72 64 29 29 0a 09 09 20 28 69 t-record))... (i
3c80: 74 65 6d 64 61 74 20 20 20 20 20 28 74 65 73 74 temdat (test
3c90: 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d s:testqueue-get-
3ca0: 69 74 65 6d 64 61 74 20 20 20 20 74 65 73 74 2d itemdat test-
3cb0: 72 65 63 6f 72 64 29 29 20 3b 3b 20 69 74 65 6d record)) ;; item
3cc0: 64 61 74 20 63 61 6e 20 62 65 20 61 20 73 74 72 dat can be a str
3cd0: 69 6e 67 2c 20 6c 69 73 74 20 6f 72 20 23 66 0a ing, list or #f.
3ce0: 09 09 20 28 69 74 65 6d 73 20 20 20 20 20 20 20 .. (items
3cf0: 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 (tests:testqueue
3d00: 2d 67 65 74 2d 69 74 65 6d 73 20 20 20 20 20 20 -get-items
3d10: 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 09 test-record))...
3d20: 20 28 69 74 65 6d 2d 70 61 74 68 20 20 20 28 69 (item-path (i
3d30: 74 65 6d 2d 6c 69 73 74 2d 3e 70 61 74 68 20 69 tem-list->path i
3d40: 74 65 6d 64 61 74 29 29 0a 09 09 20 28 6e 65 77 temdat))... (new
3d50: 74 61 6c 20 20 20 20 20 20 28 61 70 70 65 6e 64 tal (append
3d60: 20 74 61 6c 20 28 6c 69 73 74 20 68 65 64 29 29 tal (list hed))
3d70: 29 29 0a 09 20 20 20 20 0a 09 20 20 20 20 28 64 )).. .. (d
3d80: 65 62 75 67 3a 70 72 69 6e 74 20 36 0a 09 09 09 ebug:print 6....
3d90: 20 22 74 65 73 74 2d 6e 61 6d 65 3a 20 22 20 74 "test-name: " t
3da0: 65 73 74 2d 6e 61 6d 65 0a 09 09 09 20 22 5c 6e est-name.... "\n
3db0: 20 20 68 65 64 3a 20 20 20 20 20 20 20 20 20 22 hed: "
3dc0: 20 68 65 64 0a 09 09 09 20 22 5c 6e 20 20 69 74 hed.... "\n it
3dd0: 65 6d 64 61 74 3a 20 20 20 20 20 22 20 69 74 65 emdat: " ite
3de0: 6d 64 61 74 0a 09 09 09 20 22 5c 6e 20 20 69 74 mdat.... "\n it
3df0: 65 6d 73 3a 20 20 20 20 20 20 20 22 20 69 74 65 ems: " ite
3e00: 6d 73 0a 09 09 09 20 22 5c 6e 20 20 69 74 65 6d ms.... "\n item
3e10: 2d 70 61 74 68 3a 20 20 20 22 20 69 74 65 6d 2d -path: " item-
3e20: 70 61 74 68 0a 09 09 09 20 22 5c 6e 20 20 77 61 path.... "\n wa
3e30: 69 74 6f 6e 73 3a 20 20 20 20 20 22 20 77 61 69 itons: " wai
3e40: 74 6f 6e 73 0a 09 09 09 20 22 5c 6e 20 20 6e 75 tons.... "\n nu
3e50: 6d 2d 72 65 74 72 69 65 73 3a 20 22 20 6e 75 6d m-retries: " num
3e60: 2d 72 65 74 72 69 65 73 0a 09 09 09 20 22 5c 6e -retries.... "\n
3e70: 20 20 74 61 6c 3a 20 20 20 20 20 20 20 20 20 22 tal: "
3e80: 20 74 61 6c 0a 09 09 09 20 22 5c 6e 20 20 72 65 tal.... "\n re
3e90: 72 75 6e 73 3a 20 20 20 20 20 20 22 20 72 65 72 runs: " rer
3ea0: 75 6e 73 29 0a 0a 09 20 20 20 20 3b 3b 20 63 68 uns)... ;; ch
3eb0: 65 63 6b 20 66 6f 72 20 68 65 64 20 69 6e 20 77 eck for hed in w
3ec0: 61 69 74 6f 6e 73 20 3d 3e 20 74 68 69 73 20 77 aitons => this w
3ed0: 6f 75 6c 64 20 62 65 20 63 69 72 63 75 6c 61 72 ould be circular
3ee0: 2c 20 72 65 6d 6f 76 65 20 69 74 20 61 6e 64 20 , remove it and
3ef0: 69 73 73 75 65 20 61 6e 0a 09 20 20 20 20 3b 3b issue an.. ;;
3f00: 20 65 72 72 6f 72 0a 09 20 20 20 20 28 69 66 20 error.. (if
3f10: 28 6d 65 6d 62 65 72 20 74 65 73 74 2d 6e 61 6d (member test-nam
3f20: 65 20 77 61 69 74 6f 6e 73 29 0a 09 09 28 62 65 e waitons)...(be
3f30: 67 69 6e 0a 09 09 20 20 28 64 65 62 75 67 3a 70 gin... (debug:p
3f40: 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a 20 74 rint 0 "ERROR: t
3f50: 65 73 74 20 22 20 74 65 73 74 2d 6e 61 6d 65 20 est " test-name
3f60: 22 20 68 61 73 20 6c 69 73 74 65 64 20 69 74 73 " has listed its
3f70: 65 6c 66 20 61 73 20 61 20 77 61 69 74 6f 6e 2c elf as a waiton,
3f80: 20 70 6c 65 61 73 65 20 63 6f 72 72 65 63 74 20 please correct
3f90: 74 68 69 73 21 22 29 0a 09 09 20 20 28 73 65 74 this!")... (set
3fa0: 21 20 77 61 69 74 6f 6e 20 28 66 69 6c 74 65 72 ! waiton (filter
3fb0: 20 28 6c 61 6d 62 64 61 20 28 78 29 28 6e 6f 74 (lambda (x)(not
3fc0: 20 28 65 71 75 61 6c 3f 20 78 20 68 65 64 29 29 (equal? x hed))
3fd0: 29 20 77 61 69 74 6f 6e 73 29 29 29 29 0a 0a 09 ) waitons))))...
3fe0: 20 20 20 20 28 63 6f 6e 64 20 3b 3b 20 4f 55 54 (cond ;; OUT
3ff0: 45 52 20 43 4f 4e 44 0a 09 20 20 20 20 20 28 28 ER COND.. ((
4000: 6e 6f 74 20 69 74 65 6d 73 29 20 3b 3b 20 77 68 not items) ;; wh
4010: 65 6e 20 66 61 6c 73 65 20 74 68 65 20 74 65 73 en false the tes
4020: 74 20 69 73 20 6f 6b 20 74 6f 20 62 65 20 68 61 t is ok to be ha
4030: 6e 64 65 64 20 6f 66 66 20 74 6f 20 6c 61 75 6e nded off to laun
4040: 63 68 20 28 62 75 74 20 6e 6f 74 20 62 65 66 6f ch (but not befo
4050: 72 65 29 0a 09 20 20 20 20 20 20 28 6c 65 74 2a re).. (let*
4060: 20 28 28 72 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e ((run-limits-in
4070: 66 6f 20 20 20 20 20 20 20 20 20 28 6f 70 65 6e fo (open
4080: 2d 72 75 6e 2d 63 6c 6f 73 65 20 72 75 6e 73 3a -run-close runs:
4090: 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 2d 74 65 73 can-run-more-tes
40a0: 74 73 20 23 66 20 74 65 73 74 2d 72 65 63 6f 72 ts #f test-recor
40b0: 64 29 29 20 3b 3b 20 6c 6f 6f 6b 20 61 74 20 74 d)) ;; look at t
40c0: 68 65 20 74 65 73 74 20 6a 6f 62 67 72 6f 75 70 he test jobgroup
40d0: 20 61 6e 64 20 74 6f 74 20 6a 6f 62 73 20 72 75 and tot jobs ru
40e0: 6e 6e 69 6e 67 0a 09 09 20 20 20 20 20 28 68 61 nning... (ha
40f0: 76 65 2d 72 65 73 6f 75 72 63 65 73 20 20 20 20 ve-resources
4100: 20 20 20 20 20 20 28 63 61 72 20 72 75 6e 2d 6c (car run-l
4110: 69 6d 69 74 73 2d 69 6e 66 6f 29 29 0a 09 09 20 imits-info))...
4120: 20 20 20 20 28 6e 75 6d 2d 72 75 6e 6e 69 6e 67 (num-running
4130: 20 20 20 20 20 20 20 20 20 20 20 20 20 28 6c 69 (li
4140: 73 74 2d 72 65 66 20 72 75 6e 2d 6c 69 6d 69 74 st-ref run-limit
4150: 73 2d 69 6e 66 6f 20 31 29 29 0a 09 09 20 20 20 s-info 1))...
4160: 20 20 28 6e 75 6d 2d 72 75 6e 6e 69 6e 67 2d 69 (num-running-i
4170: 6e 2d 6a 6f 62 67 72 6f 75 70 20 28 6c 69 73 74 n-jobgroup (list
4180: 2d 72 65 66 20 72 75 6e 2d 6c 69 6d 69 74 73 2d -ref run-limits-
4190: 69 6e 66 6f 20 32 29 29 0a 09 09 20 20 20 20 20 info 2))...
41a0: 28 6d 61 78 2d 63 6f 6e 63 75 72 72 65 6e 74 2d (max-concurrent-
41b0: 6a 6f 62 73 20 20 20 20 20 28 6c 69 73 74 2d 72 jobs (list-r
41c0: 65 66 20 72 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e ef run-limits-in
41d0: 66 6f 20 33 29 29 0a 09 09 20 20 20 20 20 28 6a fo 3))... (j
41e0: 6f 62 2d 67 72 6f 75 70 2d 6c 69 6d 69 74 20 20 ob-group-limit
41f0: 20 20 20 20 20 20 20 28 6c 69 73 74 2d 72 65 66 (list-ref
4200: 20 72 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e 66 6f run-limits-info
4210: 20 34 29 29 0a 09 09 20 20 20 20 20 28 70 72 65 4))... (pre
4220: 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 20 20 20 20 reqs-not-met
4230: 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 (open-run-c
4240: 6c 6f 73 65 20 64 62 3a 67 65 74 2d 70 72 65 72 lose db:get-prer
4250: 65 71 73 2d 6e 6f 74 2d 6d 65 74 20 23 66 20 72 eqs-not-met #f r
4260: 75 6e 2d 69 64 20 77 61 69 74 6f 6e 73 20 69 74 un-id waitons it
4270: 65 6d 2d 70 61 74 68 20 6d 6f 64 65 3a 20 74 65 em-path mode: te
4280: 73 74 6d 6f 64 65 29 29 0a 09 09 20 20 20 20 20 stmode))...
4290: 28 66 61 69 6c 73 20 20 20 20 20 20 20 20 20 20 (fails
42a0: 20 20 20 20 20 20 20 20 20 28 72 75 6e 73 3a 63 (runs:c
42b0: 61 6c 63 2d 66 61 69 6c 73 20 70 72 65 72 65 71 alc-fails prereq
42c0: 73 2d 6e 6f 74 2d 6d 65 74 29 29 0a 09 09 20 20 s-not-met))...
42d0: 20 20 20 28 6e 6f 6e 2d 63 6f 6d 70 6c 65 74 65 (non-complete
42e0: 64 20 20 20 20 20 20 20 20 20 20 20 28 72 75 6e d (run
42f0: 73 3a 63 61 6c 63 2d 6e 6f 74 2d 63 6f 6d 70 6c s:calc-not-compl
4300: 65 74 65 64 20 70 72 65 72 65 71 73 2d 6e 6f 74 eted prereqs-not
4310: 2d 6d 65 74 29 29 29 0a 09 09 28 64 65 62 75 67 -met)))...(debug
4320: 3a 70 72 69 6e 74 20 38 20 22 49 4e 46 4f 3a 20 :print 8 "INFO:
4330: 68 61 76 65 2d 72 65 73 6f 75 72 63 65 73 3a 20 have-resources:
4340: 22 20 68 61 76 65 2d 72 65 73 6f 75 72 63 65 73 " have-resources
4350: 20 22 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d " prereqs-not-m
4360: 65 74 3a 20 22 20 0a 09 09 09 20 20 20 20 20 28 et: " .... (
4370: 73 74 72 69 6e 67 2d 69 6e 74 65 72 73 70 65 72 string-intersper
4380: 73 65 20 0a 09 09 09 20 20 20 20 20 20 28 6d 61 se .... (ma
4390: 70 20 28 6c 61 6d 62 64 61 20 28 74 29 0a 09 09 p (lambda (t)...
43a0: 09 09 20 20 20 20 20 28 69 66 20 28 76 65 63 74 .. (if (vect
43b0: 6f 72 3f 20 74 29 0a 09 09 09 09 09 20 28 63 6f or? t)...... (co
43c0: 6e 63 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d nc (db:test-get-
43d0: 73 74 61 74 65 20 74 29 20 22 2f 22 20 28 64 62 state t) "/" (db
43e0: 3a 74 65 73 74 2d 67 65 74 2d 73 74 61 74 75 73 :test-get-status
43f0: 20 74 29 29 0a 09 09 09 09 09 20 28 63 6f 6e 63 t))...... (conc
4400: 20 22 20 57 41 52 4e 49 4e 47 3a 20 74 20 69 73 " WARNING: t is
4410: 20 6e 6f 74 20 61 20 76 65 63 74 6f 72 3d 22 20 not a vector="
4420: 74 20 29 29 29 0a 09 09 09 09 20 20 20 70 72 65 t )))..... pre
4430: 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 20 22 2c reqs-not-met) ",
4440: 20 22 29 20 22 20 66 61 69 6c 73 3a 20 22 20 66 ") " fails: " f
4450: 61 69 6c 73 29 0a 09 09 28 64 65 62 75 67 3a 70 ails)...(debug:p
4460: 72 69 6e 74 20 34 20 22 49 4e 46 4f 3a 20 68 65 rint 4 "INFO: he
4470: 64 3d 22 20 68 65 64 20 22 5c 6e 20 20 74 65 73 d=" hed "\n tes
4480: 74 2d 72 65 63 6f 72 64 3d 22 20 74 65 73 74 2d t-record=" test-
4490: 72 65 63 6f 72 64 20 22 5c 6e 20 20 74 65 73 74 record "\n test
44a0: 2d 6e 61 6d 65 3a 20 22 20 74 65 73 74 2d 6e 61 -name: " test-na
44b0: 6d 65 20 22 5c 6e 20 20 69 74 65 6d 2d 70 61 74 me "\n item-pat
44c0: 68 3a 20 22 20 69 74 65 6d 2d 70 61 74 68 20 22 h: " item-path "
44d0: 5c 6e 20 20 74 65 73 74 2d 70 61 74 74 73 3a 20 \n test-patts:
44e0: 22 20 74 65 73 74 2d 70 61 74 74 73 29 0a 0a 09 " test-patts)...
44f0: 09 3b 3b 20 44 6f 6e 27 74 20 6b 6e 6f 77 20 61 .;; Don't know a
4500: 74 20 74 68 69 73 20 74 69 6d 65 20 69 66 20 74 t this time if t
4510: 68 65 20 74 65 73 74 20 68 61 76 65 20 62 65 65 he test have bee
4520: 6e 20 6c 61 75 6e 63 68 65 64 20 61 74 20 73 6f n launched at so
4530: 6d 65 20 74 69 6d 65 20 69 6e 20 74 68 65 20 70 me time in the p
4540: 61 73 74 0a 09 09 3b 3b 20 69 2e 65 2e 20 69 73 ast...;; i.e. is
4550: 20 74 68 69 73 20 61 20 72 65 2d 6c 61 75 6e 63 this a re-launc
4560: 68 3f 0a 09 09 28 64 65 62 75 67 3a 70 72 69 6e h?...(debug:prin
4570: 74 20 34 20 22 49 4e 46 4f 3a 20 72 75 6e 2d 6c t 4 "INFO: run-l
4580: 69 6d 69 74 73 2d 69 6e 66 6f 20 3d 20 22 20 72 imits-info = " r
4590: 75 6e 2d 6c 69 6d 69 74 73 2d 69 6e 66 6f 29 0a un-limits-info).
45a0: 09 09 28 63 6f 6e 64 20 3b 3b 20 49 4e 4e 45 52 ..(cond ;; INNER
45b0: 20 43 4f 4e 44 20 23 31 20 66 6f 72 20 61 20 6c COND #1 for a l
45c0: 61 75 6e 63 68 61 62 6c 65 20 74 65 73 74 0a 09 aunchable test..
45d0: 09 20 3b 3b 20 43 68 65 63 6b 20 69 74 65 6d 20 . ;; Check item
45e0: 70 61 74 68 20 61 67 61 69 6e 73 74 20 69 74 65 path against ite
45f0: 6d 2d 70 61 74 74 73 0a 09 09 20 28 28 6e 6f 74 m-patts... ((not
4600: 20 28 74 65 73 74 73 3a 6d 61 74 63 68 20 74 65 (tests:match te
4610: 73 74 2d 70 61 74 74 73 20 28 74 65 73 74 73 3a st-patts (tests:
4620: 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d 74 65 testqueue-get-te
4630: 73 74 6e 61 6d 65 20 74 65 73 74 2d 72 65 63 6f stname test-reco
4640: 72 64 29 20 69 74 65 6d 2d 70 61 74 68 29 29 20 rd) item-path))
4650: 3b 3b 20 54 68 69 73 20 74 65 73 74 2f 69 74 65 ;; This test/ite
4660: 6d 70 61 74 68 20 69 73 20 6e 6f 74 20 74 6f 20 mpath is not to
4670: 62 65 20 72 75 6e 0a 09 09 20 20 3b 3b 20 65 6c be run... ;; el
4680: 73 65 20 74 68 65 20 72 75 6e 20 69 73 20 73 74 se the run is st
4690: 75 63 6b 2c 20 74 65 6d 70 6f 72 61 72 69 6c 79 uck, temporarily
46a0: 20 6f 72 20 70 65 72 6d 61 6e 65 6e 74 6c 79 0a or permanently.
46b0: 09 09 20 20 3b 3b 20 62 75 74 20 73 68 6f 75 6c .. ;; but shoul
46c0: 64 20 63 68 65 63 6b 20 69 66 20 69 74 20 69 73 d check if it is
46d0: 20 64 75 65 20 74 6f 20 6c 61 63 6b 20 6f 66 20 due to lack of
46e0: 72 65 73 6f 75 72 63 65 73 20 76 73 2e 20 70 72 resources vs. pr
46f0: 65 72 65 71 75 69 73 69 74 65 73 0a 09 09 20 20 erequisites...
4700: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 (debug:print 1 "
4710: 49 4e 46 4f 3a 20 53 6b 69 70 70 69 6e 67 20 22 INFO: Skipping "
4720: 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 (tests:testqueu
4730: 65 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 74 e-get-testname t
4740: 65 73 74 2d 72 65 63 6f 72 64 29 20 22 20 22 20 est-record) " "
4750: 69 74 65 6d 2d 70 61 74 68 20 22 20 61 73 20 69 item-path " as i
4760: 74 20 64 6f 65 73 6e 27 74 20 6d 61 74 63 68 20 t doesn't match
4770: 22 20 74 65 73 74 2d 70 61 74 74 73 29 0a 09 09 " test-patts)...
4780: 20 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 (thread-sleep!
4790: 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 *global-delta*)
47a0: 0a 09 09 20 20 28 69 66 20 28 6e 6f 74 20 28 6e ... (if (not (n
47b0: 75 6c 6c 3f 20 74 61 6c 29 29 0a 09 09 20 20 20 ull? tal))...
47c0: 20 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 74 61 (loop (car ta
47d0: 6c 29 28 63 64 72 20 74 61 6c 29 20 72 65 72 75 l)(cdr tal) reru
47e0: 6e 73 29 29 29 0a 09 09 20 28 28 61 6e 64 20 28 ns)))... ((and (
47f0: 6e 6f 74 20 28 68 61 73 68 2d 74 61 62 6c 65 2d not (hash-table-
4800: 72 65 66 2f 64 65 66 61 75 6c 74 20 74 65 73 74 ref/default test
4810: 2d 72 65 67 69 73 74 65 72 79 20 28 72 75 6e 73 -registery (runs
4820: 3a 6d 61 6b 65 2d 66 75 6c 6c 2d 74 65 73 74 2d :make-full-test-
4830: 6e 61 6d 65 20 74 65 73 74 2d 6e 61 6d 65 20 69 name test-name i
4840: 74 65 6d 2d 70 61 74 68 29 20 23 66 29 29 0a 09 tem-path) #f))..
4850: 09 20 20 20 20 20 20 20 28 61 6e 64 20 6d 61 78 . (and max
4860: 2d 63 6f 6e 63 75 72 72 65 6e 74 2d 6a 6f 62 73 -concurrent-jobs
4870: 20 28 3e 20 28 2d 20 6d 61 78 2d 63 6f 6e 63 75 (> (- max-concu
4880: 72 72 65 6e 74 2d 6a 6f 62 73 20 6e 75 6d 2d 72 rrent-jobs num-r
4890: 75 6e 6e 69 6e 67 29 20 35 29 29 29 0a 09 09 20 unning) 5)))...
48a0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 (debug:print 4
48b0: 22 49 4e 46 4f 3a 20 50 72 65 2d 72 65 67 69 73 "INFO: Pre-regis
48c0: 74 65 72 69 6e 67 20 74 65 73 74 20 22 20 74 65 tering test " te
48d0: 73 74 2d 6e 61 6d 65 20 22 2f 22 20 69 74 65 6d st-name "/" item
48e0: 2d 70 61 74 68 20 22 20 74 6f 20 63 72 65 61 74 -path " to creat
48f0: 65 20 70 6c 61 63 65 68 6f 6c 64 65 72 22 20 29 e placeholder" )
4900: 0a 09 09 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 ... (open-run-c
4910: 6c 6f 73 65 20 64 62 3a 74 65 73 74 73 2d 72 65 lose db:tests-re
4920: 67 69 73 74 65 72 2d 74 65 73 74 20 23 66 20 72 gister-test #f r
4930: 75 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 un-id test-name
4940: 69 74 65 6d 2d 70 61 74 68 29 0a 09 09 20 20 28 item-path)... (
4950: 68 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 hash-table-set!
4960: 74 65 73 74 2d 72 65 67 69 73 74 65 72 79 20 28 test-registery (
4970: 72 75 6e 73 3a 6d 61 6b 65 2d 66 75 6c 6c 2d 74 runs:make-full-t
4980: 65 73 74 2d 6e 61 6d 65 20 74 65 73 74 2d 6e 61 est-name test-na
4990: 6d 65 20 69 74 65 6d 2d 70 61 74 68 29 20 23 74 me item-path) #t
49a0: 29 0a 09 09 20 20 28 74 68 72 65 61 64 2d 73 6c )... (thread-sl
49b0: 65 65 70 21 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c eep! *global-del
49c0: 74 61 2a 29 0a 09 09 20 20 28 6c 6f 6f 70 20 28 ta*)... (loop (
49d0: 63 61 72 20 6e 65 77 74 61 6c 29 28 63 64 72 20 car newtal)(cdr
49e0: 6e 65 77 74 61 6c 29 20 72 65 72 75 6e 73 29 29 newtal) reruns))
49f0: 0a 09 09 20 28 28 6e 6f 74 20 68 61 76 65 2d 72 ... ((not have-r
4a00: 65 73 6f 75 72 63 65 73 29 20 3b 3b 20 73 69 6d esources) ;; sim
4a10: 70 6c 79 20 74 72 79 20 61 67 61 69 6e 20 61 66 ply try again af
4a20: 74 65 72 20 77 61 69 74 69 6e 67 20 61 20 73 65 ter waiting a se
4a30: 63 6f 6e 64 0a 09 09 20 20 28 74 68 72 65 61 64 cond... (thread
4a40: 2d 73 6c 65 65 70 21 20 28 2b 20 31 20 2a 67 6c -sleep! (+ 1 *gl
4a50: 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 29 0a 09 09 obal-delta*))...
4a60: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 31 (debug:print 1
4a70: 20 22 49 4e 46 4f 3a 20 6e 6f 20 72 65 73 6f 75 "INFO: no resou
4a80: 72 63 65 73 20 74 6f 20 72 75 6e 20 6e 65 77 20 rces to run new
4a90: 74 65 73 74 73 2c 20 77 61 69 74 69 6e 67 20 2e tests, waiting .
4aa0: 2e 2e 22 29 0a 09 09 20 20 3b 3b 20 63 6f 75 6c ..")... ;; coul
4ab0: 64 20 68 61 76 65 20 64 6f 6e 65 20 68 65 64 20 d have done hed
4ac0: 74 61 6c 20 68 65 72 65 20 62 75 74 20 64 6f 69 tal here but doi
4ad0: 6e 67 20 63 61 72 2f 63 64 72 20 6f 66 20 6e 65 ng car/cdr of ne
4ae0: 77 74 61 6c 20 74 6f 20 72 6f 74 61 74 65 20 74 wtal to rotate t
4af0: 65 73 74 73 0a 09 09 20 20 28 6c 6f 6f 70 20 28 ests... (loop (
4b00: 63 61 72 20 6e 65 77 74 61 6c 29 28 63 64 72 20 car newtal)(cdr
4b10: 6e 65 77 74 61 6c 29 20 72 65 72 75 6e 73 29 29 newtal) reruns))
4b20: 0a 09 09 20 28 28 61 6e 64 20 68 61 76 65 2d 72 ... ((and have-r
4b30: 65 73 6f 75 72 63 65 73 0a 09 09 20 20 20 20 20 esources...
4b40: 20 20 28 6f 72 20 28 6e 75 6c 6c 3f 20 70 72 65 (or (null? pre
4b50: 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 0a 09 09 reqs-not-met)...
4b60: 09 20 20 20 28 61 6e 64 20 28 65 71 3f 20 74 65 . (and (eq? te
4b70: 73 74 6d 6f 64 65 20 27 74 6f 70 6c 65 76 65 6c stmode 'toplevel
4b80: 29 0a 09 09 09 09 28 6e 75 6c 6c 3f 20 6e 6f 6e ).....(null? non
4b90: 2d 63 6f 6d 70 6c 65 74 65 64 29 29 29 29 0a 09 -completed))))..
4ba0: 09 20 20 28 72 75 6e 3a 74 65 73 74 20 72 75 6e . (run:test run
4bb0: 2d 69 64 20 72 75 6e 6e 61 6d 65 20 6b 65 79 76 -id runname keyv
4bc0: 61 6c 6c 73 74 20 74 65 73 74 2d 72 65 63 6f 72 allst test-recor
4bd0: 64 20 66 6c 61 67 73 20 23 66 29 0a 09 09 20 20 d flags #f)...
4be0: 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 20 2a (thread-sleep! *
4bf0: 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 0a 09 global-delta*)..
4c00: 09 20 20 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c . (if (not (nul
4c10: 6c 3f 20 74 61 6c 29 29 0a 09 09 20 20 20 20 20 l? tal))...
4c20: 20 28 6c 6f 6f 70 20 28 63 61 72 20 74 61 6c 29 (loop (car tal)
4c30: 28 63 64 72 20 74 61 6c 29 20 72 65 72 75 6e 73 (cdr tal) reruns
4c40: 29 29 29 0a 09 09 20 28 65 6c 73 65 20 3b 3b 20 )))... (else ;;
4c50: 6d 75 73 74 20 62 65 20 77 65 20 68 61 76 65 20 must be we have
4c60: 75 6e 6d 65 74 20 70 72 65 72 65 71 75 69 73 69 unmet prerequisi
4c70: 74 65 73 0a 09 09 20 20 20 20 28 64 65 62 75 67 tes... (debug
4c80: 3a 70 72 69 6e 74 20 34 20 22 46 41 49 4c 53 3a :print 4 "FAILS:
4c90: 20 22 20 66 61 69 6c 73 29 0a 09 09 20 20 20 20 " fails)...
4ca0: 3b 3b 20 49 66 20 6f 6e 65 20 6f 72 20 6d 6f 72 ;; If one or mor
4cb0: 65 20 6f 66 20 74 68 65 20 70 72 65 72 65 71 73 e of the prereqs
4cc0: 2d 6e 6f 74 2d 6d 65 74 20 61 72 65 20 46 41 49 -not-met are FAI
4cd0: 4c 20 74 68 65 6e 20 77 65 20 63 61 6e 20 69 73 L then we can is
4ce0: 73 75 65 0a 09 09 20 20 20 20 3b 3b 20 61 20 6d sue... ;; a m
4cf0: 65 73 73 61 67 65 20 61 6e 64 20 64 72 6f 70 20 essage and drop
4d00: 68 65 64 20 66 72 6f 6d 20 74 68 65 20 69 74 65 hed from the ite
4d10: 6d 73 20 74 6f 20 62 65 20 70 72 6f 63 65 73 73 ms to be process
4d20: 65 64 2e 0a 09 09 20 20 20 20 28 69 66 20 28 6e ed.... (if (n
4d30: 75 6c 6c 3f 20 66 61 69 6c 73 29 0a 09 09 09 28 ull? fails)....(
4d40: 62 65 67 69 6e 0a 09 09 09 20 20 3b 3b 20 63 6f begin.... ;; co
4d50: 75 6c 64 6e 27 74 20 72 75 6e 2c 20 74 61 6b 65 uldn't run, take
4d60: 20 61 20 62 72 65 61 74 68 65 72 0a 09 09 09 20 a breather....
4d70: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 (debug:print 4
4d80: 22 49 4e 46 4f 3a 20 53 68 6f 75 6c 64 6e 27 74 "INFO: Shouldn't
4d90: 20 72 65 61 6c 6c 79 20 67 65 74 20 68 65 72 65 really get here
4da0: 2c 20 72 61 63 65 20 63 6f 6e 64 69 74 69 6f 6e , race condition
4db0: 3f 20 55 6e 61 62 6c 65 20 74 6f 20 6c 61 75 6e ? Unable to laun
4dc0: 63 68 20 6d 6f 72 65 20 74 65 73 74 73 20 61 74 ch more tests at
4dd0: 20 74 68 69 73 20 6d 6f 6d 65 6e 74 2c 20 6b 69 this moment, ki
4de0: 6c 6c 69 6e 67 20 74 69 6d 65 20 2e 2e 2e 22 29 lling time ...")
4df0: 0a 09 09 09 20 20 28 74 68 72 65 61 64 2d 73 6c .... (thread-sl
4e00: 65 65 70 21 20 28 2b 20 31 20 2a 67 6c 6f 62 61 eep! (+ 1 *globa
4e10: 6c 2d 64 65 6c 74 61 2a 29 29 20 3b 3b 20 6c 6f l-delta*)) ;; lo
4e20: 6e 67 20 73 6c 65 65 70 20 68 65 72 65 20 2d 20 ng sleep here -
4e30: 6e 6f 20 72 65 73 6f 75 72 63 65 73 2c 20 6d 61 no resources, ma
4e40: 79 20 61 73 20 77 65 6c 6c 20 62 65 20 70 61 74 y as well be pat
4e50: 69 65 6e 74 0a 09 09 09 20 20 3b 3b 20 77 65 20 ient.... ;; we
4e60: 6d 61 64 65 20 6e 65 77 20 74 61 6c 20 62 79 20 made new tal by
4e70: 73 74 69 63 6b 69 6e 67 20 68 65 64 20 61 74 20 sticking hed at
4e80: 74 68 65 20 62 61 63 6b 20 6f 66 20 74 68 65 20 the back of the
4e90: 6c 69 73 74 0a 09 09 09 20 20 28 6c 6f 6f 70 20 list.... (loop
4ea0: 28 63 61 72 20 6e 65 77 74 61 6c 29 28 63 64 72 (car newtal)(cdr
4eb0: 20 6e 65 77 74 61 6c 29 20 72 65 72 75 6e 73 29 newtal) reruns)
4ec0: 29 0a 09 09 09 3b 3b 20 74 68 65 20 77 61 69 74 )....;; the wait
4ed0: 6f 6e 20 69 73 20 46 41 49 4c 20 73 6f 20 6e 6f on is FAIL so no
4ee0: 20 70 6f 69 6e 74 20 69 6e 20 74 72 79 69 6e 67 point in trying
4ef0: 20 74 6f 20 72 75 6e 20 68 65 64 20 65 76 65 72 to run hed ever
4f00: 20 61 67 61 69 6e 0a 09 09 09 28 69 66 20 28 6e again....(if (n
4f10: 6f 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 29 0a ot (null? tal)).
4f20: 09 09 09 20 20 20 20 28 69 66 20 28 76 65 63 74 ... (if (vect
4f30: 6f 72 3f 20 68 65 64 29 0a 09 09 09 09 28 62 65 or? hed).....(be
4f40: 67 69 6e 20 28 64 65 62 75 67 3a 70 72 69 6e 74 gin (debug:print
4f50: 20 31 20 22 57 41 52 4e 3a 20 44 72 6f 70 70 69 1 "WARN: Droppi
4f60: 6e 67 20 74 65 73 74 20 22 20 28 64 62 3a 74 65 ng test " (db:te
4f70: 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 st-get-testname
4f80: 68 65 64 29 20 22 2f 22 20 28 64 62 3a 74 65 73 hed) "/" (db:tes
4f90: 74 2d 67 65 74 2d 69 74 65 6d 2d 70 61 74 68 20 t-get-item-path
4fa0: 68 65 64 29 0a 09 09 09 09 09 09 20 20 20 20 22 hed)....... "
4fb0: 20 66 72 6f 6d 20 74 68 65 20 6c 61 75 6e 63 68 from the launch
4fc0: 20 6c 69 73 74 20 61 73 20 69 74 20 68 61 73 20 list as it has
4fd0: 70 72 65 72 65 71 75 69 73 74 65 73 20 74 68 61 prerequistes tha
4fe0: 74 20 61 72 65 20 46 41 49 4c 22 29 0a 09 09 09 t are FAIL")....
4ff0: 09 20 20 20 20 20 20 20 28 74 68 72 65 61 64 2d . (thread-
5000: 73 6c 65 65 70 21 20 2a 67 6c 6f 62 61 6c 2d 64 sleep! *global-d
5010: 65 6c 74 61 2a 29 0a 09 09 09 09 20 20 20 20 20 elta*).....
5020: 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 74 61 6c (loop (car tal
5030: 29 28 63 64 72 20 74 61 6c 29 20 28 63 6f 6e 73 )(cdr tal) (cons
5040: 20 68 65 64 20 72 65 72 75 6e 73 29 29 29 0a 09 hed reruns)))..
5050: 09 09 09 28 62 65 67 69 6e 0a 09 09 09 09 20 20 ...(begin.....
5060: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 (debug:print 1 "
5070: 57 41 52 4e 3a 20 54 65 73 74 20 6e 6f 74 20 70 WARN: Test not p
5080: 72 6f 63 65 73 73 65 64 20 63 6f 72 72 65 63 74 rocessed correct
5090: 6c 79 2e 20 43 6f 75 6c 64 20 62 65 20 61 20 72 ly. Could be a r
50a0: 61 63 65 20 63 6f 6e 64 69 74 69 6f 6e 20 69 6e ace condition in
50b0: 20 79 6f 75 72 20 74 65 73 74 20 69 6d 70 6c 65 your test imple
50c0: 6d 65 6e 74 61 74 69 6f 6e 3f 20 22 20 68 65 64 mentation? " hed
50d0: 29 20 3b 3b 20 20 22 20 61 73 20 69 74 20 68 61 ) ;; " as it ha
50e0: 73 20 70 72 65 72 65 71 75 69 73 74 65 73 20 74 s prerequistes t
50f0: 68 61 74 20 61 72 65 20 46 41 49 4c 2e 20 28 4e hat are FAIL. (N
5100: 4f 54 45 3a 20 68 65 64 20 69 73 20 6e 6f 74 20 OTE: hed is not
5110: 61 20 76 65 63 74 6f 72 29 22 29 0a 09 09 09 09 a vector)").....
5120: 20 20 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 (thread-sleep!
5130: 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 *global-delta*)
5140: 0a 09 09 09 09 20 20 28 6c 6f 6f 70 20 68 65 64 ..... (loop hed
5150: 20 74 61 6c 20 72 65 72 75 6e 73 29 29 29 29 29 tal reruns)))))
5160: 29 29 29 29 20 3b 3b 20 45 4e 44 20 4f 46 20 49 )))) ;; END OF I
5170: 4e 4e 45 52 20 43 4f 4e 44 0a 09 20 20 20 20 20 NNER COND..
5180: 0a 09 20 20 20 20 20 3b 3b 20 63 61 73 65 20 77 .. ;; case w
5190: 68 65 72 65 20 61 6e 20 69 74 65 6d 73 20 63 61 here an items ca
51a0: 6d 65 20 69 6e 20 61 73 20 61 20 6c 69 73 74 20 me in as a list
51b0: 62 65 65 6e 20 70 72 6f 63 65 73 73 65 64 0a 09 been processed..
51c0: 20 20 20 20 20 28 28 61 6e 64 20 28 6c 69 73 74 ((and (list
51d0: 3f 20 69 74 65 6d 73 29 20 20 20 20 20 3b 3b 20 ? items) ;;
51e0: 74 68 75 73 20 77 65 20 6b 6e 6f 77 20 6f 75 72 thus we know our
51f0: 20 69 74 65 6d 73 20 61 72 65 20 61 6c 72 65 61 items are alrea
5200: 64 79 20 63 61 6c 63 75 6c 61 74 65 64 0a 09 09 dy calculated...
5210: 20 20 20 28 6e 6f 74 20 20 20 69 74 65 6d 64 61 (not itemda
5220: 74 29 29 20 3b 3b 20 61 6e 64 20 6e 6f 74 20 79 t)) ;; and not y
5230: 65 74 20 65 78 70 61 6e 64 65 64 20 69 6e 74 6f et expanded into
5240: 20 74 68 65 20 6c 69 73 74 20 6f 66 20 74 68 69 the list of thi
5250: 6e 67 73 20 74 6f 20 62 65 20 64 6f 6e 65 0a 09 ngs to be done..
5260: 20 20 20 20 20 20 28 69 66 20 28 61 6e 64 20 28 (if (and (
5270: 3e 3d 20 2a 76 65 72 62 6f 73 69 74 79 2a 20 31 >= *verbosity* 1
5280: 29 0a 09 09 20 20 20 20 20 20 20 28 3e 20 28 6c )... (> (l
5290: 65 6e 67 74 68 20 69 74 65 6d 73 29 20 30 29 0a ength items) 0).
52a0: 09 09 20 20 20 20 20 20 20 28 3e 20 28 6c 65 6e .. (> (len
52b0: 67 74 68 20 28 63 61 72 20 69 74 65 6d 73 29 29 gth (car items))
52c0: 20 30 29 29 0a 09 09 20 20 28 70 70 20 69 74 65 0))... (pp ite
52d0: 6d 73 29 29 0a 09 20 20 20 20 20 20 28 66 6f 72 ms)).. (for
52e0: 2d 65 61 63 68 0a 09 20 20 20 20 20 20 20 28 6c -each.. (l
52f0: 61 6d 62 64 61 20 28 6d 79 2d 69 74 65 6d 64 61 ambda (my-itemda
5300: 74 29 0a 09 09 20 28 6c 65 74 2a 20 28 28 6e 65 t)... (let* ((ne
5310: 77 2d 74 65 73 74 2d 72 65 63 6f 72 64 20 28 6c w-test-record (l
5320: 65 74 20 28 28 6e 65 77 72 65 63 20 28 6d 61 6b et ((newrec (mak
5330: 65 2d 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 e-tests:testqueu
5340: 65 29 29 29 0a 09 09 09 09 09 20 20 20 28 76 65 e)))...... (ve
5350: 63 74 6f 72 2d 63 6f 70 79 21 20 74 65 73 74 2d ctor-copy! test-
5360: 72 65 63 6f 72 64 20 6e 65 77 72 65 63 29 0a 09 record newrec)..
5370: 09 09 09 09 20 20 20 6e 65 77 72 65 63 29 29 0a .... newrec)).
5380: 09 09 09 28 6d 79 2d 69 74 65 6d 2d 70 61 74 68 ...(my-item-path
5390: 20 28 69 74 65 6d 2d 6c 69 73 74 2d 3e 70 61 74 (item-list->pat
53a0: 68 20 6d 79 2d 69 74 65 6d 64 61 74 29 29 29 0a h my-itemdat))).
53b0: 09 09 20 20 20 28 69 66 20 28 74 65 73 74 73 3a .. (if (tests:
53c0: 6d 61 74 63 68 20 74 65 73 74 2d 70 61 74 74 73 match test-patts
53d0: 20 68 65 64 20 6d 79 2d 69 74 65 6d 2d 70 61 74 hed my-item-pat
53e0: 68 29 20 3b 3b 20 28 70 61 74 74 2d 6c 69 73 74 h) ;; (patt-list
53f0: 2d 6d 61 74 63 68 20 6d 79 2d 69 74 65 6d 2d 70 -match my-item-p
5400: 61 74 68 20 69 74 65 6d 2d 70 61 74 74 73 29 20 ath item-patts)
5410: 20 20 20 20 20 20 20 20 20 20 3b 3b 20 79 65 73 ;; yes
5420: 2c 20 77 65 20 77 61 6e 74 20 74 6f 20 70 72 6f , we want to pro
5430: 63 65 73 73 20 74 68 69 73 20 69 74 65 6d 2c 20 cess this item,
5440: 4e 4f 54 45 3a 20 53 68 6f 75 6c 64 20 6e 6f 74 NOTE: Should not
5450: 20 6e 65 65 64 20 74 68 69 73 20 63 68 65 63 6b need this check
5460: 20 68 65 72 65 21 0a 09 09 20 20 20 20 20 20 20 here!...
5470: 28 6c 65 74 20 28 28 6e 65 77 74 65 73 74 6e 61 (let ((newtestna
5480: 6d 65 20 28 72 75 6e 73 3a 6d 61 6b 65 2d 66 75 me (runs:make-fu
5490: 6c 6c 2d 74 65 73 74 2d 6e 61 6d 65 20 68 65 64 ll-test-name hed
54a0: 20 6d 79 2d 69 74 65 6d 2d 70 61 74 68 29 29 29 my-item-path)))
54b0: 20 20 20 20 3b 3b 20 74 65 73 74 20 6e 61 6d 65 ;; test name
54c0: 73 20 61 72 65 20 75 6e 69 71 75 65 20 6f 6e 20 s are unique on
54d0: 74 65 73 74 6e 61 6d 65 2f 69 74 65 6d 2d 70 61 testname/item-pa
54e0: 74 68 0a 09 09 09 20 28 74 65 73 74 73 3a 74 65 th.... (tests:te
54f0: 73 74 71 75 65 75 65 2d 73 65 74 2d 69 74 65 6d stqueue-set-item
5500: 73 21 20 20 20 20 20 6e 65 77 2d 74 65 73 74 2d s! new-test-
5510: 72 65 63 6f 72 64 20 23 66 29 0a 09 09 09 20 28 record #f).... (
5520: 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 2d tests:testqueue-
5530: 73 65 74 2d 69 74 65 6d 64 61 74 21 20 20 20 6e set-itemdat! n
5540: 65 77 2d 74 65 73 74 2d 72 65 63 6f 72 64 20 6d ew-test-record m
5550: 79 2d 69 74 65 6d 64 61 74 29 0a 09 09 09 20 28 y-itemdat).... (
5560: 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 2d tests:testqueue-
5570: 73 65 74 2d 69 74 65 6d 5f 70 61 74 68 21 20 6e set-item_path! n
5580: 65 77 2d 74 65 73 74 2d 72 65 63 6f 72 64 20 6d ew-test-record m
5590: 79 2d 69 74 65 6d 2d 70 61 74 68 29 0a 09 09 09 y-item-path)....
55a0: 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 (hash-table-set
55b0: 21 20 74 65 73 74 2d 72 65 63 6f 72 64 73 20 6e ! test-records n
55c0: 65 77 74 65 73 74 6e 61 6d 65 20 6e 65 77 2d 74 ewtestname new-t
55d0: 65 73 74 2d 72 65 63 6f 72 64 29 0a 09 09 09 20 est-record)....
55e0: 28 73 65 74 21 20 74 61 6c 20 28 63 6f 6e 73 20 (set! tal (cons
55f0: 6e 65 77 74 65 73 74 6e 61 6d 65 20 74 61 6c 29 newtestname tal)
5600: 29 29 29 29 29 20 3b 3b 20 73 69 6e 63 65 20 74 ))))) ;; since t
5610: 68 65 73 65 20 61 72 65 20 69 74 65 6d 69 7a 65 hese are itemize
5620: 64 20 63 72 65 61 74 65 20 6e 65 77 20 74 65 73 d create new tes
5630: 74 20 6e 61 6d 65 73 20 74 65 73 74 6e 61 6d 65 t names testname
5640: 2f 69 74 65 6d 70 61 74 68 0a 09 20 20 20 20 20 /itempath..
5650: 20 20 69 74 65 6d 73 29 0a 09 20 20 20 20 20 20 items)..
5660: 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 (if (not (null?
5670: 74 61 6c 29 29 0a 09 09 20 20 28 62 65 67 69 6e tal))... (begin
5680: 0a 09 09 20 20 20 20 28 74 68 72 65 61 64 2d 73 ... (thread-s
5690: 6c 65 65 70 21 20 2a 67 6c 6f 62 61 6c 2d 64 65 leep! *global-de
56a0: 6c 74 61 2a 29 0a 09 09 20 20 20 20 28 64 65 62 lta*)... (deb
56b0: 75 67 3a 70 72 69 6e 74 20 34 20 22 49 4e 46 4f ug:print 4 "INFO
56c0: 3a 20 45 6e 64 20 6f 66 20 69 74 65 6d 73 20 6c : End of items l
56d0: 69 73 74 2c 20 6c 6f 6f 70 69 6e 67 20 77 69 74 ist, looping wit
56e0: 68 20 6e 65 78 74 22 29 0a 09 09 20 20 20 20 28 h next")... (
56f0: 6c 6f 6f 70 20 28 63 61 72 20 74 61 6c 29 28 63 loop (car tal)(c
5700: 64 72 20 74 61 6c 29 20 72 65 72 75 6e 73 29 29 dr tal) reruns))
5710: 29 29 0a 0a 09 20 20 20 20 20 3b 3b 20 69 66 20 ))... ;; if
5720: 69 74 65 6d 73 20 69 73 20 61 20 70 72 6f 63 20 items is a proc
5730: 74 68 65 6e 20 6e 65 65 64 20 74 6f 20 72 75 6e then need to run
5740: 20 69 74 65 6d 73 3a 67 65 74 2d 69 74 65 6d 73 items:get-items
5750: 2d 66 72 6f 6d 2d 63 6f 6e 66 69 67 2c 20 67 65 -from-config, ge
5760: 74 20 74 68 65 20 6c 69 73 74 20 61 6e 64 20 6c t the list and l
5770: 6f 6f 70 20 0a 09 20 20 20 20 20 3b 3b 20 20 20 oop .. ;;
5780: 20 2d 20 62 75 74 20 6f 6e 6c 79 20 64 6f 20 74 - but only do t
5790: 68 61 74 20 69 66 20 72 65 73 6f 75 72 63 65 73 hat if resources
57a0: 20 65 78 69 73 74 20 74 6f 20 6b 69 63 6b 20 6f exist to kick o
57b0: 66 66 20 74 68 65 20 6a 6f 62 0a 09 20 20 20 20 ff the job..
57c0: 20 28 28 6f 72 20 28 70 72 6f 63 65 64 75 72 65 ((or (procedure
57d0: 3f 20 69 74 65 6d 73 29 28 65 71 3f 20 69 74 65 ? items)(eq? ite
57e0: 6d 73 20 27 68 61 76 65 2d 70 72 6f 63 65 64 75 ms 'have-procedu
57f0: 72 65 29 29 0a 09 20 20 20 20 20 20 28 6c 65 74 re)).. (let
5800: 20 28 28 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 20 ((can-run-more
5810: 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f (open-run-clo
5820: 73 65 20 72 75 6e 73 3a 63 61 6e 2d 72 75 6e 2d se runs:can-run-
5830: 6d 6f 72 65 2d 74 65 73 74 73 20 23 66 20 74 65 more-tests #f te
5840: 73 74 2d 72 65 63 6f 72 64 29 29 29 0a 09 09 28 st-record)))...(
5850: 69 66 20 63 61 6e 2d 72 75 6e 2d 6d 6f 72 65 0a if can-run-more.
5860: 09 09 20 20 20 20 28 6c 65 74 2a 20 28 28 70 72 .. (let* ((pr
5870: 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 20 28 6f ereqs-not-met (o
5880: 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 pen-run-close db
5890: 3a 67 65 74 2d 70 72 65 72 65 71 73 2d 6e 6f 74 :get-prereqs-not
58a0: 2d 6d 65 74 20 23 66 20 72 75 6e 2d 69 64 20 77 -met #f run-id w
58b0: 61 69 74 6f 6e 73 20 69 74 65 6d 2d 70 61 74 68 aitons item-path
58c0: 20 6d 6f 64 65 3a 20 74 65 73 74 6d 6f 64 65 29 mode: testmode)
58d0: 29 0a 09 09 09 20 20 20 28 66 61 69 6c 73 20 20 ).... (fails
58e0: 20 20 20 20 20 20 20 20 20 28 72 75 6e 73 3a 63 (runs:c
58f0: 61 6c 63 2d 66 61 69 6c 73 20 70 72 65 72 65 71 alc-fails prereq
5900: 73 2d 6e 6f 74 2d 6d 65 74 29 29 0a 09 09 09 20 s-not-met))....
5910: 20 20 28 6e 6f 6e 2d 63 6f 6d 70 6c 65 74 65 64 (non-completed
5920: 20 20 20 28 72 75 6e 73 3a 63 61 6c 63 2d 6e 6f (runs:calc-no
5930: 74 2d 63 6f 6d 70 6c 65 74 65 64 20 70 72 65 72 t-completed prer
5940: 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 29 29 0a 09 eqs-not-met)))..
5950: 09 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 . (debug:pr
5960: 69 6e 74 20 38 20 22 49 4e 46 4f 3a 20 63 61 6e int 8 "INFO: can
5970: 2d 72 75 6e 2d 6d 6f 72 65 3a 20 22 20 63 61 6e -run-more: " can
5980: 2d 72 75 6e 2d 6d 6f 72 65 0a 09 09 09 09 20 20 -run-more.....
5990: 20 22 5c 6e 20 74 65 73 74 6e 61 6d 65 3a 20 20 "\n testname:
59a0: 20 20 20 20 20 20 22 20 68 65 64 0a 09 09 09 09 " hed.....
59b0: 20 20 20 22 5c 6e 20 70 72 65 72 65 71 73 2d 6e "\n prereqs-n
59c0: 6f 74 2d 6d 65 74 3a 20 22 20 28 72 75 6e 73 3a ot-met: " (runs:
59d0: 70 72 65 74 74 79 2d 73 74 72 69 6e 67 20 70 72 pretty-string pr
59e0: 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 74 29 0a 09 ereqs-not-met)..
59f0: 09 09 09 20 20 20 22 5c 6e 20 6e 6f 6e 2d 63 6f ... "\n non-co
5a00: 6d 70 6c 65 74 65 64 3a 20 20 20 22 20 28 72 75 mpleted: " (ru
5a10: 6e 73 3a 70 72 65 74 74 79 2d 73 74 72 69 6e 67 ns:pretty-string
5a20: 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 74 65 64 29 20 non-completed)
5a30: 0a 09 09 09 09 20 20 20 22 5c 6e 20 66 61 69 6c ..... "\n fail
5a40: 73 3a 20 20 20 20 20 20 20 20 20 20 20 22 20 28 s: " (
5a50: 72 75 6e 73 3a 70 72 65 74 74 79 2d 73 74 72 69 runs:pretty-stri
5a60: 6e 67 20 66 61 69 6c 73 29 0a 09 09 09 09 20 20 ng fails).....
5a70: 20 22 5c 6e 20 74 65 73 74 6d 6f 64 65 3a 20 20 "\n testmode:
5a80: 20 20 20 20 20 20 22 20 74 65 73 74 6d 6f 64 65 " testmode
5a90: 0a 09 09 09 09 20 20 20 22 5c 6e 20 6e 75 6d 2d ..... "\n num-
5aa0: 72 65 74 72 69 65 73 3a 20 20 20 20 20 22 20 6e retries: " n
5ab0: 75 6d 2d 72 65 74 72 69 65 73 0a 09 09 09 09 20 um-retries.....
5ac0: 20 20 22 5c 6e 20 28 65 71 3f 20 74 65 73 74 6d "\n (eq? testm
5ad0: 6f 64 65 20 27 74 6f 70 6c 65 76 65 6c 29 3a 20 ode 'toplevel):
5ae0: 22 20 28 65 71 3f 20 74 65 73 74 6d 6f 64 65 20 " (eq? testmode
5af0: 27 74 6f 70 6c 65 76 65 6c 29 0a 09 09 09 09 20 'toplevel).....
5b00: 20 20 22 5c 6e 20 28 6e 75 6c 6c 3f 20 6e 6f 6e "\n (null? non
5b10: 2d 63 6f 6d 70 6c 65 74 65 64 29 3a 20 20 20 20 -completed):
5b20: 22 20 28 6e 75 6c 6c 3f 20 6e 6f 6e 2d 63 6f 6d " (null? non-com
5b30: 70 6c 65 74 65 64 29 0a 09 09 09 09 20 20 20 22 pleted)..... "
5b40: 5c 6e 20 72 65 72 75 6e 73 3a 20 20 20 20 20 20 \n reruns:
5b50: 20 20 20 20 22 20 72 65 72 75 6e 73 0a 09 09 09 " reruns....
5b60: 09 20 20 20 22 5c 6e 20 69 74 65 6d 73 3a 20 20 . "\n items:
5b70: 20 20 20 20 20 20 20 20 20 22 20 69 74 65 6d 73 " items
5b80: 0a 09 09 09 09 20 20 20 22 5c 6e 20 63 61 6e 2d ..... "\n can-
5b90: 72 75 6e 2d 6d 6f 72 65 3a 20 20 20 20 22 20 63 run-more: " c
5ba0: 61 6e 2d 72 75 6e 2d 6d 6f 72 65 29 0a 0a 09 09 an-run-more)....
5bb0: 20 20 20 20 20 20 28 63 6f 6e 64 20 3b 3b 20 49 (cond ;; I
5bc0: 4e 4e 45 52 20 43 4f 4e 44 20 23 32 0a 09 09 20 NNER COND #2...
5bd0: 20 20 20 20 20 20 28 28 6f 72 20 28 6e 75 6c 6c ((or (null
5be0: 3f 20 70 72 65 72 65 71 73 2d 6e 6f 74 2d 6d 65 ? prereqs-not-me
5bf0: 74 29 20 3b 3b 20 61 6c 6c 20 70 72 65 72 65 71 t) ;; all prereq
5c00: 73 20 6d 65 74 2c 20 66 69 72 65 20 6f 66 66 20 s met, fire off
5c10: 74 68 65 20 74 65 73 74 0a 09 09 09 20 20 20 20 the test....
5c20: 3b 3b 20 6f 72 2c 20 69 66 20 69 74 20 69 73 20 ;; or, if it is
5c30: 61 20 27 74 6f 70 6c 65 76 65 6c 20 74 65 73 74 a 'toplevel test
5c40: 20 61 6e 64 20 61 6c 6c 20 70 72 65 72 65 71 73 and all prereqs
5c50: 20 6e 6f 74 20 6d 65 74 20 61 72 65 20 43 4f 4d not met are COM
5c60: 50 4c 45 54 45 44 20 74 68 65 6e 20 6c 61 75 6e PLETED then laun
5c70: 63 68 0a 09 09 09 20 20 20 20 28 61 6e 64 20 28 ch.... (and (
5c80: 65 71 3f 20 74 65 73 74 6d 6f 64 65 20 27 74 6f eq? testmode 'to
5c90: 70 6c 65 76 65 6c 29 0a 09 09 09 09 20 28 6e 75 plevel)..... (nu
5ca0: 6c 6c 3f 20 6e 6f 6e 2d 63 6f 6d 70 6c 65 74 65 ll? non-complete
5cb0: 64 29 29 29 0a 09 09 09 28 6c 65 74 20 28 28 74 d)))....(let ((t
5cc0: 65 73 74 2d 6e 61 6d 65 20 28 74 65 73 74 73 3a est-name (tests:
5cd0: 74 65 73 74 71 75 65 75 65 2d 67 65 74 2d 74 65 testqueue-get-te
5ce0: 73 74 6e 61 6d 65 20 74 65 73 74 2d 72 65 63 6f stname test-reco
5cf0: 72 64 29 29 29 0a 09 09 09 20 20 28 73 65 74 65 rd))).... (sete
5d00: 6e 76 20 22 4d 54 5f 54 45 53 54 5f 4e 41 4d 45 nv "MT_TEST_NAME
5d10: 22 20 74 65 73 74 2d 6e 61 6d 65 29 20 3b 3b 20 " test-name) ;;
5d20: 0a 09 09 09 20 20 28 73 65 74 65 6e 76 20 22 4d .... (setenv "M
5d30: 54 5f 52 55 4e 4e 41 4d 45 22 20 20 20 72 75 6e T_RUNNAME" run
5d40: 6e 61 6d 65 29 0a 09 09 09 20 20 28 6f 70 65 6e name).... (open
5d50: 2d 72 75 6e 2d 63 6c 6f 73 65 20 73 65 74 2d 6d -run-close set-m
5d60: 65 67 61 74 65 73 74 2d 65 6e 76 2d 76 61 72 73 egatest-env-vars
5d70: 20 23 66 20 72 75 6e 2d 69 64 29 20 3b 3b 20 74 #f run-id) ;; t
5d80: 68 65 73 65 20 6d 61 79 20 62 65 20 6e 65 65 64 hese may be need
5d90: 65 64 20 62 79 20 74 68 65 20 6c 61 75 6e 63 68 ed by the launch
5da0: 69 6e 67 20 70 72 6f 63 65 73 73 0a 09 09 09 20 ing process....
5db0: 20 28 6c 65 74 20 28 28 69 74 65 6d 73 2d 6c 69 (let ((items-li
5dc0: 73 74 20 28 69 74 65 6d 73 3a 67 65 74 2d 69 74 st (items:get-it
5dd0: 65 6d 73 2d 66 72 6f 6d 2d 63 6f 6e 66 69 67 20 ems-from-config
5de0: 74 63 6f 6e 66 69 67 29 29 29 0a 09 09 09 20 20 tconfig)))....
5df0: 20 20 28 69 66 20 28 6c 69 73 74 3f 20 69 74 65 (if (list? ite
5e00: 6d 73 2d 6c 69 73 74 29 0a 09 09 09 09 28 62 65 ms-list).....(be
5e10: 67 69 6e 0a 09 09 09 09 20 20 28 74 65 73 74 73 gin..... (tests
5e20: 3a 74 65 73 74 71 75 65 75 65 2d 73 65 74 2d 69 :testqueue-set-i
5e30: 74 65 6d 73 21 20 74 65 73 74 2d 72 65 63 6f 72 tems! test-recor
5e40: 64 20 69 74 65 6d 73 2d 6c 69 73 74 29 0a 09 09 d items-list)...
5e50: 09 09 20 20 28 74 68 72 65 61 64 2d 73 6c 65 65 .. (thread-slee
5e60: 70 21 20 2a 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 p! *global-delta
5e70: 2a 29 0a 09 09 09 09 20 20 28 6c 6f 6f 70 20 68 *)..... (loop h
5e80: 65 64 20 74 61 6c 20 72 65 72 75 6e 73 29 29 0a ed tal reruns)).
5e90: 09 09 09 09 28 62 65 67 69 6e 0a 09 09 09 09 20 ....(begin.....
5ea0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 (debug:print 0
5eb0: 22 45 52 52 4f 52 3a 20 54 68 65 20 70 72 6f 63 "ERROR: The proc
5ec0: 20 66 72 6f 6d 20 72 65 61 64 69 6e 67 20 74 68 from reading th
5ed0: 65 20 73 65 74 75 70 20 64 69 64 20 6e 6f 74 20 e setup did not
5ee0: 79 69 65 6c 64 20 61 20 6c 69 73 74 20 2d 20 70 yield a list - p
5ef0: 6c 65 61 73 65 20 72 65 70 6f 72 74 20 74 68 69 lease report thi
5f00: 73 22 29 0a 09 09 09 09 20 20 28 65 78 69 74 20 s")..... (exit
5f10: 31 29 29 29 29 29 29 0a 09 09 20 20 20 20 20 20 1))))))...
5f20: 20 28 28 6e 75 6c 6c 3f 20 66 61 69 6c 73 29 0a ((null? fails).
5f30: 09 09 09 28 64 65 62 75 67 3a 70 72 69 6e 74 20 ...(debug:print
5f40: 34 20 22 49 4e 46 4f 3a 20 66 61 69 6c 73 20 69 4 "INFO: fails i
5f50: 73 20 6e 75 6c 6c 2c 20 6d 6f 76 69 6e 67 20 6f s null, moving o
5f60: 6e 20 69 6e 20 74 68 65 20 71 75 65 75 65 20 62 n in the queue b
5f70: 75 74 20 6b 65 65 70 69 6e 67 20 22 20 68 65 64 ut keeping " hed
5f80: 20 22 20 66 6f 72 20 6e 6f 77 22 29 0a 09 09 09 " for now")....
5f90: 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 20 2a (thread-sleep! *
5fa0: 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 0a 09 global-delta*)..
5fb0: 09 09 3b 3b 20 6f 6e 6c 79 20 69 6e 63 72 65 6d ..;; only increm
5fc0: 65 6e 74 20 6e 75 6d 2d 72 65 74 72 69 65 73 20 ent num-retries
5fd0: 77 68 65 6e 20 74 68 65 72 65 20 61 72 65 20 6e when there are n
5fe0: 6f 20 74 65 73 74 73 20 72 75 6e 69 6e 67 0a 09 o tests runing..
5ff0: 09 09 28 69 66 20 28 65 71 3f 20 30 20 28 6c 69 ..(if (eq? 0 (li
6000: 73 74 2d 72 65 66 20 63 61 6e 2d 72 75 6e 2d 6d st-ref can-run-m
6010: 6f 72 65 20 31 29 29 0a 09 09 09 20 20 20 20 28 ore 1)).... (
6020: 73 65 74 21 20 6e 75 6d 2d 72 65 74 72 69 65 73 set! num-retries
6030: 20 28 2b 20 6e 75 6d 2d 72 65 74 72 69 65 73 20 (+ num-retries
6040: 31 29 29 29 0a 09 09 09 28 69 66 20 28 3e 20 6e 1)))....(if (> n
6050: 75 6d 2d 72 65 74 72 69 65 73 20 20 6d 61 78 2d um-retries max-
6060: 72 65 74 72 69 65 73 29 0a 09 09 09 20 20 20 20 retries)....
6070: 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 (if (not (null?
6080: 74 61 6c 29 29 0a 09 09 09 09 28 6c 6f 6f 70 20 tal)).....(loop
6090: 28 63 61 72 20 74 61 6c 29 28 63 64 72 20 74 61 (car tal)(cdr ta
60a0: 6c 29 20 72 65 72 75 6e 73 29 29 0a 09 09 09 20 l) reruns))....
60b0: 20 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 (loop (car ne
60c0: 77 74 61 6c 29 28 63 64 72 20 6e 65 77 74 61 6c wtal)(cdr newtal
60d0: 29 20 72 65 72 75 6e 73 29 29 29 20 3b 3b 20 61 ) reruns))) ;; a
60e0: 6e 20 69 73 73 75 65 20 77 69 74 68 20 70 72 65 n issue with pre
60f0: 72 65 71 73 20 6e 6f 74 20 79 65 74 20 6d 65 74 reqs not yet met
6100: 3f 0a 09 09 20 20 20 20 20 20 20 28 28 61 6e 64 ?... ((and
6110: 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 66 61 69 (not (null? fai
6120: 6c 73 29 29 28 65 71 3f 20 74 65 73 74 6d 6f 64 ls))(eq? testmod
6130: 65 20 27 6e 6f 72 6d 61 6c 29 29 0a 09 09 09 28 e 'normal))....(
6140: 64 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 49 debug:print 1 "I
6150: 4e 46 4f 3a 20 74 65 73 74 20 22 20 20 68 65 64 NFO: test " hed
6160: 20 22 20 28 6d 6f 64 65 3d 22 20 74 65 73 74 6d " (mode=" testm
6170: 6f 64 65 20 22 29 20 68 61 73 20 66 61 69 6c 65 ode ") has faile
6180: 64 20 70 72 65 72 65 71 75 69 73 69 74 65 28 73 d prerequisite(s
6190: 29 3b 20 22 0a 09 09 09 09 20 20 20 20 20 28 73 ); "..... (s
61a0: 74 72 69 6e 67 2d 69 6e 74 65 72 73 70 65 72 73 tring-interspers
61b0: 65 20 28 6d 61 70 20 28 6c 61 6d 62 64 61 20 28 e (map (lambda (
61c0: 74 29 28 63 6f 6e 63 20 28 64 62 3a 74 65 73 74 t)(conc (db:test
61d0: 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 74 29 -get-testname t)
61e0: 20 22 3a 22 20 28 64 62 3a 74 65 73 74 2d 67 65 ":" (db:test-ge
61f0: 74 2d 73 74 61 74 65 20 74 29 22 2f 22 28 64 62 t-state t)"/"(db
6200: 3a 74 65 73 74 2d 67 65 74 2d 73 74 61 74 75 73 :test-get-status
6210: 20 74 29 29 29 20 66 61 69 6c 73 29 20 22 2c 20 t))) fails) ",
6220: 22 29 0a 09 09 09 09 20 20 20 20 20 22 2c 20 72 ")..... ", r
6230: 65 6d 6f 76 69 6e 67 20 69 74 20 66 72 6f 6d 20 emoving it from
6240: 74 6f 2d 64 6f 20 6c 69 73 74 22 29 0a 09 09 09 to-do list")....
6250: 28 69 66 20 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 (if (not (null?
6260: 74 61 6c 29 29 0a 09 09 09 20 20 20 20 28 62 65 tal)).... (be
6270: 67 69 6e 0a 09 09 09 20 20 20 20 20 20 28 74 68 gin.... (th
6280: 72 65 61 64 2d 73 6c 65 65 70 21 20 2a 67 6c 6f read-sleep! *glo
6290: 62 61 6c 2d 64 65 6c 74 61 2a 29 0a 09 09 09 20 bal-delta*)....
62a0: 20 20 20 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 (loop (car
62b0: 74 61 6c 29 28 63 64 72 20 74 61 6c 29 28 63 6f tal)(cdr tal)(co
62c0: 6e 73 20 68 65 64 20 72 65 72 75 6e 73 29 29 29 ns hed reruns)))
62d0: 29 29 0a 09 09 20 20 20 20 20 20 20 28 65 6c 73 ))... (els
62e0: 65 0a 09 09 09 28 64 65 62 75 67 3a 70 72 69 6e e....(debug:prin
62f0: 74 20 38 20 22 45 52 52 4f 52 3a 20 4e 6f 20 68 t 8 "ERROR: No h
6300: 61 6e 64 6c 65 72 20 66 6f 72 20 74 68 69 73 20 andler for this
6310: 63 6f 6e 64 69 74 69 6f 6e 2e 22 29 0a 09 09 09 condition.")....
6320: 28 74 68 72 65 61 64 2d 73 6c 65 65 70 21 20 2a (thread-sleep! *
6330: 67 6c 6f 62 61 6c 2d 64 65 6c 74 61 2a 29 0a 09 global-delta*)..
6340: 09 09 28 6c 6f 6f 70 20 28 63 61 72 20 6e 65 77 ..(loop (car new
6350: 74 61 6c 29 28 63 64 72 20 6e 65 77 74 61 6c 29 tal)(cdr newtal)
6360: 20 72 65 72 75 6e 73 29 29 29 29 20 3b 3b 20 45 reruns)))) ;; E
6370: 4e 44 20 4f 46 20 49 46 20 43 41 4e 20 52 55 4e ND OF IF CAN RUN
6380: 20 4d 4f 52 45 0a 0a 09 09 20 20 20 20 3b 3b 20 MORE.... ;;
6390: 69 66 20 63 61 6e 27 74 20 72 75 6e 20 6d 6f 72 if can't run mor
63a0: 65 20 6a 75 73 74 20 6c 6f 6f 70 20 77 69 74 68 e just loop with
63b0: 20 6e 65 78 74 20 70 6f 73 73 69 62 6c 65 20 74 next possible t
63c0: 65 73 74 0a 09 09 20 20 20 20 28 62 65 67 69 6e est... (begin
63d0: 0a 09 09 20 20 20 20 20 20 28 64 65 62 75 67 3a ... (debug:
63e0: 70 72 69 6e 74 20 34 20 22 49 4e 46 4f 3a 20 70 print 4 "INFO: p
63f0: 72 6f 63 65 73 73 69 6e 67 20 74 68 65 20 63 61 rocessing the ca
6400: 73 65 20 77 69 74 68 20 61 20 6c 61 6d 62 64 61 se with a lambda
6410: 20 66 6f 72 20 69 74 65 6d 73 20 6f 72 20 27 68 for items or 'h
6420: 61 76 65 2d 70 72 6f 63 65 64 75 72 65 2e 20 4d ave-procedure. M
6430: 6f 76 69 6e 67 20 74 68 72 6f 75 67 68 20 74 68 oving through th
6440: 65 20 71 75 65 75 65 20 77 69 74 68 6f 75 74 20 e queue without
6450: 64 72 6f 70 70 69 6e 67 20 22 20 68 65 64 29 0a dropping " hed).
6460: 09 09 20 20 20 20 20 20 28 74 68 72 65 61 64 2d .. (thread-
6470: 73 6c 65 65 70 21 20 28 2b 20 31 20 2a 67 6c 6f sleep! (+ 1 *glo
6480: 62 61 6c 2d 64 65 6c 74 61 2a 29 29 0a 09 09 20 bal-delta*))...
6490: 20 20 20 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 (loop (car
64a0: 6e 65 77 74 61 6c 29 28 63 64 72 20 6e 65 77 74 newtal)(cdr newt
64b0: 61 6c 29 20 72 65 72 75 6e 73 29 29 29 29 29 20 al) reruns)))))
64c0: 3b 3b 20 45 4e 44 20 4f 46 20 28 6f 72 20 28 70 ;; END OF (or (p
64d0: 72 6f 63 65 64 75 72 65 3f 20 69 74 65 6d 73 29 rocedure? items)
64e0: 28 65 71 3f 20 69 74 65 6d 73 20 27 68 61 76 65 (eq? items 'have
64f0: 2d 70 72 6f 63 65 64 75 72 65 29 29 0a 09 20 20 -procedure))..
6500: 20 20 20 0a 09 20 20 20 20 20 3b 3b 20 74 68 69 .. ;; thi
6510: 73 20 63 61 73 65 20 73 68 6f 75 6c 64 20 6e 6f s case should no
6520: 74 20 68 61 70 70 65 6e 2c 20 61 64 64 65 64 20 t happen, added
6530: 74 6f 20 68 65 6c 70 20 63 61 74 63 68 20 61 6e to help catch an
6540: 79 20 62 75 67 73 0a 09 20 20 20 20 20 28 28 61 y bugs.. ((a
6550: 6e 64 20 28 6c 69 73 74 3f 20 69 74 65 6d 73 29 nd (list? items)
6560: 20 69 74 65 6d 64 61 74 29 0a 09 20 20 20 20 20 itemdat)..
6570: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 (debug:print 0
6580: 22 45 52 52 4f 52 3a 20 53 68 6f 75 6c 64 20 6e "ERROR: Should n
6590: 6f 74 20 68 61 76 65 20 61 20 6c 69 73 74 20 6f ot have a list o
65a0: 66 20 69 74 65 6d 73 20 69 6e 20 61 20 74 65 73 f items in a tes
65b0: 74 20 61 6e 64 20 74 68 65 20 69 74 65 6d 73 70 t and the itemsp
65c0: 61 74 68 20 73 65 74 20 2d 20 70 6c 65 61 73 65 ath set - please
65d0: 20 72 65 70 6f 72 74 20 74 68 69 73 22 29 0a 09 report this")..
65e0: 20 20 20 20 20 20 28 65 78 69 74 20 31 29 29 0a (exit 1)).
65f0: 09 20 20 20 20 20 28 28 6e 6f 74 20 28 6e 75 6c . ((not (nul
6600: 6c 3f 20 72 65 72 75 6e 73 29 29 0a 09 20 20 20 l? reruns))..
6610: 20 20 20 28 6c 65 74 2a 20 28 28 6e 65 77 6c 73 (let* ((newls
6620: 74 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 t (open-run-clos
6630: 65 20 74 65 73 74 73 3a 66 69 6c 74 65 72 2d 6e e tests:filter-n
6640: 6f 6e 2d 72 75 6e 6e 61 62 6c 65 20 23 66 20 72 on-runnable #f r
6650: 75 6e 2d 69 64 20 74 61 6c 20 74 65 73 74 2d 72 un-id tal test-r
6660: 65 63 6f 72 64 73 29 29 20 3b 3b 20 69 2e 65 2e ecords)) ;; i.e.
6670: 20 6e 6f 74 20 46 41 49 4c 2c 20 57 41 49 56 45 not FAIL, WAIVE
6680: 44 2c 20 49 4e 43 4f 4d 50 4c 45 54 45 2c 20 50 D, INCOMPLETE, P
6690: 41 53 53 2c 20 4b 49 4c 4c 45 44 2c 0a 09 09 20 ASS, KILLED,...
66a0: 20 20 20 20 28 6a 75 6e 6b 65 64 20 28 6c 73 65 (junked (lse
66b0: 74 2d 64 69 66 66 65 72 65 6e 63 65 20 65 71 75 t-difference equ
66c0: 61 6c 3f 20 74 61 6c 20 6e 65 77 6c 73 74 29 29 al? tal newlst))
66d0: 29 0a 09 09 28 64 65 62 75 67 3a 70 72 69 6e 74 )...(debug:print
66e0: 20 34 20 22 49 4e 46 4f 3a 20 66 75 6c 6c 20 64 4 "INFO: full d
66f0: 72 6f 70 20 74 68 72 6f 75 67 68 2c 20 69 66 20 rop through, if
6700: 72 65 72 75 6e 73 20 69 73 20 6c 65 73 73 20 74 reruns is less t
6710: 68 61 6e 20 31 30 30 20 77 65 20 77 69 6c 6c 20 han 100 we will
6720: 66 6f 72 63 65 20 72 65 74 72 79 20 74 68 65 6d force retry them
6730: 2c 20 72 65 72 75 6e 73 3d 22 20 72 65 72 75 6e , reruns=" rerun
6740: 73 20 22 2c 20 74 61 6c 3d 22 20 74 61 6c 29 0a s ", tal=" tal).
6750: 09 09 28 69 66 20 28 3c 20 6e 75 6d 2d 72 65 74 ..(if (< num-ret
6760: 72 69 65 73 20 6d 61 78 2d 72 65 74 72 69 65 73 ries max-retries
6770: 29 0a 09 09 20 20 20 20 28 73 65 74 21 20 6e 65 )... (set! ne
6780: 77 6c 73 74 20 28 61 70 70 65 6e 64 20 72 65 72 wlst (append rer
6790: 75 6e 73 20 6e 65 77 6c 73 74 29 29 29 0a 09 09 uns newlst)))...
67a0: 28 73 65 74 21 20 6e 75 6d 2d 72 65 74 72 69 65 (set! num-retrie
67b0: 73 20 28 2b 20 6e 75 6d 2d 72 65 74 72 69 65 73 s (+ num-retries
67c0: 20 31 29 29 0a 09 09 28 74 68 72 65 61 64 2d 73 1))...(thread-s
67d0: 6c 65 65 70 21 20 2a 67 6c 6f 62 61 6c 2d 64 65 leep! *global-de
67e0: 6c 74 61 2a 29 0a 09 09 28 69 66 20 28 6e 6f 74 lta*)...(if (not
67f0: 20 28 6e 75 6c 6c 3f 20 6e 65 77 6c 73 74 29 29 (null? newlst))
6800: 0a 09 09 20 20 20 20 3b 3b 20 73 69 6e 63 65 20 ... ;; since
6810: 72 65 72 75 6e 73 20 68 61 76 65 20 62 65 65 6e reruns have been
6820: 20 74 61 63 6b 65 64 20 6f 6e 20 74 6f 20 6e 65 tacked on to ne
6830: 77 6c 73 74 20 63 72 65 61 74 65 20 6e 65 77 20 wlst create new
6840: 72 65 72 75 6e 73 20 66 72 6f 6d 20 6a 75 6e 6b reruns from junk
6850: 65 64 0a 09 09 20 20 20 20 28 6c 6f 6f 70 20 28 ed... (loop (
6860: 63 61 72 20 6e 65 77 6c 73 74 29 28 63 64 72 20 car newlst)(cdr
6870: 6e 65 77 6c 73 74 29 28 64 65 6c 65 74 65 2d 64 newlst)(delete-d
6880: 75 70 6c 69 63 61 74 65 73 20 6a 75 6e 6b 65 64 uplicates junked
6890: 29 29 29 29 29 0a 09 20 20 20 20 20 28 28 6e 6f ))))).. ((no
68a0: 74 20 28 6e 75 6c 6c 3f 20 74 61 6c 29 29 0a 09 t (null? tal))..
68b0: 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 (debug:pri
68c0: 6e 74 20 34 20 22 49 4e 46 4f 3a 20 49 27 6d 20 nt 4 "INFO: I'm
68d0: 70 72 65 74 74 79 20 73 75 72 65 20 49 20 73 68 pretty sure I sh
68e0: 6f 75 6c 64 6e 27 74 20 67 65 74 20 68 65 72 65 ouldn't get here
68f0: 2e 22 29 29 0a 09 20 20 20 20 20 28 65 6c 73 65 .")).. (else
6900: 0a 09 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 .. (debug:p
6910: 72 69 6e 74 20 34 20 22 49 4e 46 4f 3a 20 45 78 rint 4 "INFO: Ex
6920: 69 74 69 6e 67 20 6c 6f 6f 70 20 77 69 74 68 2e iting loop with.
6930: 2e 2e 5c 6e 20 20 68 65 64 3d 22 20 68 65 64 20 ..\n hed=" hed
6940: 22 5c 6e 20 20 74 61 6c 3d 22 20 74 61 6c 20 22 "\n tal=" tal "
6950: 5c 6e 20 20 72 65 72 75 6e 73 3d 22 20 72 65 72 \n reruns=" rer
6960: 75 6e 73 29 29 0a 09 20 20 20 20 20 29 29 29 29 uns)).. ))))
6970: 20 3b 3b 20 4c 45 54 2a 20 28 28 74 65 73 74 2d ;; LET* ((test-
6980: 72 65 63 6f 72 64 0a 0a 20 20 20 20 3b 3b 20 77 record.. ;; w
6990: 65 20 67 65 74 20 68 65 72 65 20 6f 6e 20 22 64 e get here on "d
69a0: 72 6f 70 20 74 68 72 6f 75 67 68 22 20 2d 20 6c rop through" - l
69b0: 6f 6f 70 20 66 6f 72 20 6e 65 78 74 20 74 65 73 oop for next tes
69c0: 74 20 69 6e 20 71 75 65 75 65 0a 20 20 20 20 3b t in queue. ;
69d0: 3b 20 46 49 58 4d 45 21 21 21 21 20 54 48 49 53 ; FIXME!!!! THIS
69e0: 20 53 48 4f 55 4c 44 20 4e 4f 54 20 52 45 51 55 SHOULD NOT REQU
69f0: 49 52 45 20 41 4e 20 45 58 49 54 21 21 21 21 21 IRE AN EXIT!!!!!
6a00: 21 21 0a 20 20 20 20 0a 20 20 20 20 28 64 65 62 !!. . (deb
6a10: 75 67 3a 70 72 69 6e 74 20 31 20 22 49 4e 46 4f ug:print 1 "INFO
6a20: 3a 20 41 6c 6c 20 74 65 73 74 73 20 6c 61 75 6e : All tests laun
6a30: 63 68 65 64 22 29 0a 20 20 20 20 28 74 68 72 65 ched"). (thre
6a40: 61 64 2d 73 6c 65 65 70 21 20 30 2e 35 29 0a 20 ad-sleep! 0.5).
6a50: 20 20 20 3b 3b 20 46 49 58 4d 45 21 20 54 68 69 ;; FIXME! Thi
6a60: 73 20 68 61 72 73 68 20 65 78 69 74 20 73 68 6f s harsh exit sho
6a70: 75 6c 64 20 6e 6f 74 20 62 65 20 6e 65 63 65 73 uld not be neces
6a80: 73 61 72 79 2e 2e 2e 2e 0a 20 20 20 20 3b 3b 20 sary..... ;;
6a90: 28 69 66 20 28 6e 6f 74 20 2a 72 75 6e 72 65 6d (if (not *runrem
6aa0: 6f 74 65 2a 29 28 65 78 69 74 29 29 20 3b 3b 20 ote*)(exit)) ;;
6ab0: 0a 20 20 20 20 23 66 29 29 20 3b 3b 20 72 65 74 . #f)) ;; ret
6ac0: 75 72 6e 20 61 20 23 66 20 61 73 20 61 20 68 69 urn a #f as a hi
6ad0: 6e 74 20 74 68 61 74 20 77 65 20 61 72 65 20 64 nt that we are d
6ae0: 6f 6e 65 0a 20 20 3b 3b 20 48 65 72 65 20 77 65 one. ;; Here we
6af0: 20 6e 65 65 64 20 74 6f 20 63 68 65 63 6b 20 74 need to check t
6b00: 68 61 74 20 61 6c 6c 20 74 68 65 20 74 65 73 74 hat all the test
6b10: 73 20 72 65 6d 61 69 6e 69 6e 67 20 74 6f 20 62 s remaining to b
6b20: 65 20 72 75 6e 20 61 72 65 20 65 6c 69 67 69 62 e run are eligib
6b30: 6c 65 20 74 6f 20 72 75 6e 0a 20 20 3b 3b 20 61 le to run. ;; a
6b40: 6e 64 20 61 72 65 20 6e 6f 74 20 62 6c 6f 63 6b nd are not block
6b50: 65 64 20 62 79 20 66 61 69 6c 65 64 0a 20 20 0a ed by failed. .
6b60: 0a 3b 3b 20 70 61 72 65 6e 74 2d 74 65 73 74 20 .;; parent-test
6b70: 69 73 20 74 68 65 72 65 20 61 73 20 61 20 70 6c is there as a pl
6b80: 61 63 65 68 6f 6c 64 65 72 20 66 6f 72 20 77 68 aceholder for wh
6b90: 65 6e 20 70 61 72 65 6e 74 2d 74 65 73 74 73 20 en parent-tests
6ba0: 63 61 6e 20 62 65 20 72 75 6e 20 61 73 20 61 20 can be run as a
6bb0: 73 65 74 75 70 20 73 74 65 70 0a 28 64 65 66 69 setup step.(defi
6bc0: 6e 65 20 28 72 75 6e 3a 74 65 73 74 20 72 75 6e ne (run:test run
6bd0: 2d 69 64 20 72 75 6e 6e 61 6d 65 20 6b 65 79 76 -id runname keyv
6be0: 61 6c 6c 73 74 20 74 65 73 74 2d 72 65 63 6f 72 allst test-recor
6bf0: 64 20 66 6c 61 67 73 20 70 61 72 65 6e 74 2d 74 d flags parent-t
6c00: 65 73 74 29 0a 20 20 3b 3b 20 41 6c 6c 20 74 68 est). ;; All th
6c10: 65 73 65 20 76 61 72 73 20 6d 69 67 68 74 20 62 ese vars might b
6c20: 65 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 e referenced by
6c30: 74 68 65 20 74 65 73 74 63 6f 6e 66 69 67 20 66 the testconfig f
6c40: 69 6c 65 20 72 65 61 64 65 72 0a 20 20 28 6c 65 ile reader. (le
6c50: 74 2a 20 28 28 74 65 73 74 2d 6e 61 6d 65 20 20 t* ((test-name
6c60: 20 20 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 (tests:testque
6c70: 75 65 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 ue-get-testname
6c80: 20 20 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a test-record)).
6c90: 09 20 28 74 65 73 74 2d 77 61 69 74 6f 6e 73 20 . (test-waitons
6ca0: 28 74 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 (tests:testqueue
6cb0: 2d 67 65 74 2d 77 61 69 74 6f 6e 73 20 20 20 20 -get-waitons
6cc0: 74 65 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 20 test-record))..
6cd0: 28 74 65 73 74 2d 63 6f 6e 66 20 20 20 20 28 74 (test-conf (t
6ce0: 65 73 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 ests:testqueue-g
6cf0: 65 74 2d 74 65 73 74 63 6f 6e 66 69 67 20 74 65 et-testconfig te
6d00: 73 74 2d 72 65 63 6f 72 64 29 29 0a 09 20 28 69 st-record)).. (i
6d10: 74 65 6d 64 61 74 20 20 20 20 20 20 28 74 65 73 temdat (tes
6d20: 74 73 3a 74 65 73 74 71 75 65 75 65 2d 67 65 74 ts:testqueue-get
6d30: 2d 69 74 65 6d 64 61 74 20 20 20 20 74 65 73 74 -itemdat test
6d40: 2d 72 65 63 6f 72 64 29 29 0a 09 20 28 74 65 73 -record)).. (tes
6d50: 74 2d 70 61 74 68 20 20 20 20 28 63 6f 6e 63 20 t-path (conc
6d60: 2a 74 6f 70 70 61 74 68 2a 20 22 2f 74 65 73 74 *toppath* "/test
6d70: 73 2f 22 20 74 65 73 74 2d 6e 61 6d 65 29 29 20 s/" test-name))
6d80: 3b 3b 20 63 6f 75 6c 64 20 75 73 65 20 74 65 73 ;; could use tes
6d90: 74 73 3a 67 65 74 2d 74 65 73 74 63 6f 6e 66 69 ts:get-testconfi
6da0: 67 20 68 65 72 65 20 2e 2e 2e 0a 09 20 28 66 6f g here ..... (fo
6db0: 72 63 65 20 20 20 20 20 20 20 20 28 68 61 73 68 rce (hash
6dc0: 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 -table-ref/defau
6dd0: 6c 74 20 66 6c 61 67 73 20 22 2d 66 6f 72 63 65 lt flags "-force
6de0: 22 20 23 66 29 29 0a 09 20 28 72 65 72 75 6e 20 " #f)).. (rerun
6df0: 20 20 20 20 20 20 20 28 68 61 73 68 2d 74 61 62 (hash-tab
6e00: 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 20 66 le-ref/default f
6e10: 6c 61 67 73 20 22 2d 72 65 72 75 6e 22 20 23 66 lags "-rerun" #f
6e20: 29 29 0a 09 20 28 6b 65 65 70 67 6f 69 6e 67 20 )).. (keepgoing
6e30: 20 20 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 (hash-table-r
6e40: 65 66 2f 64 65 66 61 75 6c 74 20 66 6c 61 67 73 ef/default flags
6e50: 20 22 2d 6b 65 65 70 67 6f 69 6e 67 22 20 23 66 "-keepgoing" #f
6e60: 29 29 0a 09 20 28 69 74 65 6d 2d 70 61 74 68 20 )).. (item-path
6e70: 20 20 20 20 22 22 29 0a 09 20 28 64 62 20 20 20 "").. (db
6e80: 20 20 20 20 20 20 20 20 23 66 29 29 0a 20 20 20 #f)).
6e90: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 0a (debug:print 4.
6ea0: 09 09 20 22 74 65 73 74 2d 63 6f 6e 66 69 67 3a .. "test-config:
6eb0: 20 22 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 3e " (hash-table->
6ec0: 61 6c 69 73 74 20 74 65 73 74 2d 63 6f 6e 66 29 alist test-conf)
6ed0: 0a 09 09 20 22 5c 6e 20 20 20 69 74 65 6d 64 61 ... "\n itemda
6ee0: 74 3a 20 22 20 69 74 65 6d 64 61 74 0a 09 09 20 t: " itemdat...
6ef0: 29 0a 20 20 20 20 3b 3b 20 73 65 74 74 69 6e 67 ). ;; setting
6f00: 20 69 74 65 6d 64 61 74 20 74 6f 20 61 20 6c 69 itemdat to a li
6f10: 73 74 20 69 66 20 69 74 20 69 73 20 23 66 0a 20 st if it is #f.
6f20: 20 20 20 28 69 66 20 28 6e 6f 74 20 69 74 65 6d (if (not item
6f30: 64 61 74 29 28 73 65 74 21 20 69 74 65 6d 64 61 dat)(set! itemda
6f40: 74 20 27 28 29 29 29 0a 20 20 20 20 28 73 65 74 t '())). (set
6f50: 21 20 69 74 65 6d 2d 70 61 74 68 20 28 69 74 65 ! item-path (ite
6f60: 6d 2d 6c 69 73 74 2d 3e 70 61 74 68 20 69 74 65 m-list->path ite
6f70: 6d 64 61 74 29 29 0a 20 20 20 20 28 64 65 62 75 mdat)). (debu
6f80: 67 3a 70 72 69 6e 74 20 32 20 22 41 74 74 65 6d g:print 2 "Attem
6f90: 70 74 69 6e 67 20 74 6f 20 6c 61 75 6e 63 68 20 pting to launch
6fa0: 74 65 73 74 20 22 20 74 65 73 74 2d 6e 61 6d 65 test " test-name
6fb0: 20 28 69 66 20 28 65 71 75 61 6c 3f 20 69 74 65 (if (equal? ite
6fc0: 6d 2d 70 61 74 68 20 22 2f 22 29 20 22 2f 22 20 m-path "/") "/"
6fd0: 69 74 65 6d 2d 70 61 74 68 29 29 0a 20 20 20 20 item-path)).
6fe0: 28 73 65 74 65 6e 76 20 22 4d 54 5f 54 45 53 54 (setenv "MT_TEST
6ff0: 5f 4e 41 4d 45 22 20 74 65 73 74 2d 6e 61 6d 65 _NAME" test-name
7000: 29 20 3b 3b 20 0a 20 20 20 20 28 73 65 74 65 6e ) ;; . (seten
7010: 76 20 22 4d 54 5f 52 55 4e 4e 41 4d 45 22 20 20 v "MT_RUNNAME"
7020: 20 72 75 6e 6e 61 6d 65 29 0a 20 20 20 20 28 6f runname). (o
7030: 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 73 65 pen-run-close se
7040: 74 2d 6d 65 67 61 74 65 73 74 2d 65 6e 76 2d 76 t-megatest-env-v
7050: 61 72 73 20 64 62 20 72 75 6e 2d 69 64 29 20 3b ars db run-id) ;
7060: 3b 20 74 68 65 73 65 20 6d 61 79 20 62 65 20 6e ; these may be n
7070: 65 65 64 65 64 20 62 79 20 74 68 65 20 6c 61 75 eeded by the lau
7080: 6e 63 68 69 6e 67 20 70 72 6f 63 65 73 73 0a 20 nching process.
7090: 20 20 20 28 63 68 61 6e 67 65 2d 64 69 72 65 63 (change-direc
70a0: 74 6f 72 79 20 2a 74 6f 70 70 61 74 68 2a 29 0a tory *toppath*).
70b0: 0a 20 20 20 20 3b 3b 20 48 65 72 65 20 69 73 20 . ;; Here is
70c0: 77 68 65 72 65 20 74 68 65 20 74 65 73 74 5f 6d where the test_m
70d0: 65 74 61 20 74 61 62 6c 65 20 69 73 20 62 65 73 eta table is bes
70e0: 74 20 75 70 64 61 74 65 64 0a 20 20 20 20 3b 3b t updated. ;;
70f0: 20 59 65 73 2c 20 61 6e 6f 74 68 65 72 20 75 73 Yes, another us
7100: 65 20 6f 66 20 61 20 67 6c 6f 62 61 6c 20 66 6f e of a global fo
7110: 72 20 63 61 63 68 69 6e 67 2e 20 4e 65 65 64 20 r caching. Need
7120: 61 20 62 65 74 74 65 72 20 77 61 79 3f 0a 20 20 a better way?.
7130: 20 20 28 69 66 20 28 6e 6f 74 20 28 68 61 73 68 (if (not (hash
7140: 2d 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 -table-ref/defau
7150: 6c 74 20 2a 74 65 73 74 2d 6d 65 74 61 2d 75 70 lt *test-meta-up
7160: 64 61 74 65 64 2a 20 74 65 73 74 2d 6e 61 6d 65 dated* test-name
7170: 20 23 66 29 29 0a 20 20 20 20 20 20 20 20 28 62 #f)). (b
7180: 65 67 69 6e 0a 09 20 20 20 28 68 61 73 68 2d 74 egin.. (hash-t
7190: 61 62 6c 65 2d 73 65 74 21 20 2a 74 65 73 74 2d able-set! *test-
71a0: 6d 65 74 61 2d 75 70 64 61 74 65 64 2a 20 74 65 meta-updated* te
71b0: 73 74 2d 6e 61 6d 65 20 23 74 29 0a 20 20 20 20 st-name #t).
71c0: 20 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e (open-run
71d0: 2d 63 6c 6f 73 65 20 72 75 6e 73 3a 75 70 64 61 -close runs:upda
71e0: 74 65 2d 74 65 73 74 5f 6d 65 74 61 20 64 62 20 te-test_meta db
71f0: 74 65 73 74 2d 6e 61 6d 65 20 74 65 73 74 2d 63 test-name test-c
7200: 6f 6e 66 29 29 29 0a 20 20 20 20 0a 20 20 20 20 onf))). .
7210: 3b 3b 20 28 6c 61 6d 62 64 61 20 28 69 74 65 6d ;; (lambda (item
7220: 64 61 74 29 20 3b 3b 3b 20 28 28 72 69 70 65 6e dat) ;;; ((ripen
7230: 65 73 73 20 22 6f 76 65 72 72 69 70 65 22 29 20 ess "overripe")
7240: 28 74 65 6d 70 65 72 61 74 75 72 65 20 22 63 6f (temperature "co
7250: 6f 6c 22 29 20 28 73 65 61 73 6f 6e 20 22 73 75 ol") (season "su
7260: 6d 6d 65 72 22 29 29 0a 20 20 20 20 28 6c 65 74 mmer")). (let
7270: 2a 20 28 28 6e 65 77 2d 74 65 73 74 2d 70 61 74 * ((new-test-pat
7280: 68 20 28 73 74 72 69 6e 67 2d 69 6e 74 65 72 73 h (string-inters
7290: 70 65 72 73 65 20 28 63 6f 6e 73 20 74 65 73 74 perse (cons test
72a0: 2d 70 61 74 68 20 28 6d 61 70 20 63 61 64 72 20 -path (map cadr
72b0: 69 74 65 6d 64 61 74 29 29 20 22 2f 22 29 29 0a itemdat)) "/")).
72c0: 09 20 20 20 28 6e 65 77 2d 74 65 73 74 2d 6e 61 . (new-test-na
72d0: 6d 65 20 28 69 66 20 28 65 71 75 61 6c 3f 20 69 me (if (equal? i
72e0: 74 65 6d 2d 70 61 74 68 20 22 22 29 20 74 65 73 tem-path "") tes
72f0: 74 2d 6e 61 6d 65 20 28 63 6f 6e 63 20 74 65 73 t-name (conc tes
7300: 74 2d 6e 61 6d 65 20 22 2f 22 20 69 74 65 6d 2d t-name "/" item-
7310: 70 61 74 68 29 29 29 20 3b 3b 20 6a 75 73 74 20 path))) ;; just
7320: 6e 65 65 64 20 69 74 20 74 6f 20 62 65 20 75 6e need it to be un
7330: 69 71 75 65 0a 09 20 20 20 28 74 65 73 74 2d 69 ique.. (test-i
7340: 64 20 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 d (open-ru
7350: 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d 74 n-close db:get-t
7360: 65 73 74 2d 69 64 20 64 62 20 20 72 75 6e 2d 69 est-id db run-i
7370: 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 74 65 6d d test-name item
7380: 2d 70 61 74 68 29 29 0a 09 20 20 20 28 74 65 73 -path)).. (tes
7390: 74 64 61 74 20 20 20 20 20 20 20 28 6f 70 65 6e tdat (open
73a0: 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 -run-close db:ge
73b0: 74 2d 74 65 73 74 2d 69 6e 66 6f 2d 62 79 2d 69 t-test-info-by-i
73c0: 64 20 64 62 20 74 65 73 74 2d 69 64 29 29 29 0a d db test-id))).
73d0: 20 20 20 20 20 20 28 69 66 20 28 6e 6f 74 20 74 (if (not t
73e0: 65 73 74 64 61 74 29 0a 09 20 20 28 62 65 67 69 estdat).. (begi
73f0: 6e 0a 09 20 20 20 20 3b 3b 20 65 6e 73 75 72 65 n.. ;; ensure
7400: 20 74 68 61 74 20 74 68 65 20 70 61 74 68 20 65 that the path e
7410: 78 69 73 74 73 20 62 65 66 6f 72 65 20 72 65 67 xists before reg
7420: 69 73 74 65 72 69 6e 67 20 74 68 65 20 74 65 73 istering the tes
7430: 74 0a 09 20 20 20 20 3b 3b 20 4e 4f 50 45 3a 20 t.. ;; NOPE:
7440: 43 61 6e 6e 6f 74 21 20 44 6f 6e 27 74 20 6b 6e Cannot! Don't kn
7450: 6f 77 20 79 65 74 20 77 68 69 63 68 20 64 69 73 ow yet which dis
7460: 6b 20 61 72 65 61 20 77 69 6c 6c 20 62 65 20 61 k area will be a
7470: 73 73 69 67 6e 65 64 2e 2e 2e 2e 0a 09 20 20 20 ssigned......
7480: 20 3b 3b 20 28 73 79 73 74 65 6d 20 28 63 6f 6e ;; (system (con
7490: 63 20 22 6d 6b 64 69 72 20 2d 70 20 22 20 6e 65 c "mkdir -p " ne
74a0: 77 2d 74 65 73 74 2d 70 61 74 68 29 29 0a 09 20 w-test-path))..
74b0: 20 20 20 3b 3b 0a 09 20 20 20 20 3b 3b 20 28 6f ;;.. ;; (o
74c0: 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 74 65 pen-run-close te
74d0: 73 74 73 3a 72 65 67 69 73 74 65 72 2d 74 65 73 sts:register-tes
74e0: 74 20 64 62 20 72 75 6e 2d 69 64 20 74 65 73 74 t db run-id test
74f0: 2d 6e 61 6d 65 20 69 74 65 6d 2d 70 61 74 68 29 -name item-path)
7500: 0a 09 20 20 20 20 3b 3b 0a 09 20 20 20 20 3b 3b .. ;;.. ;;
7510: 20 4e 42 2f 2f 20 66 6f 72 20 74 68 65 20 61 62 NB// for the ab
7520: 6f 76 65 20 6c 69 6e 65 2e 20 49 20 77 61 6e 74 ove line. I want
7530: 20 74 68 65 20 74 65 73 74 20 74 6f 20 62 65 20 the test to be
7540: 72 65 67 69 73 74 65 72 65 64 20 6c 6f 6e 67 20 registered long
7550: 62 65 66 6f 72 65 20 74 68 69 73 20 72 6f 75 74 before this rout
7560: 69 6e 65 20 67 65 74 73 20 63 61 6c 6c 65 64 21 ine gets called!
7570: 0a 09 20 20 20 20 3b 3b 0a 09 20 20 20 20 28 73 .. ;;.. (s
7580: 65 74 21 20 74 65 73 74 2d 69 64 20 28 6f 70 65 et! test-id (ope
7590: 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 n-run-close db:g
75a0: 65 74 2d 74 65 73 74 2d 69 64 20 64 62 20 72 75 et-test-id db ru
75b0: 6e 2d 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 n-id test-name i
75c0: 74 65 6d 2d 70 61 74 68 29 29 0a 09 20 20 20 20 tem-path))..
75d0: 28 69 66 20 28 6e 6f 74 20 74 65 73 74 2d 69 64 (if (not test-id
75e0: 29 0a 09 09 28 62 65 67 69 6e 0a 09 09 20 20 28 )...(begin... (
75f0: 64 65 62 75 67 3a 70 72 69 6e 74 20 32 20 22 57 debug:print 2 "W
7600: 41 52 4e 3a 20 54 65 73 74 20 6e 6f 74 20 70 72 ARN: Test not pr
7610: 65 2d 63 72 65 61 74 65 64 3f 20 74 65 73 74 2d e-created? test-
7620: 6e 61 6d 65 3d 22 20 74 65 73 74 2d 6e 61 6d 65 name=" test-name
7630: 20 22 2c 20 69 74 65 6d 2d 70 61 74 68 3d 22 20 ", item-path="
7640: 69 74 65 6d 2d 70 61 74 68 20 22 2c 20 72 75 6e item-path ", run
7650: 2d 69 64 3d 22 20 72 75 6e 2d 69 64 29 0a 09 09 -id=" run-id)...
7660: 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 (open-run-clos
7670: 65 20 64 62 3a 74 65 73 74 73 2d 72 65 67 69 73 e db:tests-regis
7680: 74 65 72 2d 74 65 73 74 20 23 66 20 72 75 6e 2d ter-test #f run-
7690: 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 74 65 id test-name ite
76a0: 6d 2d 70 61 74 68 29 0a 09 09 20 20 28 73 65 74 m-path)... (set
76b0: 21 20 74 65 73 74 2d 69 64 20 28 6f 70 65 6e 2d ! test-id (open-
76c0: 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 run-close db:get
76d0: 2d 74 65 73 74 2d 69 64 20 64 62 20 72 75 6e 2d -test-id db run-
76e0: 69 64 20 74 65 73 74 2d 6e 61 6d 65 20 69 74 65 id test-name ite
76f0: 6d 2d 70 61 74 68 29 29 29 29 0a 09 20 20 20 20 m-path))))..
7700: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 22 (debug:print 4 "
7710: 49 4e 46 4f 3a 20 74 65 73 74 2d 69 64 3d 22 20 INFO: test-id="
7720: 74 65 73 74 2d 69 64 20 22 2c 20 72 75 6e 2d 69 test-id ", run-i
7730: 64 3d 22 20 72 75 6e 2d 69 64 20 22 2c 20 74 65 d=" run-id ", te
7740: 73 74 2d 6e 61 6d 65 3d 22 20 74 65 73 74 2d 6e st-name=" test-n
7750: 61 6d 65 20 22 2c 20 69 74 65 6d 2d 70 61 74 68 ame ", item-path
7760: 3d 5c 22 22 20 69 74 65 6d 2d 70 61 74 68 20 22 =\"" item-path "
7770: 5c 22 22 29 0a 09 20 20 20 20 28 73 65 74 21 20 \"").. (set!
7780: 74 65 73 74 64 61 74 20 28 6f 70 65 6e 2d 72 75 testdat (open-ru
7790: 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d 74 n-close db:get-t
77a0: 65 73 74 2d 69 6e 66 6f 2d 62 79 2d 69 64 20 64 est-info-by-id d
77b0: 62 20 74 65 73 74 2d 69 64 29 29 29 29 0a 20 20 b test-id)))).
77c0: 20 20 20 20 28 73 65 74 21 20 74 65 73 74 2d 69 (set! test-i
77d0: 64 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 d (db:test-get-i
77e0: 64 20 74 65 73 74 64 61 74 29 29 0a 20 20 20 20 d testdat)).
77f0: 20 20 28 63 68 61 6e 67 65 2d 64 69 72 65 63 74 (change-direct
7800: 6f 72 79 20 74 65 73 74 2d 70 61 74 68 29 0a 20 ory test-path).
7810: 20 20 20 20 20 28 63 61 73 65 20 28 69 66 20 66 (case (if f
7820: 6f 72 63 65 20 3b 3b 20 28 61 72 67 73 3a 67 65 orce ;; (args:ge
7830: 74 2d 61 72 67 20 22 2d 66 6f 72 63 65 22 29 0a t-arg "-force").
7840: 09 09 27 4e 4f 54 5f 53 54 41 52 54 45 44 0a 09 ..'NOT_STARTED..
7850: 09 28 69 66 20 74 65 73 74 64 61 74 0a 09 09 20 .(if testdat...
7860: 20 20 20 28 73 74 72 69 6e 67 2d 3e 73 79 6d 62 (string->symb
7870: 6f 6c 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 ol (test:get-sta
7880: 74 65 20 74 65 73 74 64 61 74 29 29 0a 09 09 20 te testdat))...
7890: 20 20 20 27 66 61 69 6c 65 64 2d 74 6f 2d 69 6e 'failed-to-in
78a0: 73 65 72 74 29 29 0a 09 28 28 66 61 69 6c 65 64 sert))..((failed
78b0: 2d 74 6f 2d 69 6e 73 65 72 74 29 0a 09 20 28 64 -to-insert).. (d
78c0: 65 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 ebug:print 0 "ER
78d0: 52 4f 52 3a 20 46 61 69 6c 65 64 20 74 6f 20 69 ROR: Failed to i
78e0: 6e 73 65 72 74 20 74 68 65 20 72 65 63 6f 72 64 nsert the record
78f0: 20 69 6e 74 6f 20 74 68 65 20 64 62 22 29 29 0a into the db")).
7900: 09 28 28 4e 4f 54 5f 53 54 41 52 54 45 44 20 43 .((NOT_STARTED C
7910: 4f 4d 50 4c 45 54 45 44 20 44 45 4c 45 54 45 44 OMPLETED DELETED
7920: 29 0a 09 20 28 6c 65 74 20 28 28 72 75 6e 66 6c ).. (let ((runfl
7930: 61 67 20 23 66 29 29 0a 09 20 20 20 28 63 6f 6e ag #f)).. (con
7940: 64 0a 09 20 20 20 20 3b 3b 20 2d 66 6f 72 63 65 d.. ;; -force
7950: 2c 20 72 75 6e 20 6e 6f 20 6d 61 74 74 65 72 20 , run no matter
7960: 77 68 61 74 0a 09 20 20 20 20 28 66 6f 72 63 65 what.. (force
7970: 20 28 73 65 74 21 20 72 75 6e 66 6c 61 67 20 23 (set! runflag #
7980: 74 29 29 0a 09 20 20 20 20 3b 3b 20 4e 4f 54 5f t)).. ;; NOT_
7990: 53 54 41 52 54 45 44 2c 20 72 75 6e 20 6e 6f 20 STARTED, run no
79a0: 6d 61 74 74 65 72 20 77 68 61 74 0a 09 20 20 20 matter what..
79b0: 20 28 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a ((member (test:
79c0: 67 65 74 2d 73 74 61 74 65 20 74 65 73 74 64 61 get-state testda
79d0: 74 29 20 27 28 22 44 45 4c 45 54 45 44 22 20 22 t) '("DELETED" "
79e0: 4e 4f 54 5f 53 54 41 52 54 45 44 22 29 29 28 73 NOT_STARTED"))(s
79f0: 65 74 21 20 72 75 6e 66 6c 61 67 20 23 74 29 29 et! runflag #t))
7a00: 0a 09 20 20 20 20 3b 3b 20 6e 6f 74 20 2d 72 65 .. ;; not -re
7a10: 72 75 6e 20 61 6e 64 20 50 41 53 53 2c 20 57 41 run and PASS, WA
7a20: 52 4e 20 6f 72 20 43 48 45 43 4b 2c 20 64 6f 20 RN or CHECK, do
7a30: 6e 6f 20 72 75 6e 0a 09 20 20 20 20 28 28 61 6e no run.. ((an
7a40: 64 20 28 6f 72 20 28 6e 6f 74 20 72 65 72 75 6e d (or (not rerun
7a50: 29 0a 09 09 20 20 20 20 20 20 6b 65 65 70 67 6f )... keepgo
7a60: 69 6e 67 29 0a 09 09 20 20 3b 3b 20 52 65 71 75 ing)... ;; Requ
7a70: 69 72 65 20 74 6f 20 66 6f 72 63 65 20 72 65 2d ire to force re-
7a80: 72 75 6e 20 66 6f 72 20 43 4f 4d 50 4c 45 54 45 run for COMPLETE
7a90: 44 20 6f 72 20 2a 61 6e 79 74 68 69 6e 67 2a 20 D or *anything*
7aa0: 2b 20 50 41 53 53 2c 57 41 52 4e 20 6f 72 20 43 + PASS,WARN or C
7ab0: 48 45 43 4b 0a 09 09 20 20 28 6f 72 20 28 6d 65 HECK... (or (me
7ac0: 6d 62 65 72 20 28 74 65 73 74 3a 67 65 74 2d 73 mber (test:get-s
7ad0: 74 61 74 75 73 20 74 65 73 74 64 61 74 29 20 27 tatus testdat) '
7ae0: 28 22 50 41 53 53 22 20 22 57 41 52 4e 22 20 22 ("PASS" "WARN" "
7af0: 43 48 45 43 4b 22 29 29 0a 09 09 20 20 20 20 20 CHECK"))...
7b00: 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a 67 (member (test:g
7b10: 65 74 2d 73 74 61 74 65 20 20 74 65 73 74 64 61 et-state testda
7b20: 74 29 20 27 28 22 43 4f 4d 50 4c 45 54 45 44 22 t) '("COMPLETED"
7b30: 29 29 29 29 20 0a 09 20 20 20 20 20 28 64 65 62 )))) .. (deb
7b40: 75 67 3a 70 72 69 6e 74 20 32 20 22 49 4e 46 4f ug:print 2 "INFO
7b50: 3a 20 72 75 6e 6e 69 6e 67 20 74 65 73 74 20 22 : running test "
7b60: 20 74 65 73 74 2d 6e 61 6d 65 20 22 2f 22 20 69 test-name "/" i
7b70: 74 65 6d 2d 70 61 74 68 20 22 20 73 75 70 70 72 tem-path " suppr
7b80: 65 73 73 65 64 20 61 73 20 69 74 20 69 73 20 22 essed as it is "
7b90: 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 65 (test:get-state
7ba0: 20 74 65 73 74 64 61 74 29 20 22 20 61 6e 64 20 testdat) " and
7bb0: 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 " (test:get-stat
7bc0: 75 73 20 74 65 73 74 64 61 74 29 29 0a 09 20 20 us testdat))..
7bd0: 20 20 20 28 73 65 74 21 20 72 75 6e 66 6c 61 67 (set! runflag
7be0: 20 23 66 29 29 0a 09 20 20 20 20 3b 3b 20 2d 72 #f)).. ;; -r
7bf0: 65 72 75 6e 20 61 6e 64 20 73 74 61 74 75 73 20 erun and status
7c00: 69 73 20 6f 6e 65 20 6f 66 20 74 68 65 20 73 70 is one of the sp
7c10: 65 63 69 66 65 64 2c 20 72 75 6e 20 69 74 0a 09 ecifed, run it..
7c20: 20 20 20 20 28 28 61 6e 64 20 72 65 72 75 6e 0a ((and rerun.
7c30: 09 09 20 20 28 6c 65 74 2a 20 28 28 72 65 72 75 .. (let* ((reru
7c40: 6e 6c 73 74 20 20 20 28 73 74 72 69 6e 67 2d 73 nlst (string-s
7c50: 70 6c 69 74 20 72 65 72 75 6e 20 22 2c 22 29 29 plit rerun ","))
7c60: 0a 09 09 09 20 28 6d 75 73 74 2d 72 65 72 75 6e .... (must-rerun
7c70: 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a 67 (member (test:g
7c80: 65 74 2d 73 74 61 74 75 73 20 74 65 73 74 64 61 et-status testda
7c90: 74 29 20 72 65 72 75 6e 6c 73 74 29 29 29 0a 09 t) rerunlst)))..
7ca0: 09 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e . (debug:prin
7cb0: 74 20 33 20 22 49 4e 46 4f 3a 20 2d 72 65 72 75 t 3 "INFO: -reru
7cc0: 6e 20 6c 69 73 74 3a 20 22 20 72 65 72 75 6e 20 n list: " rerun
7cd0: 22 2c 20 74 65 73 74 2d 73 74 61 74 75 73 3a 20 ", test-status:
7ce0: 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 " (test:get-stat
7cf0: 75 73 20 74 65 73 74 64 61 74 29 22 2c 20 6d 75 us testdat)", mu
7d00: 73 74 2d 72 65 72 75 6e 3a 20 22 20 6d 75 73 74 st-rerun: " must
7d10: 2d 72 65 72 75 6e 29 0a 09 09 20 20 20 20 6d 75 -rerun)... mu
7d20: 73 74 2d 72 65 72 75 6e 29 29 0a 09 20 20 20 20 st-rerun))..
7d30: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 32 20 (debug:print 2
7d40: 22 49 4e 46 4f 3a 20 52 65 72 75 6e 20 66 6f 72 "INFO: Rerun for
7d50: 63 65 64 20 66 6f 72 20 74 65 73 74 20 22 20 74 ced for test " t
7d60: 65 73 74 2d 6e 61 6d 65 20 22 2f 22 20 69 74 65 est-name "/" ite
7d70: 6d 2d 70 61 74 68 29 0a 09 20 20 20 20 20 28 73 m-path).. (s
7d80: 65 74 21 20 72 75 6e 66 6c 61 67 20 23 74 29 29 et! runflag #t))
7d90: 0a 09 20 20 20 20 3b 3b 20 2d 6b 65 65 70 67 6f .. ;; -keepgo
7da0: 69 6e 67 2c 20 64 6f 20 6e 6f 74 20 72 65 72 75 ing, do not reru
7db0: 6e 20 46 41 49 4c 0a 09 20 20 20 20 28 28 61 6e n FAIL.. ((an
7dc0: 64 20 6b 65 65 70 67 6f 69 6e 67 0a 09 09 20 20 d keepgoing...
7dd0: 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a 67 65 (member (test:ge
7de0: 74 2d 73 74 61 74 75 73 20 74 65 73 74 64 61 74 t-status testdat
7df0: 29 20 27 28 22 46 41 49 4c 22 29 29 29 0a 09 20 ) '("FAIL")))..
7e00: 20 20 20 20 28 73 65 74 21 20 72 75 6e 66 6c 61 (set! runfla
7e10: 67 20 23 66 29 29 0a 09 20 20 20 20 28 28 61 6e g #f)).. ((an
7e20: 64 20 28 6e 6f 74 20 72 65 72 75 6e 29 0a 09 09 d (not rerun)...
7e30: 20 20 28 6d 65 6d 62 65 72 20 28 74 65 73 74 3a (member (test:
7e40: 67 65 74 2d 73 74 61 74 75 73 20 74 65 73 74 64 get-status testd
7e50: 61 74 29 20 27 28 22 46 41 49 4c 22 20 22 6e 2f at) '("FAIL" "n/
7e60: 61 22 29 29 29 0a 09 20 20 20 20 20 28 73 65 74 a"))).. (set
7e70: 21 20 72 75 6e 66 6c 61 67 20 23 74 29 29 0a 09 ! runflag #t))..
7e80: 20 20 20 20 28 65 6c 73 65 20 28 73 65 74 21 20 (else (set!
7e90: 72 75 6e 66 6c 61 67 20 23 66 29 29 29 0a 09 20 runflag #f)))..
7ea0: 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 36 (debug:print 6
7eb0: 20 22 52 55 4e 4e 49 4e 47 20 3d 3e 20 72 75 6e "RUNNING => run
7ec0: 66 6c 61 67 3a 20 22 20 72 75 6e 66 6c 61 67 20 flag: " runflag
7ed0: 22 20 53 54 41 54 45 3a 20 22 20 28 74 65 73 74 " STATE: " (test
7ee0: 3a 67 65 74 2d 73 74 61 74 65 20 74 65 73 74 64 :get-state testd
7ef0: 61 74 29 20 22 20 53 54 41 54 55 53 3a 20 22 20 at) " STATUS: "
7f00: 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 75 73 (test:get-status
7f10: 20 74 65 73 74 64 61 74 29 29 0a 09 20 20 20 28 testdat)).. (
7f20: 69 66 20 28 6e 6f 74 20 72 75 6e 66 6c 61 67 29 if (not runflag)
7f30: 0a 09 20 20 20 20 20 20 20 28 69 66 20 28 6e 6f .. (if (no
7f40: 74 20 70 61 72 65 6e 74 2d 74 65 73 74 29 0a 09 t parent-test)..
7f50: 09 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 . (debug:print
7f60: 20 31 20 22 4e 4f 54 45 3a 20 4e 6f 74 20 73 74 1 "NOTE: Not st
7f70: 61 72 74 69 6e 67 20 74 65 73 74 20 22 20 6e 65 arting test " ne
7f80: 77 2d 74 65 73 74 2d 6e 61 6d 65 20 22 20 61 73 w-test-name " as
7f90: 20 69 74 20 69 73 20 73 74 61 74 65 20 5c 22 22 it is state \""
7fa0: 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 65 (test:get-state
7fb0: 20 74 65 73 74 64 61 74 29 20 0a 09 09 09 09 22 testdat) ....."
7fc0: 5c 22 20 61 6e 64 20 73 74 61 74 75 73 20 5c 22 \" and status \"
7fd0: 22 20 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 " (test:get-stat
7fe0: 75 73 20 74 65 73 74 64 61 74 29 20 22 5c 22 2c us testdat) "\",
7ff0: 20 75 73 65 20 2d 72 65 72 75 6e 20 5c 22 22 20 use -rerun \""
8000: 28 74 65 73 74 3a 67 65 74 2d 73 74 61 74 75 73 (test:get-status
8010: 20 74 65 73 74 64 61 74 29 0a 20 20 20 20 20 20 testdat).
8020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8030: 20 20 20 20 20 20 20 20 20 20 22 5c 22 20 6f 72 "\" or
8040: 20 2d 66 6f 72 63 65 20 74 6f 20 6f 76 65 72 72 -force to overr
8050: 69 64 65 22 29 29 0a 09 20 20 20 20 20 20 20 3b ide")).. ;
8060: 3b 20 4e 4f 54 45 3a 20 4e 6f 20 6c 6f 6e 67 65 ; NOTE: No longe
8070: 72 20 62 65 20 63 68 65 63 6b 69 6e 67 20 70 72 r be checking pr
8080: 65 72 65 71 75 69 73 69 74 65 73 20 68 65 72 65 erequisites here
8090: 21 20 57 69 6c 6c 20 6e 65 76 65 72 20 67 65 74 ! Will never get
80a0: 20 68 65 72 65 20 75 6e 6c 65 73 73 20 70 72 65 here unless pre
80b0: 72 65 71 73 20 61 72 65 0a 09 20 20 20 20 20 20 reqs are..
80c0: 20 3b 3b 20 20 20 20 20 20 20 61 6c 72 65 61 64 ;; alread
80d0: 79 20 6d 65 74 2e 0a 09 20 20 20 20 20 20 20 28 y met... (
80e0: 69 66 20 28 6e 6f 74 20 28 6c 61 75 6e 63 68 2d if (not (launch-
80f0: 74 65 73 74 20 23 66 20 72 75 6e 2d 69 64 20 72 test #f run-id r
8100: 75 6e 6e 61 6d 65 20 74 65 73 74 2d 63 6f 6e 66 unname test-conf
8110: 20 6b 65 79 76 61 6c 6c 73 74 20 74 65 73 74 2d keyvallst test-
8120: 6e 61 6d 65 20 74 65 73 74 2d 70 61 74 68 20 69 name test-path i
8130: 74 65 6d 64 61 74 20 66 6c 61 67 73 29 29 0a 09 temdat flags))..
8140: 09 20 20 20 28 62 65 67 69 6e 0a 09 09 20 20 20 . (begin...
8150: 20 20 28 70 72 69 6e 74 20 22 45 52 52 4f 52 3a (print "ERROR:
8160: 20 46 61 69 6c 65 64 20 74 6f 20 6c 61 75 6e 63 Failed to launc
8170: 68 20 74 68 65 20 74 65 73 74 2e 20 45 78 69 74 h the test. Exit
8180: 69 6e 67 20 61 73 20 73 6f 6f 6e 20 61 73 20 70 ing as soon as p
8190: 6f 73 73 69 62 6c 65 22 29 0a 09 09 20 20 20 20 ossible")...
81a0: 20 28 73 65 74 21 20 2a 67 6c 6f 62 61 6c 65 78 (set! *globalex
81b0: 69 74 73 74 61 74 75 73 2a 20 31 29 20 3b 3b 20 itstatus* 1) ;;
81c0: 0a 09 09 20 20 20 20 20 28 70 72 6f 63 65 73 73 ... (process
81d0: 2d 73 69 67 6e 61 6c 20 28 63 75 72 72 65 6e 74 -signal (current
81e0: 2d 70 72 6f 63 65 73 73 2d 69 64 29 20 73 69 67 -process-id) sig
81f0: 6e 61 6c 2f 6b 69 6c 6c 29 29 29 29 29 29 0a 09 nal/kill))))))..
8200: 28 28 4b 49 4c 4c 45 44 29 20 0a 09 20 28 64 65 ((KILLED) .. (de
8210: 62 75 67 3a 70 72 69 6e 74 20 31 20 22 4e 4f 54 bug:print 1 "NOT
8220: 45 3a 20 22 20 6e 65 77 2d 74 65 73 74 2d 6e 61 E: " new-test-na
8230: 6d 65 20 22 20 69 73 20 61 6c 72 65 61 64 79 20 me " is already
8240: 72 75 6e 6e 69 6e 67 20 6f 72 20 77 61 73 20 65 running or was e
8250: 78 70 6c 69 63 74 6c 79 20 6b 69 6c 6c 65 64 2c xplictly killed,
8260: 20 75 73 65 20 2d 66 6f 72 63 65 20 74 6f 20 6c use -force to l
8270: 61 75 6e 63 68 20 69 74 2e 22 29 29 0a 09 28 28 aunch it."))..((
8280: 4c 41 55 4e 43 48 45 44 20 52 45 4d 4f 54 45 48 LAUNCHED REMOTEH
8290: 4f 53 54 53 54 41 52 54 20 52 55 4e 4e 49 4e 47 OSTSTART RUNNING
82a0: 29 20 20 0a 09 20 28 69 66 20 28 3e 20 28 2d 20 ) .. (if (> (-
82b0: 28 63 75 72 72 65 6e 74 2d 73 65 63 6f 6e 64 73 (current-seconds
82c0: 29 28 2b 20 28 64 62 3a 74 65 73 74 2d 67 65 74 )(+ (db:test-get
82d0: 2d 65 76 65 6e 74 5f 74 69 6d 65 20 74 65 73 74 -event_time test
82e0: 64 61 74 29 0a 09 09 09 09 20 20 20 20 20 20 20 dat).....
82f0: 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 72 75 6e (db:test-get-run
8300: 5f 64 75 72 61 74 69 6f 6e 20 74 65 73 74 64 61 _duration testda
8310: 74 29 29 29 0a 09 09 36 30 30 29 20 3b 3b 20 69 t)))...600) ;; i
8320: 2e 65 2e 20 6e 6f 20 75 70 64 61 74 65 20 66 6f .e. no update fo
8330: 72 20 6d 6f 72 65 20 74 68 61 6e 20 36 30 30 20 r more than 600
8340: 73 65 63 6f 6e 64 73 0a 09 20 20 20 20 20 28 62 seconds.. (b
8350: 65 67 69 6e 0a 09 20 20 20 20 20 20 20 28 64 65 egin.. (de
8360: 62 75 67 3a 70 72 69 6e 74 20 30 20 22 57 41 52 bug:print 0 "WAR
8370: 4e 49 4e 47 3a 20 54 65 73 74 20 22 20 74 65 73 NING: Test " tes
8380: 74 2d 6e 61 6d 65 20 22 20 61 70 70 65 61 72 73 t-name " appears
8390: 20 74 6f 20 62 65 20 64 65 61 64 2e 20 46 6f 72 to be dead. For
83a0: 63 69 6e 67 20 69 74 20 74 6f 20 73 74 61 74 65 cing it to state
83b0: 20 49 4e 43 4f 4d 50 4c 45 54 45 20 61 6e 64 20 INCOMPLETE and
83c0: 73 74 61 74 75 73 20 53 54 55 43 4b 2f 44 45 41 status STUCK/DEA
83d0: 44 22 29 0a 09 20 20 20 20 20 20 20 28 74 65 73 D").. (tes
83e0: 74 73 3a 74 65 73 74 2d 73 65 74 2d 73 74 61 74 ts:test-set-stat
83f0: 75 73 21 20 74 65 73 74 2d 69 64 20 22 49 4e 43 us! test-id "INC
8400: 4f 4d 50 4c 45 54 45 22 20 22 53 54 55 43 4b 2f OMPLETE" "STUCK/
8410: 44 45 41 44 22 20 22 54 65 73 74 20 69 73 20 73 DEAD" "Test is s
8420: 74 75 63 6b 20 6f 72 20 64 65 61 64 22 20 23 66 tuck or dead" #f
8430: 29 29 0a 09 20 20 20 20 20 28 64 65 62 75 67 3a )).. (debug:
8440: 70 72 69 6e 74 20 32 20 22 4e 4f 54 45 3a 20 22 print 2 "NOTE: "
8450: 20 74 65 73 74 2d 6e 61 6d 65 20 22 20 69 73 20 test-name " is
8460: 61 6c 72 65 61 64 79 20 72 75 6e 6e 69 6e 67 22 already running"
8470: 29 29 29 0a 09 28 65 6c 73 65 20 20 20 20 20 20 )))..(else
8480: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 (debug:print 0
8490: 22 45 52 52 4f 52 3a 20 46 61 69 6c 65 64 20 74 "ERROR: Failed t
84a0: 6f 20 6c 61 75 6e 63 68 20 74 65 73 74 20 22 20 o launch test "
84b0: 6e 65 77 2d 74 65 73 74 2d 6e 61 6d 65 20 22 2e new-test-name ".
84c0: 20 55 6e 72 65 63 6f 67 6e 69 73 65 64 20 73 74 Unrecognised st
84d0: 61 74 65 20 22 20 28 74 65 73 74 3a 67 65 74 2d ate " (test:get-
84e0: 73 74 61 74 65 20 74 65 73 74 64 61 74 29 29 29 state testdat)))
84f0: 29 29 29 29 0a 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d ))))..;;========
8500: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8510: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8520: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8530: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b ==============.;
8540: 3b 20 45 4e 44 20 4f 46 20 4e 45 57 20 53 54 55 ; END OF NEW STU
8550: 46 46 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d FF.;;===========
8560: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8570: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8580: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
8590: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a 28 64 65 ===========..(de
85a0: 66 69 6e 65 20 28 67 65 74 2d 64 69 72 2d 75 70 fine (get-dir-up
85b0: 2d 6e 20 64 69 72 20 2e 20 70 61 72 61 6d 73 29 -n dir . params)
85c0: 20 0a 20 20 28 6c 65 74 20 28 28 64 70 61 72 74 . (let ((dpart
85d0: 73 20 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 s (string-split
85e0: 20 64 69 72 20 22 2f 22 29 29 0a 09 28 63 6f 75 dir "/"))..(cou
85f0: 6e 74 20 20 20 28 69 66 20 28 6e 75 6c 6c 3f 20 nt (if (null?
8600: 70 61 72 61 6d 73 29 20 31 20 28 63 61 72 20 70 params) 1 (car p
8610: 61 72 61 6d 73 29 29 29 29 0a 20 20 20 20 28 63 arams)))). (c
8620: 6f 6e 63 20 22 2f 22 20 28 73 74 72 69 6e 67 2d onc "/" (string-
8630: 69 6e 74 65 72 73 70 65 72 73 65 20 0a 09 20 20 intersperse ..
8640: 20 20 20 20 20 28 74 61 6b 65 20 64 70 61 72 74 (take dpart
8650: 73 20 28 2d 20 28 6c 65 6e 67 74 68 20 64 70 61 s (- (length dpa
8660: 72 74 73 29 20 63 6f 75 6e 74 29 29 0a 09 20 20 rts) count))..
8670: 20 20 20 20 20 22 2f 22 29 29 29 29 0a 3b 3b 20 "/")))).;;
8680: 52 65 6d 6f 76 65 20 72 75 6e 73 0a 3b 3b 20 66 Remove runs.;; f
8690: 69 65 6c 64 73 20 61 72 65 20 70 61 73 73 69 6e ields are passin
86a0: 67 20 69 6e 20 74 68 72 6f 75 67 68 20 0a 3b 3b g in through .;;
86b0: 20 61 63 74 69 6f 6e 3a 0a 3b 3b 20 20 20 20 27 action:.;; '
86c0: 72 65 6d 6f 76 65 2d 72 75 6e 73 0a 3b 3b 20 20 remove-runs.;;
86d0: 20 20 27 73 65 74 2d 73 74 61 74 65 2d 73 74 61 'set-state-sta
86e0: 74 75 73 0a 3b 3b 0a 3b 3b 20 4e 42 2f 2f 20 73 tus.;;.;; NB// s
86f0: 68 6f 75 6c 64 20 70 61 73 73 20 69 6e 20 6b 65 hould pass in ke
8700: 79 73 3f 0a 3b 3b 0a 28 64 65 66 69 6e 65 20 28 ys?.;;.(define (
8710: 72 75 6e 73 3a 6f 70 65 72 61 74 65 2d 6f 6e 20 runs:operate-on
8720: 61 63 74 69 6f 6e 20 72 75 6e 6e 61 6d 65 70 61 action runnamepa
8730: 74 74 20 74 65 73 74 70 61 74 74 20 23 21 6b 65 tt testpatt #!ke
8740: 79 20 28 73 74 61 74 65 20 23 66 29 28 73 74 61 y (state #f)(sta
8750: 74 75 73 20 23 66 29 28 6e 65 77 2d 73 74 61 74 tus #f)(new-stat
8760: 65 2d 73 74 61 74 75 73 20 23 66 29 29 0a 20 20 e-status #f)).
8770: 28 6c 65 74 2a 20 28 28 64 62 20 20 20 20 20 20 (let* ((db
8780: 20 20 20 20 20 23 66 29 0a 09 20 28 6b 65 79 73 #f).. (keys
8790: 20 20 20 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 (open-r
87a0: 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d un-close db:get-
87b0: 6b 65 79 73 20 64 62 29 29 0a 09 20 28 72 75 6e keys db)).. (run
87c0: 64 61 74 20 20 20 20 20 20 20 28 6f 70 65 6e 2d dat (open-
87d0: 72 75 6e 2d 63 6c 6f 73 65 20 72 75 6e 73 3a 67 run-close runs:g
87e0: 65 74 2d 72 75 6e 73 2d 62 79 2d 70 61 74 74 20 et-runs-by-patt
87f0: 64 62 20 6b 65 79 73 20 72 75 6e 6e 61 6d 65 70 db keys runnamep
8800: 61 74 74 29 29 0a 09 20 28 68 65 61 64 65 72 20 att)).. (header
8810: 20 20 20 20 20 20 28 76 65 63 74 6f 72 2d 72 65 (vector-re
8820: 66 20 72 75 6e 64 61 74 20 30 29 29 0a 09 20 28 f rundat 0)).. (
8830: 72 75 6e 73 20 20 20 20 20 20 20 20 20 28 76 65 runs (ve
8840: 63 74 6f 72 2d 72 65 66 20 72 75 6e 64 61 74 20 ctor-ref rundat
8850: 31 29 29 0a 09 20 28 73 74 61 74 65 73 20 20 20 1)).. (states
8860: 20 20 20 20 28 69 66 20 73 74 61 74 65 20 20 28 (if state (
8870: 73 74 72 69 6e 67 2d 73 70 6c 69 74 20 73 74 61 string-split sta
8880: 74 65 20 20 22 2c 22 29 20 27 28 29 29 29 0a 09 te ",") '()))..
8890: 20 28 73 74 61 74 75 73 65 73 20 20 20 20 20 28 (statuses (
88a0: 69 66 20 73 74 61 74 75 73 20 28 73 74 72 69 6e if status (strin
88b0: 67 2d 73 70 6c 69 74 20 73 74 61 74 75 73 20 22 g-split status "
88c0: 2c 22 29 20 27 28 29 29 29 0a 09 20 28 73 74 61 ,") '())).. (sta
88d0: 74 65 2d 73 74 61 74 75 73 20 28 69 66 20 28 73 te-status (if (s
88e0: 74 72 69 6e 67 3f 20 6e 65 77 2d 73 74 61 74 65 tring? new-state
88f0: 2d 73 74 61 74 75 73 29 20 28 73 74 72 69 6e 67 -status) (string
8900: 2d 73 70 6c 69 74 20 6e 65 77 2d 73 74 61 74 65 -split new-state
8910: 2d 73 74 61 74 75 73 20 22 2c 22 29 20 27 28 23 -status ",") '(#
8920: 66 20 23 66 29 29 29 29 0a 20 20 20 20 28 64 65 f #f)))). (de
8930: 62 75 67 3a 70 72 69 6e 74 20 34 20 22 49 4e 46 bug:print 4 "INF
8940: 4f 3a 20 72 75 6e 73 3a 6f 70 65 72 61 74 65 2d O: runs:operate-
8950: 6f 6e 20 3d 3e 20 48 65 61 64 65 72 3a 20 22 20 on => Header: "
8960: 68 65 61 64 65 72 20 22 20 61 63 74 69 6f 6e 3a header " action:
8970: 20 22 20 61 63 74 69 6f 6e 20 22 20 6e 65 77 2d " action " new-
8980: 73 74 61 74 65 2d 73 74 61 74 75 73 3a 20 22 20 state-status: "
8990: 6e 65 77 2d 73 74 61 74 65 2d 73 74 61 74 75 73 new-state-status
89a0: 29 0a 20 20 20 20 28 69 66 20 28 3e 20 32 20 28 ). (if (> 2 (
89b0: 6c 65 6e 67 74 68 20 73 74 61 74 65 2d 73 74 61 length state-sta
89c0: 74 75 73 29 29 0a 09 28 62 65 67 69 6e 0a 09 20 tus))..(begin..
89d0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 (debug:print 0
89e0: 22 45 52 52 4f 52 3a 20 74 68 65 20 70 61 72 61 "ERROR: the para
89f0: 6d 65 74 65 72 20 74 6f 20 2d 73 65 74 2d 73 74 meter to -set-st
8a00: 61 74 65 2d 73 74 61 74 75 73 20 69 73 20 61 20 ate-status is a
8a10: 63 6f 6d 6d 61 20 64 65 6c 69 6d 69 74 65 64 20 comma delimited
8a20: 73 74 72 69 6e 67 2e 20 45 2e 67 2e 20 43 4f 4d string. E.g. COM
8a30: 50 4c 45 54 45 44 2c 46 41 49 4c 22 29 0a 09 20 PLETED,FAIL")..
8a40: 20 28 65 78 69 74 29 29 29 0a 20 20 20 20 28 66 (exit))). (f
8a50: 6f 72 2d 65 61 63 68 0a 20 20 20 20 20 28 6c 61 or-each. (la
8a60: 6d 62 64 61 20 28 72 75 6e 29 0a 20 20 20 20 20 mbda (run).
8a70: 20 20 28 6c 65 74 20 28 28 72 75 6e 6b 65 79 20 (let ((runkey
8a80: 28 73 74 72 69 6e 67 2d 69 6e 74 65 72 73 70 65 (string-interspe
8a90: 72 73 65 20 28 6d 61 70 20 28 6c 61 6d 62 64 61 rse (map (lambda
8aa0: 20 28 6b 29 0a 09 09 09 09 09 09 28 64 62 3a 67 (k).......(db:g
8ab0: 65 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 et-value-by-head
8ac0: 65 72 20 72 75 6e 20 68 65 61 64 65 72 20 28 76 er run header (v
8ad0: 65 63 74 6f 72 2d 72 65 66 20 6b 20 30 29 29 29 ector-ref k 0)))
8ae0: 20 6b 65 79 73 29 20 22 2f 22 29 29 0a 09 20 20 keys) "/"))..
8af0: 20 20 20 28 64 69 72 73 2d 74 6f 2d 72 65 6d 6f (dirs-to-remo
8b00: 76 65 20 28 6d 61 6b 65 2d 68 61 73 68 2d 74 61 ve (make-hash-ta
8b10: 62 6c 65 29 29 29 0a 09 20 28 6c 65 74 2a 20 28 ble))).. (let* (
8b20: 28 72 75 6e 2d 69 64 20 20 20 20 28 64 62 3a 67 (run-id (db:g
8b30: 65 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 et-value-by-head
8b40: 65 72 20 72 75 6e 20 68 65 61 64 65 72 20 22 69 er run header "i
8b50: 64 22 29 29 0a 09 09 28 72 75 6e 2d 73 74 61 74 d"))...(run-stat
8b60: 65 20 28 64 62 3a 67 65 74 2d 76 61 6c 75 65 2d e (db:get-value-
8b70: 62 79 2d 68 65 61 64 65 72 20 72 75 6e 20 68 65 by-header run he
8b80: 61 64 65 72 20 22 73 74 61 74 65 22 29 29 0a 09 ader "state"))..
8b90: 09 28 74 65 73 74 73 20 20 20 20 20 28 69 66 20 .(tests (if
8ba0: 28 6e 6f 74 20 28 65 71 75 61 6c 3f 20 72 75 6e (not (equal? run
8bb0: 2d 73 74 61 74 65 20 22 6c 6f 63 6b 65 64 22 29 -state "locked")
8bc0: 29 0a 09 09 09 20 20 20 20 20 20 20 28 6f 70 65 ).... (ope
8bd0: 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 n-run-close db:g
8be0: 65 74 2d 74 65 73 74 73 2d 66 6f 72 2d 72 75 6e et-tests-for-run
8bf0: 20 64 62 20 72 75 6e 2d 69 64 0a 09 09 09 09 09 db run-id......
8c00: 09 20 20 20 20 20 20 74 65 73 74 70 61 74 74 20 . testpatt
8c10: 73 74 61 74 65 73 20 73 74 61 74 75 73 65 73 0a states statuses.
8c20: 09 09 09 09 09 09 20 20 20 20 20 20 6e 6f 74 2d ...... not-
8c30: 69 6e 3a 20 20 23 66 0a 09 09 09 09 09 09 20 20 in: #f.......
8c40: 20 20 20 20 73 6f 72 74 2d 62 79 3a 20 28 63 61 sort-by: (ca
8c50: 73 65 20 61 63 74 69 6f 6e 0a 09 09 09 09 09 09 se action.......
8c60: 09 09 20 28 28 72 65 6d 6f 76 65 2d 72 75 6e 73 .. ((remove-runs
8c70: 29 20 27 72 75 6e 64 69 72 29 0a 09 09 09 09 09 ) 'rundir)......
8c80: 09 09 09 20 28 65 6c 73 65 20 20 20 20 20 20 20 ... (else
8c90: 20 20 20 27 65 76 65 6e 74 5f 74 69 6d 65 29 29 'event_time))
8ca0: 29 0a 09 09 09 20 20 20 20 20 20 20 27 28 29 29 ).... '())
8cb0: 29 0a 09 09 28 6c 61 73 74 74 70 61 74 68 20 22 )...(lasttpath "
8cc0: 2f 64 6f 65 73 2f 6e 6f 74 2f 65 78 69 73 74 2f /does/not/exist/
8cd0: 49 2f 68 6f 70 65 22 29 29 0a 09 20 20 20 28 64 I/hope")).. (d
8ce0: 65 62 75 67 3a 70 72 69 6e 74 20 34 20 22 49 4e ebug:print 4 "IN
8cf0: 46 4f 3a 20 72 75 6e 73 3a 6f 70 65 72 61 74 65 FO: runs:operate
8d00: 2d 6f 6e 20 72 75 6e 3d 22 20 72 75 6e 20 22 2c -on run=" run ",
8d10: 20 68 65 61 64 65 72 3d 22 20 68 65 61 64 65 72 header=" header
8d20: 29 0a 09 20 20 20 28 69 66 20 28 6e 6f 74 20 28 ).. (if (not (
8d30: 6e 75 6c 6c 3f 20 74 65 73 74 73 29 29 0a 09 20 null? tests))..
8d40: 20 20 20 20 20 20 28 62 65 67 69 6e 0a 09 09 20 (begin...
8d50: 28 63 61 73 65 20 61 63 74 69 6f 6e 0a 09 09 20 (case action...
8d60: 20 20 28 28 72 65 6d 6f 76 65 2d 72 75 6e 73 29 ((remove-runs)
8d70: 0a 09 09 20 20 20 20 28 64 65 62 75 67 3a 70 72 ... (debug:pr
8d80: 69 6e 74 20 31 20 22 52 65 6d 6f 76 69 6e 67 20 int 1 "Removing
8d90: 74 65 73 74 73 20 66 6f 72 20 72 75 6e 3a 20 22 tests for run: "
8da0: 20 72 75 6e 6b 65 79 20 22 20 22 20 28 64 62 3a runkey " " (db:
8db0: 67 65 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 get-value-by-hea
8dc0: 64 65 72 20 72 75 6e 20 68 65 61 64 65 72 20 22 der run header "
8dd0: 72 75 6e 6e 61 6d 65 22 29 29 29 0a 09 09 20 20 runname")))...
8de0: 20 28 28 73 65 74 2d 73 74 61 74 65 2d 73 74 61 ((set-state-sta
8df0: 74 75 73 29 0a 09 09 20 20 20 20 28 64 65 62 75 tus)... (debu
8e00: 67 3a 70 72 69 6e 74 20 31 20 22 4d 6f 64 69 66 g:print 1 "Modif
8e10: 79 69 6e 67 20 73 74 61 74 65 20 61 6e 64 20 73 ying state and s
8e20: 74 61 75 73 20 66 6f 72 20 74 65 73 74 73 20 66 taus for tests f
8e30: 6f 72 20 72 75 6e 3a 20 22 20 72 75 6e 6b 65 79 or run: " runkey
8e40: 20 22 20 22 20 28 64 62 3a 67 65 74 2d 76 61 6c " " (db:get-val
8e50: 75 65 2d 62 79 2d 68 65 61 64 65 72 20 72 75 6e ue-by-header run
8e60: 20 68 65 61 64 65 72 20 22 72 75 6e 6e 61 6d 65 header "runname
8e70: 22 29 29 29 0a 09 09 20 20 20 28 28 70 72 69 6e ")))... ((prin
8e80: 74 2d 72 75 6e 29 0a 09 09 20 20 20 20 28 64 65 t-run)... (de
8e90: 62 75 67 3a 70 72 69 6e 74 20 31 20 22 50 72 69 bug:print 1 "Pri
8ea0: 6e 74 69 6e 67 20 69 6e 66 6f 20 66 6f 72 20 72 nting info for r
8eb0: 75 6e 20 22 20 72 75 6e 6b 65 79 20 22 2c 20 72 un " runkey ", r
8ec0: 75 6e 3d 22 20 72 75 6e 20 22 2c 20 74 65 73 74 un=" run ", test
8ed0: 73 3d 22 20 74 65 73 74 73 20 22 2c 20 68 65 61 s=" tests ", hea
8ee0: 64 65 72 3d 22 20 68 65 61 64 65 72 29 0a 09 09 der=" header)...
8ef0: 20 20 20 20 61 63 74 69 6f 6e 29 0a 09 09 20 20 action)...
8f00: 20 28 65 6c 73 65 0a 09 09 20 20 20 20 28 70 72 (else... (pr
8f10: 69 6e 74 20 22 49 4e 46 4f 3a 20 61 63 74 69 6f int "INFO: actio
8f20: 6e 20 6e 6f 74 20 72 65 63 6f 67 6e 69 73 65 64 n not recognised
8f30: 20 22 20 61 63 74 69 6f 6e 29 29 29 0a 09 09 20 " action)))...
8f40: 28 66 6f 72 2d 65 61 63 68 0a 09 09 20 20 28 6c (for-each... (l
8f50: 61 6d 62 64 61 20 28 74 65 73 74 29 0a 09 09 20 ambda (test)...
8f60: 20 20 20 28 6c 65 74 2a 20 28 28 69 74 65 6d 2d (let* ((item-
8f70: 70 61 74 68 20 28 64 62 3a 74 65 73 74 2d 67 65 path (db:test-ge
8f80: 74 2d 69 74 65 6d 2d 70 61 74 68 20 74 65 73 74 t-item-path test
8f90: 29 29 0a 09 09 09 20 20 20 28 74 65 73 74 2d 6e )).... (test-n
8fa0: 61 6d 65 20 28 64 62 3a 74 65 73 74 2d 67 65 74 ame (db:test-get
8fb0: 2d 74 65 73 74 6e 61 6d 65 20 74 65 73 74 29 29 -testname test))
8fc0: 0a 09 09 09 20 20 20 28 72 75 6e 2d 64 69 72 20 .... (run-dir
8fd0: 20 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 72 (db:test-get-r
8fe0: 75 6e 64 69 72 20 74 65 73 74 29 29 20 20 20 20 undir test))
8ff0: 3b 3b 20 72 75 6e 20 64 69 72 20 69 73 20 66 72 ;; run dir is fr
9000: 6f 6d 20 74 68 65 20 6c 69 6e 6b 20 74 72 65 65 om the link tree
9010: 0a 09 09 09 20 20 20 28 72 65 61 6c 2d 64 69 72 .... (real-dir
9020: 20 20 28 69 66 20 28 66 69 6c 65 2d 65 78 69 73 (if (file-exis
9030: 74 73 3f 20 72 75 6e 2d 64 69 72 29 0a 09 09 09 ts? run-dir)....
9040: 09 09 20 20 28 72 65 73 6f 6c 76 65 2d 70 61 74 .. (resolve-pat
9050: 68 6e 61 6d 65 20 72 75 6e 2d 64 69 72 29 0a 09 hname run-dir)..
9060: 09 09 09 09 20 20 23 66 29 29 0a 09 09 09 20 20 .... #f))....
9070: 20 28 74 65 73 74 2d 69 64 20 20 20 28 64 62 3a (test-id (db:
9080: 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 73 74 test-get-id test
9090: 29 29 29 0a 09 09 20 20 20 20 20 20 3b 3b 20 20 )))... ;;
90a0: 20 28 74 64 62 20 20 20 20 20 20 20 28 64 62 3a (tdb (db:
90b0: 6f 70 65 6e 2d 74 65 73 74 2d 64 62 20 72 75 6e open-test-db run
90c0: 2d 64 69 72 29 29 29 0a 09 09 20 20 20 20 20 20 -dir)))...
90d0: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 22 (debug:print 4 "
90e0: 49 4e 46 4f 3a 20 74 65 73 74 3d 22 20 74 65 73 INFO: test=" tes
90f0: 74 29 20 3b 3b 20 20 20 22 20 28 64 62 3a 74 65 t) ;; " (db:te
9100: 73 74 2d 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 st-get-testname
9110: 74 65 73 74 29 20 22 20 69 64 3a 20 22 20 28 64 test) " id: " (d
9120: 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 b:test-get-id te
9130: 73 74 29 20 22 20 22 20 69 74 65 6d 2d 70 61 74 st) " " item-pat
9140: 68 20 22 20 61 63 74 69 6f 6e 3a 20 22 20 61 63 h " action: " ac
9150: 74 69 6f 6e 29 0a 09 09 20 20 20 20 20 20 28 63 tion)... (c
9160: 61 73 65 20 61 63 74 69 6f 6e 0a 09 09 09 28 28 ase action....((
9170: 72 65 6d 6f 76 65 2d 72 75 6e 73 29 20 3b 3b 20 remove-runs) ;;
9180: 74 68 65 20 74 64 62 20 69 73 20 66 6f 72 20 66 the tdb is for f
9190: 75 74 75 72 65 20 70 6f 73 73 69 62 6c 65 2e 20 uture possible.
91a0: 0a 09 09 09 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 .... (open-run-c
91b0: 6c 6f 73 65 20 64 62 3a 64 65 6c 65 74 65 2d 74 lose db:delete-t
91c0: 65 73 74 2d 72 65 63 6f 72 64 73 20 64 62 20 23 est-records db #
91d0: 66 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 f (db:test-get-i
91e0: 64 20 74 65 73 74 29 29 0a 09 09 09 20 28 64 65 d test)).... (de
91f0: 62 75 67 3a 70 72 69 6e 74 20 31 20 22 49 4e 46 bug:print 1 "INF
9200: 4f 3a 20 41 74 74 65 6d 70 74 69 6e 67 20 74 6f O: Attempting to
9210: 20 72 65 6d 6f 76 65 20 64 69 72 20 22 20 72 65 remove dir " re
9220: 61 6c 2d 64 69 72 20 22 20 61 6e 64 20 6c 69 6e al-dir " and lin
9230: 6b 20 22 20 72 75 6e 2d 64 69 72 29 0a 09 09 09 k " run-dir)....
9240: 20 28 69 66 20 28 61 6e 64 20 72 65 61 6c 2d 64 (if (and real-d
9250: 69 72 20 0a 09 09 09 09 20 20 28 3e 20 28 73 74 ir ..... (> (st
9260: 72 69 6e 67 2d 6c 65 6e 67 74 68 20 72 65 61 6c ring-length real
9270: 2d 64 69 72 29 20 35 29 0a 09 09 09 09 20 20 28 -dir) 5)..... (
9280: 66 69 6c 65 2d 65 78 69 73 74 73 3f 20 72 65 61 file-exists? rea
9290: 6c 2d 64 69 72 29 29 20 3b 3b 20 62 61 64 20 68 l-dir)) ;; bad h
92a0: 65 75 72 69 73 74 69 63 20 62 75 74 20 73 68 6f euristic but sho
92b0: 75 6c 64 20 70 72 65 76 65 6e 74 20 2f 74 6d 70 uld prevent /tmp
92c0: 20 2f 68 6f 6d 65 20 65 74 63 2e 0a 09 09 09 20 /home etc.....
92d0: 20 20 20 20 28 62 65 67 69 6e 20 3b 3b 20 6c 65 (begin ;; le
92e0: 74 2a 20 28 28 72 65 61 6c 70 61 74 68 20 28 72 t* ((realpath (r
92f0: 65 73 6f 6c 76 65 2d 70 61 74 68 6e 61 6d 65 20 esolve-pathname
9300: 72 75 6e 2d 64 69 72 29 29 29 0a 09 09 09 20 20 run-dir)))....
9310: 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e (debug:prin
9320: 74 20 31 20 22 49 4e 46 4f 3a 20 52 65 63 75 72 t 1 "INFO: Recur
9330: 73 69 76 65 6c 79 20 72 65 6d 6f 76 69 6e 67 20 sively removing
9340: 22 20 72 65 61 6c 2d 64 69 72 29 0a 09 09 09 20 " real-dir)....
9350: 20 20 20 20 20 20 28 69 66 20 28 66 69 6c 65 2d (if (file-
9360: 65 78 69 73 74 73 3f 20 72 65 61 6c 2d 64 69 72 exists? real-dir
9370: 29 0a 09 09 09 09 20 20 20 28 69 66 20 28 3e 20 )..... (if (>
9380: 28 73 79 73 74 65 6d 20 28 63 6f 6e 63 20 22 72 (system (conc "r
9390: 6d 20 2d 72 66 20 22 20 72 65 61 6c 2d 64 69 72 m -rf " real-dir
93a0: 29 29 20 30 29 0a 09 09 09 09 20 20 20 20 20 20 )) 0).....
93b0: 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 20 (debug:print 0
93c0: 22 45 52 52 4f 52 3a 20 54 68 65 72 65 20 77 61 "ERROR: There wa
93d0: 73 20 61 20 70 72 6f 62 6c 65 6d 20 72 65 6d 6f s a problem remo
93e0: 76 69 6e 67 20 22 20 72 65 61 6c 2d 64 69 72 20 ving " real-dir
93f0: 22 20 77 69 74 68 20 72 6d 20 2d 66 22 29 29 0a " with rm -f")).
9400: 09 09 09 09 20 20 20 28 64 65 62 75 67 3a 70 72 .... (debug:pr
9410: 69 6e 74 20 30 20 22 57 41 52 4e 49 4e 47 3a 20 int 0 "WARNING:
9420: 74 65 73 74 20 72 75 6e 20 64 69 72 20 22 20 72 test run dir " r
9430: 65 61 6c 2d 64 69 72 20 22 20 61 70 70 65 61 72 eal-dir " appear
9440: 73 20 74 6f 20 6e 6f 74 20 65 78 69 73 74 22 29 s to not exist")
9450: 29 29 0a 09 09 09 20 20 20 20 20 28 64 65 62 75 )).... (debu
9460: 67 3a 70 72 69 6e 74 20 30 20 22 57 41 52 4e 49 g:print 0 "WARNI
9470: 4e 47 3a 20 64 69 72 65 63 74 6f 72 79 20 22 20 NG: directory "
9480: 72 65 61 6c 2d 64 69 72 20 22 20 64 6f 65 73 20 real-dir " does
9490: 6e 6f 74 20 65 78 69 73 74 22 29 29 0a 09 09 09 not exist"))....
94a0: 20 28 69 66 20 28 73 79 6d 62 6f 6c 69 63 2d 6c (if (symbolic-l
94b0: 69 6e 6b 3f 20 72 75 6e 2d 64 69 72 29 0a 09 09 ink? run-dir)...
94c0: 09 20 20 20 20 20 28 62 65 67 69 6e 0a 09 09 09 . (begin....
94d0: 20 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 72 (debug:pr
94e0: 69 6e 74 20 31 20 22 49 4e 46 4f 3a 20 52 65 6d int 1 "INFO: Rem
94f0: 6f 76 69 6e 67 20 73 79 6d 6c 69 6e 6b 20 22 20 oving symlink "
9500: 72 75 6e 2d 64 69 72 29 0a 09 09 09 20 20 20 20 run-dir)....
9510: 20 20 20 28 64 65 6c 65 74 65 2d 66 69 6c 65 20 (delete-file
9520: 72 75 6e 2d 64 69 72 29 29 0a 09 09 09 20 20 20 run-dir))....
9530: 20 20 28 69 66 20 28 64 69 72 65 63 74 6f 72 79 (if (directory
9540: 3f 20 72 75 6e 2d 64 69 72 29 0a 09 09 09 09 20 ? run-dir).....
9550: 28 69 66 20 28 3e 20 28 64 69 72 65 63 74 6f 72 (if (> (director
9560: 79 2d 66 6f 6c 64 20 28 6c 61 6d 62 64 61 20 28 y-fold (lambda (
9570: 66 20 78 29 28 2b 20 31 20 78 29 29 20 30 20 72 f x)(+ 1 x)) 0 r
9580: 75 6e 2d 64 69 72 29 20 30 29 0a 09 09 09 09 20 un-dir) 0).....
9590: 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 (debug:print
95a0: 20 30 20 22 57 41 52 4e 49 4e 47 3a 20 72 65 66 0 "WARNING: ref
95b0: 75 73 69 6e 67 20 74 6f 20 72 65 6d 6f 76 65 20 using to remove
95c0: 22 20 72 75 6e 2d 64 69 72 20 22 20 61 73 20 69 " run-dir " as i
95d0: 74 20 69 73 20 6e 6f 74 20 65 6d 70 74 79 22 29 t is not empty")
95e0: 0a 09 09 09 09 20 20 20 20 20 28 64 65 6c 65 74 ..... (delet
95f0: 65 2d 64 69 72 65 63 74 6f 72 79 20 72 75 6e 2d e-directory run-
9600: 64 69 72 29 29 20 3b 3b 20 69 74 20 73 68 6f 75 dir)) ;; it shou
9610: 6c 64 20 62 65 20 65 6d 70 74 79 20 62 79 20 68 ld be empty by h
9620: 65 72 65 20 42 55 47 20 42 55 47 2c 20 61 64 64 ere BUG BUG, add
9630: 20 65 72 72 6f 72 20 63 61 74 63 68 0a 09 09 09 error catch....
9640: 09 20 28 64 65 62 75 67 3a 70 72 69 6e 74 20 30 . (debug:print 0
9650: 20 22 45 52 52 4f 52 3a 20 72 65 66 75 73 69 6e "ERROR: refusin
9660: 67 20 74 6f 20 72 65 6d 6f 76 65 20 22 20 72 75 g to remove " ru
9670: 6e 2d 64 69 72 20 22 20 61 73 20 69 74 20 65 69 n-dir " as it ei
9680: 74 68 65 72 20 64 6f 65 73 6e 27 74 20 65 78 69 ther doesn't exi
9690: 73 74 20 6f 72 20 69 73 20 6e 6f 74 20 61 20 73 st or is not a s
96a0: 79 6d 6c 69 6e 6b 20 6f 72 20 64 69 72 65 63 74 ymlink or direct
96b0: 6f 72 79 22 29 0a 09 09 09 09 20 29 29 29 0a 09 ory")..... )))..
96c0: 09 09 28 28 73 65 74 2d 73 74 61 74 65 2d 73 74 ..((set-state-st
96d0: 61 74 75 73 29 0a 09 09 09 20 28 64 65 62 75 67 atus).... (debug
96e0: 3a 70 72 69 6e 74 20 32 20 22 49 4e 46 4f 3a 20 :print 2 "INFO:
96f0: 6e 65 77 20 73 74 61 74 65 20 22 20 28 63 61 72 new state " (car
9700: 20 73 74 61 74 65 2d 73 74 61 74 75 73 29 20 22 state-status) "
9710: 2c 20 6e 65 77 20 73 74 61 74 75 73 20 22 20 28 , new status " (
9720: 63 61 64 72 20 73 74 61 74 65 2d 73 74 61 74 75 cadr state-statu
9730: 73 29 29 0a 09 09 09 20 28 6f 70 65 6e 2d 72 75 s)).... (open-ru
9740: 6e 2d 63 6c 6f 73 65 20 64 62 3a 74 65 73 74 2d n-close db:test-
9750: 73 65 74 2d 73 74 61 74 65 2d 73 74 61 74 75 73 set-state-status
9760: 2d 62 79 2d 69 64 20 64 62 20 28 64 62 3a 74 65 -by-id db (db:te
9770: 73 74 2d 67 65 74 2d 69 64 20 74 65 73 74 29 20 st-get-id test)
9780: 28 63 61 72 20 73 74 61 74 65 2d 73 74 61 74 75 (car state-statu
9790: 73 29 28 63 61 64 72 20 73 74 61 74 65 2d 73 74 s)(cadr state-st
97a0: 61 74 75 73 29 20 23 66 29 29 29 29 29 0a 09 09 atus) #f)))))...
97b0: 20 20 28 73 6f 72 74 20 74 65 73 74 73 20 28 6c (sort tests (l
97c0: 61 6d 62 64 61 20 28 61 20 62 29 28 6c 65 74 20 ambda (a b)(let
97d0: 28 28 64 69 72 61 20 28 64 62 3a 74 65 73 74 2d ((dira (db:test-
97e0: 67 65 74 2d 72 75 6e 64 69 72 20 61 29 29 0a 09 get-rundir a))..
97f0: 09 09 09 09 09 20 28 64 69 72 62 20 28 64 62 3a ..... (dirb (db:
9800: 74 65 73 74 2d 67 65 74 2d 72 75 6e 64 69 72 20 test-get-rundir
9810: 62 29 29 29 0a 09 09 09 09 09 20 20 20 20 20 28 b)))...... (
9820: 69 66 20 28 61 6e 64 20 28 73 74 72 69 6e 67 3f if (and (string?
9830: 20 64 69 72 61 29 28 73 74 72 69 6e 67 3f 20 64 dira)(string? d
9840: 69 72 62 29 29 0a 09 09 09 09 09 09 20 28 3e 20 irb))....... (>
9850: 28 73 74 72 69 6e 67 2d 6c 65 6e 67 74 68 20 64 (string-length d
9860: 69 72 61 29 28 73 74 72 69 6e 67 2d 6c 65 6e 67 ira)(string-leng
9870: 74 68 20 64 69 72 62 29 29 0a 09 09 09 09 09 09 th dirb)).......
9880: 20 23 66 29 29 29 29 29 29 29 0a 09 20 20 20 3b #f))))))).. ;
9890: 3b 20 72 65 6d 6f 76 65 20 74 68 65 20 72 75 6e ; remove the run
98a0: 20 69 66 20 7a 65 72 6f 20 74 65 73 74 73 20 72 if zero tests r
98b0: 65 6d 61 69 6e 0a 09 20 20 20 28 69 66 20 28 65 emain.. (if (e
98c0: 71 3f 20 61 63 74 69 6f 6e 20 27 72 65 6d 6f 76 q? action 'remov
98d0: 65 2d 72 75 6e 73 29 0a 09 20 20 20 20 20 20 20 e-runs)..
98e0: 28 6c 65 74 20 28 28 72 65 6d 74 65 73 74 73 20 (let ((remtests
98f0: 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 (open-run-close
9900: 64 62 3a 67 65 74 2d 74 65 73 74 73 2d 66 6f 72 db:get-tests-for
9910: 2d 72 75 6e 20 64 62 20 28 64 62 3a 67 65 74 2d -run db (db:get-
9920: 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 20 value-by-header
9930: 72 75 6e 20 68 65 61 64 65 72 20 22 69 64 22 29 run header "id")
9940: 20 23 66 20 27 28 22 44 45 4c 45 54 45 44 22 29 #f '("DELETED")
9950: 20 27 28 22 6e 2f 61 22 29 20 6e 6f 74 2d 69 6e '("n/a") not-in
9960: 3a 20 23 74 29 29 29 0a 09 09 20 28 69 66 20 28 : #t)))... (if (
9970: 6e 75 6c 6c 3f 20 72 65 6d 74 65 73 74 73 29 20 null? remtests)
9980: 3b 3b 20 6e 6f 20 6d 6f 72 65 20 74 65 73 74 73 ;; no more tests
9990: 20 72 65 6d 61 69 6e 69 6e 67 0a 09 09 20 20 20 remaining...
99a0: 20 20 28 6c 65 74 2a 20 28 28 64 70 61 72 74 73 (let* ((dparts
99b0: 20 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 20 (string-split
99c0: 6c 61 73 74 74 70 61 74 68 20 22 2f 22 29 29 0a lasttpath "/")).
99d0: 09 09 09 20 20 20 20 28 72 75 6e 70 61 74 68 20 ... (runpath
99e0: 28 63 6f 6e 63 20 22 2f 22 20 28 73 74 72 69 6e (conc "/" (strin
99f0: 67 2d 69 6e 74 65 72 73 70 65 72 73 65 20 0a 09 g-intersperse ..
9a00: 09 09 09 09 09 28 74 61 6b 65 20 64 70 61 72 74 .....(take dpart
9a10: 73 20 28 2d 20 28 6c 65 6e 67 74 68 20 64 70 61 s (- (length dpa
9a20: 72 74 73 29 20 31 29 29 0a 09 09 09 09 09 09 22 rts) 1))......."
9a30: 2f 22 29 29 29 29 0a 09 09 20 20 20 20 20 20 20 /"))))...
9a40: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 31 20 22 (debug:print 1 "
9a50: 52 65 6d 6f 76 69 6e 67 20 72 75 6e 3a 20 22 20 Removing run: "
9a60: 72 75 6e 6b 65 79 20 22 20 22 20 28 64 62 3a 67 runkey " " (db:g
9a70: 65 74 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 et-value-by-head
9a80: 65 72 20 72 75 6e 20 68 65 61 64 65 72 20 22 72 er run header "r
9a90: 75 6e 6e 61 6d 65 22 29 20 22 20 61 6e 64 20 72 unname") " and r
9aa0: 65 6c 61 74 65 64 20 72 65 63 6f 72 64 22 29 0a elated record").
9ab0: 09 09 20 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 .. (open-r
9ac0: 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 64 65 6c 65 un-close db:dele
9ad0: 74 65 2d 72 75 6e 20 64 62 20 72 75 6e 2d 69 64 te-run db run-id
9ae0: 29 0a 09 09 20 20 20 20 20 20 20 3b 3b 20 54 68 )... ;; Th
9af0: 69 73 20 69 73 20 61 20 70 72 65 74 74 79 20 67 is is a pretty g
9b00: 6f 6f 64 20 70 6c 61 63 65 20 74 6f 20 70 75 72 ood place to pur
9b10: 67 65 20 6f 6c 64 20 44 45 4c 45 54 45 44 20 74 ge old DELETED t
9b20: 65 73 74 73 0a 09 09 20 20 20 20 20 20 20 28 6f ests... (o
9b30: 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 pen-run-close db
9b40: 3a 64 65 6c 65 74 65 2d 74 65 73 74 73 2d 66 6f :delete-tests-fo
9b50: 72 2d 72 75 6e 20 64 62 20 72 75 6e 2d 69 64 29 r-run db run-id)
9b60: 0a 09 09 20 20 20 20 20 20 20 28 6f 70 65 6e 2d ... (open-
9b70: 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 64 65 6c run-close db:del
9b80: 65 74 65 2d 6f 6c 64 2d 64 65 6c 65 74 65 64 2d ete-old-deleted-
9b90: 74 65 73 74 2d 72 65 63 6f 72 64 73 20 64 62 29 test-records db)
9ba0: 0a 09 09 20 20 20 20 20 20 20 28 6f 70 65 6e 2d ... (open-
9bb0: 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a 73 65 74 run-close db:set
9bc0: 2d 76 61 72 20 64 62 20 22 44 45 4c 45 54 45 44 -var db "DELETED
9bd0: 5f 54 45 53 54 53 22 20 28 63 75 72 72 65 6e 74 _TESTS" (current
9be0: 2d 73 65 63 6f 6e 64 73 29 29 0a 09 09 20 20 20 -seconds))...
9bf0: 20 20 20 20 3b 3b 20 6e 65 65 64 20 74 6f 20 66 ;; need to f
9c00: 69 67 75 72 65 20 6f 75 74 20 74 68 65 20 70 61 igure out the pa
9c10: 74 68 20 74 6f 20 74 68 65 20 72 75 6e 20 64 69 th to the run di
9c20: 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 69 74 20 r and remove it
9c30: 69 66 20 65 6d 70 74 79 0a 09 09 20 20 20 20 20 if empty...
9c40: 20 20 3b 3b 20 20 20 20 28 69 66 20 28 6e 75 6c ;; (if (nul
9c50: 6c 3f 20 28 67 6c 6f 62 20 28 63 6f 6e 63 20 72 l? (glob (conc r
9c60: 75 6e 70 61 74 68 20 22 2f 2a 22 29 29 29 0a 09 unpath "/*")))..
9c70: 09 20 20 20 20 20 20 20 3b 3b 20 20 20 20 20 20 . ;;
9c80: 20 20 28 62 65 67 69 6e 0a 09 09 20 20 20 20 20 (begin...
9c90: 20 20 3b 3b 20 09 20 28 64 65 62 75 67 3a 70 72 ;; . (debug:pr
9ca0: 69 6e 74 20 31 20 22 52 65 6d 6f 76 69 6e 67 20 int 1 "Removing
9cb0: 72 75 6e 20 64 69 72 20 22 20 72 75 6e 70 61 74 run dir " runpat
9cc0: 68 29 0a 09 09 20 20 20 20 20 20 20 3b 3b 20 09 h)... ;; .
9cd0: 20 28 73 79 73 74 65 6d 20 28 63 6f 6e 63 20 22 (system (conc "
9ce0: 72 6d 64 69 72 20 2d 70 20 22 20 72 75 6e 70 61 rmdir -p " runpa
9cf0: 74 68 29 29 29 29 0a 09 09 20 20 20 20 20 20 20 th))))...
9d00: 29 29 29 29 29 0a 09 20 29 29 0a 20 20 20 20 20 ))))).. )).
9d10: 72 75 6e 73 29 29 0a 20 20 23 74 29 0a 0a 3b 3b runs)). #t)..;;
9d20: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9d30: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9d40: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9d50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9d60: 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 52 6f 75 74 69 6e ======.;; Routin
9d70: 65 73 20 66 6f 72 20 6d 61 6e 69 70 75 6c 61 74 es for manipulat
9d80: 69 6e 67 20 72 75 6e 73 0a 3b 3b 3d 3d 3d 3d 3d ing runs.;;=====
9d90: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9da0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9db0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9dc0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
9dd0: 3d 0a 0a 3b 3b 20 53 69 6e 63 65 20 6d 61 6e 79 =..;; Since many
9de0: 20 63 61 6c 6c 73 20 74 6f 20 61 20 72 75 6e 20 calls to a run
9df0: 72 65 71 75 69 72 65 20 70 72 65 74 74 79 20 6d require pretty m
9e00: 75 63 68 20 74 68 65 20 73 61 6d 65 20 73 65 74 uch the same set
9e10: 75 70 20 0a 3b 3b 20 74 68 69 73 20 77 72 61 70 up .;; this wrap
9e20: 70 65 72 20 69 73 20 75 73 65 64 20 74 6f 20 72 per is used to r
9e30: 65 64 75 63 65 20 74 68 65 20 72 65 70 6c 69 63 educe the replic
9e40: 61 74 69 6f 6e 20 6f 66 20 63 6f 64 65 0a 28 64 ation of code.(d
9e50: 65 66 69 6e 65 20 28 67 65 6e 65 72 61 6c 2d 72 efine (general-r
9e60: 75 6e 2d 63 61 6c 6c 20 73 77 69 74 63 68 6e 61 un-call switchna
9e70: 6d 65 20 61 63 74 69 6f 6e 2d 64 65 73 63 20 70 me action-desc p
9e80: 72 6f 63 29 0a 20 20 28 6c 65 74 20 28 28 72 75 roc). (let ((ru
9e90: 6e 6e 61 6d 65 20 28 61 72 67 73 3a 67 65 74 2d nname (args:get-
9ea0: 61 72 67 20 22 3a 72 75 6e 6e 61 6d 65 22 29 29 arg ":runname"))
9eb0: 0a 09 28 74 61 72 67 65 74 20 20 28 69 66 20 28 ..(target (if (
9ec0: 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 74 args:get-arg "-t
9ed0: 61 72 67 65 74 22 29 0a 09 09 20 20 20 20 20 28 arget")... (
9ee0: 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 74 args:get-arg "-t
9ef0: 61 72 67 65 74 22 29 0a 09 09 20 20 20 20 20 28 arget")... (
9f00: 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 72 args:get-arg "-r
9f10: 65 71 74 61 72 67 22 29 29 29 0a 09 28 74 68 31 eqtarg")))..(th1
9f20: 20 20 20 20 20 23 66 29 29 0a 20 20 20 20 28 63 #f)). (c
9f30: 6f 6e 64 0a 20 20 20 20 20 28 28 6e 6f 74 20 74 ond. ((not t
9f40: 61 72 67 65 74 29 0a 20 20 20 20 20 20 28 64 65 arget). (de
9f50: 62 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 bug:print 0 "ERR
9f60: 4f 52 3a 20 4d 69 73 73 69 6e 67 20 72 65 71 75 OR: Missing requ
9f70: 69 72 65 64 20 70 61 72 61 6d 65 74 65 72 20 66 ired parameter f
9f80: 6f 72 20 22 20 73 77 69 74 63 68 6e 61 6d 65 20 or " switchname
9f90: 22 2c 20 79 6f 75 20 6d 75 73 74 20 73 70 65 63 ", you must spec
9fa0: 69 66 79 20 74 68 65 20 74 61 72 67 65 74 20 77 ify the target w
9fb0: 69 74 68 20 2d 74 61 72 67 65 74 22 29 0a 20 20 ith -target").
9fc0: 20 20 20 20 28 65 78 69 74 20 33 29 29 0a 20 20 (exit 3)).
9fd0: 20 20 20 28 28 6e 6f 74 20 72 75 6e 6e 61 6d 65 ((not runname
9fe0: 29 0a 20 20 20 20 20 20 28 64 65 62 75 67 3a 70 ). (debug:p
9ff0: 72 69 6e 74 20 30 20 22 45 52 52 4f 52 3a 20 4d rint 0 "ERROR: M
a000: 69 73 73 69 6e 67 20 72 65 71 75 69 72 65 64 20 issing required
a010: 70 61 72 61 6d 65 74 65 72 20 66 6f 72 20 22 20 parameter for "
a020: 73 77 69 74 63 68 6e 61 6d 65 20 22 2c 20 79 6f switchname ", yo
a030: 75 20 6d 75 73 74 20 73 70 65 63 69 66 79 20 74 u must specify t
a040: 68 65 20 72 75 6e 20 6e 61 6d 65 20 77 69 74 68 he run name with
a050: 20 3a 72 75 6e 6e 61 6d 65 20 72 75 6e 6e 61 6d :runname runnam
a060: 65 22 29 0a 20 20 20 20 20 20 28 65 78 69 74 20 e"). (exit
a070: 33 29 29 0a 20 20 20 20 20 28 65 6c 73 65 0a 20 3)). (else.
a080: 20 20 20 20 20 28 6c 65 74 20 28 28 64 62 20 20 (let ((db
a090: 20 23 66 29 0a 09 20 20 20 20 28 6b 65 79 73 20 #f).. (keys
a0a0: 23 66 29 29 0a 09 28 69 66 20 28 6e 6f 74 20 28 #f))..(if (not (
a0b0: 73 65 74 75 70 2d 66 6f 72 2d 72 75 6e 29 29 0a setup-for-run)).
a0c0: 09 20 20 20 20 28 62 65 67 69 6e 20 0a 09 20 20 . (begin ..
a0d0: 20 20 20 20 28 64 65 62 75 67 3a 70 72 69 6e 74 (debug:print
a0e0: 20 30 20 22 46 61 69 6c 65 64 20 74 6f 20 73 65 0 "Failed to se
a0f0: 74 75 70 2c 20 65 78 69 74 69 6e 67 22 29 0a 09 tup, exiting")..
a100: 20 20 20 20 20 20 28 65 78 69 74 20 31 29 29 29 (exit 1)))
a110: 0a 09 28 69 66 20 28 61 72 67 73 3a 67 65 74 2d ..(if (args:get-
a120: 61 72 67 20 22 2d 73 65 72 76 65 72 22 29 0a 09 arg "-server")..
a130: 20 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c (open-run-cl
a140: 6f 73 65 20 73 65 72 76 65 72 3a 73 74 61 72 74 ose server:start
a150: 20 64 62 20 28 61 72 67 73 3a 67 65 74 2d 61 72 db (args:get-ar
a160: 67 20 22 2d 73 65 72 76 65 72 22 29 29 0a 20 09 g "-server")). .
a170: 20 20 20 20 28 69 66 20 28 6e 6f 74 20 28 6f 72 (if (not (or
a180: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
a190: 2d 72 75 6e 61 6c 6c 22 29 20 20 20 20 20 3b 3b -runall") ;;
a1a0: 20 72 75 6e 61 6c 6c 20 61 6e 64 20 72 75 6e 74 runall and runt
a1b0: 65 73 74 73 20 61 72 65 20 61 6c 6c 6f 77 65 64 ests are allowed
a1c0: 20 74 6f 20 62 65 20 73 65 72 76 65 72 73 0a 20 to be servers.
a1d0: 09 09 09 20 28 61 72 67 73 3a 67 65 74 2d 61 72 ... (args:get-ar
a1e0: 67 20 22 2d 72 75 6e 74 65 73 74 73 22 29 29 29 g "-runtests")))
a1f0: 0a 09 09 28 73 65 72 76 65 72 3a 63 6c 69 65 6e ...(server:clien
a200: 74 2d 73 65 74 75 70 29 29 29 0a 09 28 73 65 74 t-setup)))..(set
a210: 21 20 6b 65 79 73 20 28 6f 70 65 6e 2d 72 75 6e ! keys (open-run
a220: 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d 6b 65 -close db:get-ke
a230: 79 73 20 64 62 29 29 0a 09 3b 3b 20 68 61 76 65 ys db))..;; have
a240: 20 65 6e 6f 75 67 68 20 74 6f 20 70 72 6f 63 65 enough to proce
a250: 73 73 20 2d 74 61 72 67 65 74 20 6f 72 20 2d 72 ss -target or -r
a260: 65 71 74 61 72 67 20 68 65 72 65 0a 09 28 69 66 eqtarg here..(if
a270: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
a280: 2d 72 65 71 74 61 72 67 22 29 0a 09 20 20 20 20 -reqtarg")..
a290: 28 6c 65 74 2a 20 28 28 72 75 6e 63 6f 6e 66 69 (let* ((runconfi
a2a0: 67 66 20 28 63 6f 6e 63 20 20 2a 74 6f 70 70 61 gf (conc *toppa
a2b0: 74 68 2a 20 22 2f 72 75 6e 63 6f 6e 66 69 67 73 th* "/runconfigs
a2c0: 2e 63 6f 6e 66 69 67 22 29 29 20 3b 3b 20 44 4f .config")) ;; DO
a2d0: 20 4e 4f 54 20 45 56 41 4c 55 41 54 45 20 41 4c NOT EVALUATE AL
a2e0: 4c 20 0a 09 09 20 20 20 28 72 75 6e 63 6f 6e 66 L ... (runconf
a2f0: 69 67 20 20 28 72 65 61 64 2d 63 6f 6e 66 69 67 ig (read-config
a300: 20 72 75 6e 63 6f 6e 66 69 67 66 20 23 66 20 23 runconfigf #f #
a310: 66 20 65 6e 76 69 72 6f 6e 2d 70 61 74 74 3a 20 f environ-patt:
a320: 23 66 29 29 29 20 0a 09 20 20 20 20 20 20 28 69 #f))) .. (i
a330: 66 20 28 68 61 73 68 2d 74 61 62 6c 65 2d 72 65 f (hash-table-re
a340: 66 2f 64 65 66 61 75 6c 74 20 72 75 6e 63 6f 6e f/default runcon
a350: 66 69 67 20 28 61 72 67 73 3a 67 65 74 2d 61 72 fig (args:get-ar
a360: 67 20 22 2d 72 65 71 74 61 72 67 22 29 20 23 66 g "-reqtarg") #f
a370: 29 0a 09 09 20 20 28 6b 65 79 73 3a 74 61 72 67 )... (keys:targ
a380: 65 74 2d 73 65 74 2d 61 72 67 73 20 6b 65 79 73 et-set-args keys
a390: 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 20 22 (args:get-arg "
a3a0: 2d 72 65 71 74 61 72 67 22 29 20 61 72 67 73 3a -reqtarg") args:
a3b0: 61 72 67 2d 68 61 73 68 29 0a 09 09 20 20 28 62 arg-hash)... (b
a3c0: 65 67 69 6e 0a 09 09 20 20 20 20 28 64 65 62 75 egin... (debu
a3d0: 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f 52 g:print 0 "ERROR
a3e0: 3a 20 5b 22 20 28 61 72 67 73 3a 67 65 74 2d 61 : [" (args:get-a
a3f0: 72 67 20 22 2d 72 65 71 74 61 72 67 22 29 20 22 rg "-reqtarg") "
a400: 5d 20 6e 6f 74 20 66 6f 75 6e 64 20 69 6e 20 22 ] not found in "
a410: 20 72 75 6e 63 6f 6e 66 69 67 66 29 0a 09 09 20 runconfigf)...
a420: 20 20 20 28 69 66 20 64 62 20 28 73 71 6c 69 74 (if db (sqlit
a430: 65 33 3a 66 69 6e 61 6c 69 7a 65 21 20 64 62 29 e3:finalize! db)
a440: 29 0a 09 09 20 20 20 20 28 65 78 69 74 20 31 29 )... (exit 1)
a450: 29 29 29 0a 09 20 20 20 20 28 69 66 20 28 61 72 ))).. (if (ar
a460: 67 73 3a 67 65 74 2d 61 72 67 20 22 2d 74 61 72 gs:get-arg "-tar
a470: 67 65 74 22 29 0a 09 09 28 6b 65 79 73 3a 74 61 get")...(keys:ta
a480: 72 67 65 74 2d 73 65 74 2d 61 72 67 73 20 6b 65 rget-set-args ke
a490: 79 73 20 28 61 72 67 73 3a 67 65 74 2d 61 72 67 ys (args:get-arg
a4a0: 20 22 2d 74 61 72 67 65 74 22 20 61 72 67 73 3a "-target" args:
a4b0: 61 72 67 2d 68 61 73 68 29 20 61 72 67 73 3a 61 arg-hash) args:a
a4c0: 72 67 2d 68 61 73 68 29 29 29 0a 09 28 69 66 20 rg-hash)))..(if
a4d0: 28 6e 6f 74 20 28 63 61 72 20 2a 63 6f 6e 66 69 (not (car *confi
a4e0: 67 69 6e 66 6f 2a 29 29 0a 09 20 20 20 20 28 62 ginfo*)).. (b
a4f0: 65 67 69 6e 0a 09 20 20 20 20 20 20 28 64 65 62 egin.. (deb
a500: 75 67 3a 70 72 69 6e 74 20 30 20 22 45 52 52 4f ug:print 0 "ERRO
a510: 52 3a 20 41 74 74 65 6d 70 74 65 64 20 74 6f 20 R: Attempted to
a520: 22 20 61 63 74 69 6f 6e 2d 64 65 73 63 20 22 20 " action-desc "
a530: 62 75 74 20 72 75 6e 20 61 72 65 61 20 63 6f 6e but run area con
a540: 66 69 67 20 66 69 6c 65 20 6e 6f 74 20 66 6f 75 fig file not fou
a550: 6e 64 22 29 0a 09 20 20 20 20 20 20 28 65 78 69 nd").. (exi
a560: 74 20 31 29 29 0a 09 20 20 20 20 3b 3b 20 45 78 t 1)).. ;; Ex
a570: 74 72 61 63 74 20 6f 75 74 20 73 74 75 66 66 20 tract out stuff
a580: 6e 65 65 64 65 64 20 69 6e 20 6d 6f 73 74 20 6f needed in most o
a590: 72 20 6d 61 6e 79 20 63 61 6c 6c 73 0a 09 20 20 r many calls..
a5a0: 20 20 3b 3b 20 68 65 72 65 20 74 68 65 6e 20 63 ;; here then c
a5b0: 61 6c 6c 20 70 72 6f 63 0a 09 20 20 20 20 28 6c all proc.. (l
a5c0: 65 74 2a 20 28 28 6b 65 79 6e 61 6d 65 73 20 20 et* ((keynames
a5d0: 20 28 6d 61 70 20 6b 65 79 3a 67 65 74 2d 66 69 (map key:get-fi
a5e0: 65 6c 64 6e 61 6d 65 20 6b 65 79 73 29 29 0a 09 eldname keys))..
a5f0: 09 20 20 20 28 6b 65 79 76 61 6c 6c 73 74 20 20 . (keyvallst
a600: 28 6b 65 79 73 2d 3e 76 61 6c 6c 69 73 74 20 6b (keys->vallist k
a610: 65 79 73 20 23 74 29 29 29 0a 09 20 20 20 20 20 eys #t)))..
a620: 20 28 70 72 6f 63 20 74 61 72 67 65 74 20 72 75 (proc target ru
a630: 6e 6e 61 6d 65 20 6b 65 79 73 20 6b 65 79 6e 61 nname keys keyna
a640: 6d 65 73 20 6b 65 79 76 61 6c 6c 73 74 29 29 29 mes keyvallst)))
a650: 0a 09 28 69 66 20 74 68 31 20 28 74 68 72 65 61 ..(if th1 (threa
a660: 64 2d 6a 6f 69 6e 21 20 74 68 31 29 29 0a 09 28 d-join! th1))..(
a670: 69 66 20 64 62 20 28 73 71 6c 69 74 65 33 3a 66 if db (sqlite3:f
a680: 69 6e 61 6c 69 7a 65 21 20 64 62 29 29 0a 09 28 inalize! db))..(
a690: 73 65 74 21 20 2a 64 69 64 73 6f 6d 65 74 68 69 set! *didsomethi
a6a0: 6e 67 2a 20 23 74 29 29 29 29 29 29 0a 0a 3b 3b ng* #t))))))..;;
a6b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a6c0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a6d0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a6e0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a6f0: 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 4c 6f 63 6b 2f 75 ======.;; Lock/u
a700: 6e 6c 6f 63 6b 20 72 75 6e 73 0a 3b 3b 3d 3d 3d nlock runs.;;===
a710: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a720: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a730: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a740: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a750: 3d 3d 3d 0a 0a 28 64 65 66 69 6e 65 20 28 72 75 ===..(define (ru
a760: 6e 73 3a 68 61 6e 64 6c 65 2d 6c 6f 63 6b 69 6e ns:handle-lockin
a770: 67 20 74 61 72 67 65 74 20 6b 65 79 73 20 72 75 g target keys ru
a780: 6e 6e 61 6d 65 20 6c 6f 63 6b 20 75 6e 6c 6f 63 nname lock unloc
a790: 6b 20 75 73 65 72 29 0a 20 20 28 6c 65 74 2a 20 k user). (let*
a7a0: 28 28 64 62 20 20 20 20 20 20 20 23 66 29 0a 09 ((db #f)..
a7b0: 20 28 72 75 6e 64 61 74 20 20 20 28 6f 70 65 6e (rundat (open
a7c0: 2d 72 75 6e 2d 63 6c 6f 73 65 20 72 75 6e 73 3a -run-close runs:
a7d0: 67 65 74 2d 72 75 6e 73 2d 62 79 2d 70 61 74 74 get-runs-by-patt
a7e0: 20 64 62 20 6b 65 79 73 20 72 75 6e 6e 61 6d 65 db keys runname
a7f0: 29 29 0a 09 20 28 68 65 61 64 65 72 20 20 20 28 )).. (header (
a800: 76 65 63 74 6f 72 2d 72 65 66 20 72 75 6e 64 61 vector-ref runda
a810: 74 20 30 29 29 0a 09 20 28 72 75 6e 73 20 20 20 t 0)).. (runs
a820: 20 20 28 76 65 63 74 6f 72 2d 72 65 66 20 72 75 (vector-ref ru
a830: 6e 64 61 74 20 31 29 29 29 0a 20 20 20 20 28 66 ndat 1))). (f
a840: 6f 72 2d 65 61 63 68 20 28 6c 61 6d 62 64 61 20 or-each (lambda
a850: 28 72 75 6e 29 0a 09 09 28 6c 65 74 20 28 28 72 (run)...(let ((r
a860: 75 6e 2d 69 64 20 28 64 62 3a 67 65 74 2d 76 61 un-id (db:get-va
a870: 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 20 72 75 lue-by-header ru
a880: 6e 20 68 65 61 64 65 72 20 22 69 64 22 29 29 29 n header "id")))
a890: 0a 09 09 20 20 28 69 66 20 28 6f 72 20 6c 6f 63 ... (if (or loc
a8a0: 6b 0a 09 09 09 20 20 28 61 6e 64 20 75 6e 6c 6f k.... (and unlo
a8b0: 63 6b 0a 09 09 09 20 20 20 20 20 20 20 28 62 65 ck.... (be
a8c0: 67 69 6e 0a 09 09 09 09 20 28 70 72 69 6e 74 20 gin..... (print
a8d0: 22 44 6f 20 79 6f 75 20 72 65 61 6c 6c 79 20 77 "Do you really w
a8e0: 69 73 68 20 74 6f 20 75 6e 6c 6f 63 6b 20 72 75 ish to unlock ru
a8f0: 6e 20 22 20 72 75 6e 2d 69 64 20 22 3f 5c 6e 20 n " run-id "?\n
a900: 20 20 79 2f 6e 3a 20 22 29 0a 09 09 09 09 20 28 y/n: ")..... (
a910: 65 71 75 61 6c 3f 20 22 79 22 20 28 72 65 61 64 equal? "y" (read
a920: 2d 6c 69 6e 65 29 29 29 29 29 0a 09 09 20 20 20 -line)))))...
a930: 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f (open-run-clo
a940: 73 65 20 64 62 3a 6c 6f 63 6b 2f 75 6e 6c 6f 63 se db:lock/unloc
a950: 6b 2d 72 75 6e 20 64 62 20 72 75 6e 2d 69 64 20 k-run db run-id
a960: 6c 6f 63 6b 20 75 6e 6c 6f 63 6b 20 75 73 65 72 lock unlock user
a970: 29 0a 09 09 20 20 20 20 20 20 28 64 65 62 75 67 )... (debug
a980: 3a 70 72 69 6e 74 20 30 20 22 49 4e 46 4f 3a 20 :print 0 "INFO:
a990: 53 6b 69 70 70 69 6e 67 20 6c 6f 63 6b 2f 75 6e Skipping lock/un
a9a0: 6c 6f 63 6b 20 6f 6e 20 22 20 72 75 6e 2d 69 64 lock on " run-id
a9b0: 29 29 29 29 0a 09 20 20 20 20 20 20 72 75 6e 73 )))).. runs
a9c0: 29 29 29 0a 3b 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ))).;;==========
a9d0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a9e0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
a9f0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa00: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 3b 3b 20 ============.;;
aa10: 52 6f 6c 6c 75 70 20 72 75 6e 73 0a 3b 3b 3d 3d Rollup runs.;;==
aa20: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa30: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa40: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
aa60: 3d 3d 3d 3d 0a 0a 3b 3b 20 55 70 64 61 74 65 20 ====..;; Update
aa70: 74 68 65 20 74 65 73 74 5f 6d 65 74 61 20 74 61 the test_meta ta
aa80: 62 6c 65 20 66 6f 72 20 74 68 69 73 20 74 65 73 ble for this tes
aa90: 74 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 3a t.(define (runs:
aaa0: 75 70 64 61 74 65 2d 74 65 73 74 5f 6d 65 74 61 update-test_meta
aab0: 20 64 62 20 74 65 73 74 2d 6e 61 6d 65 20 74 65 db test-name te
aac0: 73 74 2d 63 6f 6e 66 29 0a 20 20 28 6c 65 74 20 st-conf). (let
aad0: 28 28 63 75 72 72 72 65 63 6f 72 64 20 28 6f 70 ((currrecord (op
aae0: 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 64 62 3a en-run-close db:
aaf0: 74 65 73 74 6d 65 74 61 2d 67 65 74 2d 72 65 63 testmeta-get-rec
ab00: 6f 72 64 20 64 62 20 74 65 73 74 2d 6e 61 6d 65 ord db test-name
ab10: 29 29 29 0a 20 20 20 20 28 69 66 20 28 6e 6f 74 ))). (if (not
ab20: 20 63 75 72 72 72 65 63 6f 72 64 29 0a 09 28 62 currrecord)..(b
ab30: 65 67 69 6e 0a 09 20 20 28 73 65 74 21 20 63 75 egin.. (set! cu
ab40: 72 72 72 65 63 6f 72 64 20 28 6d 61 6b 65 2d 76 rrrecord (make-v
ab50: 65 63 74 6f 72 20 31 30 20 23 66 29 29 0a 09 20 ector 10 #f))..
ab60: 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 (open-run-close
ab70: 20 64 62 3a 74 65 73 74 6d 65 74 61 2d 61 64 64 db:testmeta-add
ab80: 2d 72 65 63 6f 72 64 20 64 62 20 74 65 73 74 2d -record db test-
ab90: 6e 61 6d 65 29 29 29 0a 20 20 20 20 28 66 6f 72 name))). (for
aba0: 2d 65 61 63 68 20 0a 20 20 20 20 20 28 6c 61 6d -each . (lam
abb0: 62 64 61 20 28 6b 65 79 29 0a 20 20 20 20 20 20 bda (key).
abc0: 20 28 6c 65 74 2a 20 28 28 69 64 78 20 28 63 61 (let* ((idx (ca
abd0: 64 72 20 6b 65 79 29 29 0a 09 20 20 20 20 20 20 dr key))..
abe0: 28 66 6c 64 20 28 63 61 72 20 20 6b 65 79 29 29 (fld (car key))
abf0: 0a 09 20 20 20 20 20 20 28 76 61 6c 20 28 63 6f .. (val (co
ac00: 6e 66 69 67 2d 6c 6f 6f 6b 75 70 20 74 65 73 74 nfig-lookup test
ac10: 2d 63 6f 6e 66 20 22 74 65 73 74 5f 6d 65 74 61 -conf "test_meta
ac20: 22 20 66 6c 64 29 29 29 0a 09 20 3b 3b 20 28 64 " fld))).. ;; (d
ac30: 65 62 75 67 3a 70 72 69 6e 74 20 35 20 22 69 64 ebug:print 5 "id
ac40: 78 3a 20 22 20 69 64 78 20 22 20 66 6c 64 3a 20 x: " idx " fld:
ac50: 22 20 66 6c 64 20 22 20 76 61 6c 3a 20 22 20 76 " fld " val: " v
ac60: 61 6c 29 0a 09 20 28 69 66 20 28 61 6e 64 20 76 al).. (if (and v
ac70: 61 6c 20 28 6e 6f 74 20 28 65 71 75 61 6c 3f 20 al (not (equal?
ac80: 28 76 65 63 74 6f 72 2d 72 65 66 20 63 75 72 72 (vector-ref curr
ac90: 72 65 63 6f 72 64 20 69 64 78 29 20 76 61 6c 29 record idx) val)
aca0: 29 29 0a 09 20 20 20 20 20 28 62 65 67 69 6e 0a )).. (begin.
acb0: 09 20 20 20 20 20 20 20 28 70 72 69 6e 74 20 22 . (print "
acc0: 55 70 64 61 74 69 6e 67 20 22 20 74 65 73 74 2d Updating " test-
acd0: 6e 61 6d 65 20 22 20 22 20 66 6c 64 20 22 20 74 name " " fld " t
ace0: 6f 20 22 20 76 61 6c 29 0a 09 20 20 20 20 20 20 o " val)..
acf0: 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 (open-run-close
ad00: 20 64 62 3a 74 65 73 74 6d 65 74 61 2d 75 70 64 db:testmeta-upd
ad10: 61 74 65 2d 66 69 65 6c 64 20 64 62 20 74 65 73 ate-field db tes
ad20: 74 2d 6e 61 6d 65 20 66 6c 64 20 76 61 6c 29 29 t-name fld val))
ad30: 29 29 29 0a 20 20 20 20 20 27 28 28 22 61 75 74 ))). '(("aut
ad40: 68 6f 72 22 20 32 29 28 22 6f 77 6e 65 72 22 20 hor" 2)("owner"
ad50: 33 29 28 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3)("description"
ad60: 20 34 29 28 22 72 65 76 69 65 77 65 64 22 20 35 4)("reviewed" 5
ad70: 29 28 22 74 61 67 73 22 20 39 29 29 29 29 29 0a )("tags" 9))))).
ad80: 0a 3b 3b 20 55 70 64 61 74 65 20 74 65 73 74 5f .;; Update test_
ad90: 6d 65 74 61 20 66 6f 72 20 61 6c 6c 20 74 65 73 meta for all tes
ada0: 74 73 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 ts.(define (runs
adb0: 3a 75 70 64 61 74 65 2d 61 6c 6c 2d 74 65 73 74 :update-all-test
adc0: 5f 6d 65 74 61 20 64 62 29 0a 20 20 28 6c 65 74 _meta db). (let
add0: 20 28 28 74 65 73 74 2d 6e 61 6d 65 73 20 28 67 ((test-names (g
ade0: 65 74 2d 61 6c 6c 2d 6c 65 67 61 6c 2d 74 65 73 et-all-legal-tes
adf0: 74 73 29 29 29 0a 20 20 20 20 28 66 6f 72 2d 65 ts))). (for-e
ae00: 61 63 68 20 0a 20 20 20 20 20 28 6c 61 6d 62 64 ach . (lambd
ae10: 61 20 28 74 65 73 74 2d 6e 61 6d 65 29 0a 20 20 a (test-name).
ae20: 20 20 20 20 20 28 6c 65 74 2a 20 28 28 74 65 73 (let* ((tes
ae30: 74 2d 70 61 74 68 20 20 20 20 28 63 6f 6e 63 20 t-path (conc
ae40: 2a 74 6f 70 70 61 74 68 2a 20 22 2f 74 65 73 74 *toppath* "/test
ae50: 73 2f 22 20 74 65 73 74 2d 6e 61 6d 65 29 29 0a s/" test-name)).
ae60: 09 20 20 20 20 20 20 28 74 65 73 74 2d 63 6f 6e . (test-con
ae70: 66 69 67 66 20 28 63 6f 6e 63 20 74 65 73 74 2d figf (conc test-
ae80: 70 61 74 68 20 22 2f 74 65 73 74 63 6f 6e 66 69 path "/testconfi
ae90: 67 22 29 29 0a 09 20 20 20 20 20 20 28 74 65 73 g")).. (tes
aea0: 74 65 78 69 73 74 73 20 20 20 28 61 6e 64 20 28 texists (and (
aeb0: 66 69 6c 65 2d 65 78 69 73 74 73 3f 20 74 65 73 file-exists? tes
aec0: 74 2d 63 6f 6e 66 69 67 66 29 28 66 69 6c 65 2d t-configf)(file-
aed0: 72 65 61 64 2d 61 63 63 65 73 73 3f 20 74 65 73 read-access? tes
aee0: 74 2d 63 6f 6e 66 69 67 66 29 29 29 0a 09 20 20 t-configf)))..
aef0: 20 20 20 20 3b 3b 20 72 65 61 64 20 63 6f 6e 66 ;; read conf
af00: 69 67 73 20 77 69 74 68 20 74 72 69 63 6b 73 20 igs with tricks
af10: 74 75 72 6e 65 64 20 6f 66 66 20 28 69 2e 65 2e turned off (i.e.
af20: 20 6e 6f 20 73 79 73 74 65 6d 29 0a 09 20 20 20 no system)..
af30: 20 20 20 28 74 65 73 74 2d 63 6f 6e 66 20 20 20 (test-conf
af40: 20 28 69 66 20 74 65 73 74 65 78 69 73 74 73 20 (if testexists
af50: 28 72 65 61 64 2d 63 6f 6e 66 69 67 20 74 65 73 (read-config tes
af60: 74 2d 63 6f 6e 66 69 67 66 20 23 66 20 23 66 29 t-configf #f #f)
af70: 28 6d 61 6b 65 2d 68 61 73 68 2d 74 61 62 6c 65 (make-hash-table
af80: 29 29 29 29 0a 09 20 3b 3b 20 75 73 65 20 74 68 )))).. ;; use th
af90: 65 20 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 e open-run-close
afa0: 20 69 6e 73 74 65 61 64 20 6f 66 20 70 61 73 73 instead of pass
afb0: 69 6e 67 20 69 6e 20 64 62 0a 09 20 28 72 75 6e ing in db.. (run
afc0: 73 3a 75 70 64 61 74 65 2d 74 65 73 74 5f 6d 65 s:update-test_me
afd0: 74 61 20 23 66 20 74 65 73 74 2d 6e 61 6d 65 20 ta #f test-name
afe0: 74 65 73 74 2d 63 6f 6e 66 29 29 29 0a 20 20 20 test-conf))).
aff0: 20 20 74 65 73 74 2d 6e 61 6d 65 73 29 29 29 0a test-names))).
b000: 0a 3b 3b 20 54 68 69 73 20 63 6f 75 6c 64 20 70 .;; This could p
b010: 72 6f 62 61 62 6c 79 20 62 65 20 72 65 66 61 63 robably be refac
b020: 74 6f 72 65 64 20 69 6e 74 6f 20 6f 6e 65 20 63 tored into one c
b030: 6f 6d 70 6c 65 78 20 71 75 65 72 79 20 2e 2e 2e omplex query ...
b040: 0a 28 64 65 66 69 6e 65 20 28 72 75 6e 73 3a 72 .(define (runs:r
b050: 6f 6c 6c 75 70 2d 72 75 6e 20 6b 65 79 73 20 6b ollup-run keys k
b060: 65 79 76 61 6c 6c 73 74 20 72 75 6e 6e 61 6d 65 eyvallst runname
b070: 20 75 73 65 72 29 20 3b 3b 20 77 61 73 20 74 61 user) ;; was ta
b080: 72 67 65 74 2c 20 6e 6f 77 20 6b 65 79 76 61 6c rget, now keyval
b090: 6c 73 74 0a 20 20 28 64 65 62 75 67 3a 70 72 69 lst. (debug:pri
b0a0: 6e 74 20 34 20 22 72 75 6e 73 3a 72 6f 6c 6c 75 nt 4 "runs:rollu
b0b0: 70 2d 72 75 6e 2c 20 6b 65 79 73 3a 20 22 20 6b p-run, keys: " k
b0c0: 65 79 73 20 22 20 6b 65 79 76 61 6c 6c 73 74 3a eys " keyvallst:
b0d0: 20 22 20 6b 65 79 76 61 6c 6c 73 74 20 22 20 3a " keyvallst " :
b0e0: 72 75 6e 6e 61 6d 65 20 22 20 72 75 6e 6e 61 6d runname " runnam
b0f0: 65 20 22 20 75 73 65 72 3a 20 22 20 75 73 65 72 e " user: " user
b100: 29 0a 20 20 28 6c 65 74 2a 20 28 28 64 62 20 20 ). (let* ((db
b110: 20 20 20 20 20 20 20 20 20 20 20 20 23 66 29 20 #f)
b120: 3b 3b 20 28 6b 65 79 76 61 6c 6c 6c 73 74 20 20 ;; (keyvalllst
b130: 20 20 20 20 28 6b 65 79 73 3a 74 61 72 67 65 74 (keys:target
b140: 2d 3e 6b 65 79 76 61 6c 20 6b 65 79 73 20 74 61 ->keyval keys ta
b150: 72 67 65 74 29 29 0a 09 20 28 6e 65 77 2d 72 75 rget)).. (new-ru
b160: 6e 2d 69 64 20 20 20 20 20 20 28 6f 70 65 6e 2d n-id (open-
b170: 72 75 6e 2d 63 6c 6f 73 65 20 72 75 6e 73 3a 72 run-close runs:r
b180: 65 67 69 73 74 65 72 2d 72 75 6e 20 64 62 20 6b egister-run db k
b190: 65 79 73 20 6b 65 79 76 61 6c 6c 73 74 20 72 75 eys keyvallst ru
b1a0: 6e 6e 61 6d 65 20 22 6e 65 77 22 20 22 6e 2f 61 nname "new" "n/a
b1b0: 22 20 75 73 65 72 29 29 0a 09 20 28 70 72 65 76 " user)).. (prev
b1c0: 2d 74 65 73 74 73 20 20 20 20 20 20 28 6f 70 65 -tests (ope
b1d0: 6e 2d 72 75 6e 2d 63 6c 6f 73 65 20 74 65 73 74 n-run-close test
b1e0: 3a 67 65 74 2d 6d 61 74 63 68 69 6e 67 2d 70 72 :get-matching-pr
b1f0: 65 76 69 6f 75 73 2d 74 65 73 74 2d 72 75 6e 2d evious-test-run-
b200: 72 65 63 6f 72 64 73 20 64 62 20 6e 65 77 2d 72 records db new-r
b210: 75 6e 2d 69 64 20 22 25 22 20 22 25 22 29 29 0a un-id "%" "%")).
b220: 09 20 28 63 75 72 72 2d 74 65 73 74 73 20 20 20 . (curr-tests
b230: 20 20 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f (open-run-clo
b240: 73 65 20 64 62 3a 67 65 74 2d 74 65 73 74 73 2d se db:get-tests-
b250: 66 6f 72 2d 72 75 6e 20 64 62 20 6e 65 77 2d 72 for-run db new-r
b260: 75 6e 2d 69 64 20 22 25 2f 25 22 20 27 28 29 20 un-id "%/%" '()
b270: 27 28 29 29 29 0a 09 20 28 63 75 72 72 2d 74 65 '())).. (curr-te
b280: 73 74 73 2d 68 61 73 68 20 28 6d 61 6b 65 2d 68 sts-hash (make-h
b290: 61 73 68 2d 74 61 62 6c 65 29 29 29 0a 20 20 20 ash-table))).
b2a0: 20 28 6f 70 65 6e 2d 72 75 6e 2d 63 6c 6f 73 65 (open-run-close
b2b0: 20 64 62 3a 75 70 64 61 74 65 2d 72 75 6e 2d 65 db:update-run-e
b2c0: 76 65 6e 74 5f 74 69 6d 65 20 64 62 20 6e 65 77 vent_time db new
b2d0: 2d 72 75 6e 2d 69 64 29 0a 20 20 20 20 3b 3b 20 -run-id). ;;
b2e0: 69 6e 64 65 78 20 74 68 65 20 61 6c 72 65 61 64 index the alread
b2f0: 79 20 73 61 76 65 64 20 74 65 73 74 73 20 62 79 y saved tests by
b300: 20 74 65 73 74 6e 61 6d 65 20 61 6e 64 20 69 74 testname and it
b310: 65 6d 64 61 74 20 69 6e 20 63 75 72 72 2d 74 65 emdat in curr-te
b320: 73 74 73 2d 68 61 73 68 0a 20 20 20 20 28 66 6f sts-hash. (fo
b330: 72 2d 65 61 63 68 0a 20 20 20 20 20 28 6c 61 6d r-each. (lam
b340: 62 64 61 20 28 74 65 73 74 64 61 74 29 0a 20 20 bda (testdat).
b350: 20 20 20 20 20 28 6c 65 74 2a 20 28 28 74 65 73 (let* ((tes
b360: 74 6e 61 6d 65 20 20 28 64 62 3a 74 65 73 74 2d tname (db:test-
b370: 67 65 74 2d 74 65 73 74 6e 61 6d 65 20 74 65 73 get-testname tes
b380: 74 64 61 74 29 29 0a 09 20 20 20 20 20 20 28 69 tdat)).. (i
b390: 74 65 6d 2d 70 61 74 68 20 28 64 62 3a 74 65 73 tem-path (db:tes
b3a0: 74 2d 67 65 74 2d 69 74 65 6d 2d 70 61 74 68 20 t-get-item-path
b3b0: 74 65 73 74 64 61 74 29 29 0a 09 20 20 20 20 20 testdat))..
b3c0: 20 28 66 75 6c 6c 2d 6e 61 6d 65 20 28 63 6f 6e (full-name (con
b3d0: 63 20 74 65 73 74 6e 61 6d 65 20 22 2f 22 20 69 c testname "/" i
b3e0: 74 65 6d 2d 70 61 74 68 29 29 29 0a 09 20 28 68 tem-path))).. (h
b3f0: 61 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 63 ash-table-set! c
b400: 75 72 72 2d 74 65 73 74 73 2d 68 61 73 68 20 66 urr-tests-hash f
b410: 75 6c 6c 2d 6e 61 6d 65 20 74 65 73 74 64 61 74 ull-name testdat
b420: 29 29 29 0a 20 20 20 20 20 63 75 72 72 2d 74 65 ))). curr-te
b430: 73 74 73 29 0a 20 20 20 20 3b 3b 20 4e 4f 50 45 sts). ;; NOPE
b440: 3a 20 4e 6f 6e 2d 6f 70 74 69 6d 61 6c 20 61 70 : Non-optimal ap
b450: 70 72 6f 61 63 68 2e 20 54 72 79 20 74 68 69 73 proach. Try this
b460: 20 69 6e 73 74 65 61 64 2e 0a 20 20 20 20 3b 3b instead.. ;;
b470: 20 20 20 31 2e 20 74 65 73 74 73 20 61 72 65 20 1. tests are
b480: 72 65 63 65 69 76 65 64 20 69 6e 20 61 20 6c 69 received in a li
b490: 73 74 2c 20 6d 6f 73 74 20 72 65 63 65 6e 74 20 st, most recent
b4a0: 66 69 72 73 74 0a 20 20 20 20 3b 3b 20 20 20 32 first. ;; 2
b4b0: 2e 20 72 65 70 6c 61 63 65 20 74 68 65 20 72 6f . replace the ro
b4c0: 6c 6c 75 70 20 74 65 73 74 20 77 69 74 68 20 74 llup test with t
b4d0: 68 65 20 6e 65 77 20 2a 61 6c 77 61 79 73 2a 0a he new *always*.
b4e0: 20 20 20 20 28 66 6f 72 2d 65 61 63 68 20 0a 20 (for-each .
b4f0: 20 20 20 20 28 6c 61 6d 62 64 61 20 28 74 65 73 (lambda (tes
b500: 74 64 61 74 29 0a 20 20 20 20 20 20 20 28 6c 65 tdat). (le
b510: 74 2a 20 28 28 74 65 73 74 6e 61 6d 65 20 20 28 t* ((testname (
b520: 64 62 3a 74 65 73 74 2d 67 65 74 2d 74 65 73 74 db:test-get-test
b530: 6e 61 6d 65 20 74 65 73 74 64 61 74 29 29 0a 09 name testdat))..
b540: 20 20 20 20 20 20 28 69 74 65 6d 2d 70 61 74 68 (item-path
b550: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 74 (db:test-get-it
b560: 65 6d 2d 70 61 74 68 20 74 65 73 74 64 61 74 29 em-path testdat)
b570: 29 0a 09 20 20 20 20 20 20 28 66 75 6c 6c 2d 6e ).. (full-n
b580: 61 6d 65 20 28 63 6f 6e 63 20 74 65 73 74 6e 61 ame (conc testna
b590: 6d 65 20 22 2f 22 20 69 74 65 6d 2d 70 61 74 68 me "/" item-path
b5a0: 29 29 0a 09 20 20 20 20 20 20 28 70 72 65 76 2d )).. (prev-
b5b0: 74 65 73 74 2d 64 61 74 20 28 68 61 73 68 2d 74 test-dat (hash-t
b5c0: 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c 74 able-ref/default
b5d0: 20 63 75 72 72 2d 74 65 73 74 73 2d 68 61 73 68 curr-tests-hash
b5e0: 20 66 75 6c 6c 2d 6e 61 6d 65 20 23 66 29 29 0a full-name #f)).
b5f0: 09 20 20 20 20 20 20 28 74 65 73 74 2d 73 74 65 . (test-ste
b600: 70 73 20 20 20 20 20 20 28 6f 70 65 6e 2d 72 75 ps (open-ru
b610: 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d 73 n-close db:get-s
b620: 74 65 70 73 2d 66 6f 72 2d 74 65 73 74 20 64 62 teps-for-test db
b630: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 (db:test-get-id
b640: 20 74 65 73 74 64 61 74 29 29 29 0a 09 20 20 20 testdat)))..
b650: 20 20 20 28 6e 65 77 2d 74 65 73 74 2d 72 65 63 (new-test-rec
b660: 6f 72 64 20 23 66 29 29 0a 09 20 3b 3b 20 72 65 ord #f)).. ;; re
b670: 70 6c 61 63 65 20 74 68 65 73 65 20 77 69 74 68 place these with
b680: 20 69 6e 73 65 72 74 20 2e 2e 2e 20 73 65 6c 65 insert ... sele
b690: 63 74 0a 09 20 28 61 70 70 6c 79 20 73 71 6c 69 ct.. (apply sqli
b6a0: 74 65 33 3a 65 78 65 63 75 74 65 20 0a 09 09 64 te3:execute ...d
b6b0: 62 20 0a 09 09 28 63 6f 6e 63 20 22 49 4e 53 45 b ...(conc "INSE
b6c0: 52 54 20 4f 52 20 52 45 50 4c 41 43 45 20 49 4e RT OR REPLACE IN
b6d0: 54 4f 20 74 65 73 74 73 20 28 72 75 6e 5f 69 64 TO tests (run_id
b6e0: 2c 74 65 73 74 6e 61 6d 65 2c 73 74 61 74 65 2c ,testname,state,
b6f0: 73 74 61 74 75 73 2c 65 76 65 6e 74 5f 74 69 6d status,event_tim
b700: 65 2c 68 6f 73 74 2c 63 70 75 6c 6f 61 64 2c 64 e,host,cpuload,d
b710: 69 73 6b 66 72 65 65 2c 75 6e 61 6d 65 2c 72 75 iskfree,uname,ru
b720: 6e 64 69 72 2c 69 74 65 6d 5f 70 61 74 68 2c 72 ndir,item_path,r
b730: 75 6e 5f 64 75 72 61 74 69 6f 6e 2c 66 69 6e 61 un_duration,fina
b740: 6c 5f 6c 6f 67 66 2c 63 6f 6d 6d 65 6e 74 29 20 l_logf,comment)
b750: 22 0a 09 09 20 20 20 20 20 20 22 56 41 4c 55 45 "... "VALUE
b760: 53 20 28 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f S (?,?,?,?,?,?,?
b770: 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 2c 3f 29 3b ,?,?,?,?,?,?,?);
b780: 22 29 0a 09 09 6e 65 77 2d 72 75 6e 2d 69 64 20 ")...new-run-id
b790: 28 63 64 64 72 20 28 76 65 63 74 6f 72 2d 3e 6c (cddr (vector->l
b7a0: 69 73 74 20 74 65 73 74 64 61 74 29 29 29 0a 09 ist testdat)))..
b7b0: 20 28 73 65 74 21 20 6e 65 77 2d 74 65 73 74 64 (set! new-testd
b7c0: 61 74 20 28 63 61 72 20 28 6f 70 65 6e 2d 72 75 at (car (open-ru
b7d0: 6e 2d 63 6c 6f 73 65 20 64 62 3a 67 65 74 2d 74 n-close db:get-t
b7e0: 65 73 74 73 2d 66 6f 72 2d 72 75 6e 20 64 62 20 ests-for-run db
b7f0: 6e 65 77 2d 72 75 6e 2d 69 64 20 28 63 6f 6e 63 new-run-id (conc
b800: 20 74 65 73 74 6e 61 6d 65 20 22 2f 22 20 69 74 testname "/" it
b810: 65 6d 2d 70 61 74 68 29 20 27 28 29 20 27 28 29 em-path) '() '()
b820: 29 29 29 0a 09 20 28 68 61 73 68 2d 74 61 62 6c ))).. (hash-tabl
b830: 65 2d 73 65 74 21 20 63 75 72 72 2d 74 65 73 74 e-set! curr-test
b840: 73 2d 68 61 73 68 20 66 75 6c 6c 2d 6e 61 6d 65 s-hash full-name
b850: 20 6e 65 77 2d 74 65 73 74 64 61 74 29 20 3b 3b new-testdat) ;;
b860: 20 74 68 69 73 20 63 6f 75 6c 64 20 62 65 20 63 this could be c
b870: 6f 6e 66 75 73 69 6e 67 2c 20 77 68 69 63 68 20 onfusing, which
b880: 72 65 63 6f 72 64 20 73 68 6f 75 6c 64 20 67 6f record should go
b890: 20 69 6e 74 6f 20 74 68 65 20 6c 6f 6f 6b 75 70 into the lookup
b8a0: 20 74 61 62 6c 65 3f 0a 09 20 3b 3b 20 4e 6f 77 table?.. ;; Now
b8b0: 20 64 75 70 6c 69 63 61 74 65 20 74 68 65 20 74 duplicate the t
b8c0: 65 73 74 20 73 74 65 70 73 0a 09 20 28 64 65 62 est steps.. (deb
b8d0: 75 67 3a 70 72 69 6e 74 20 34 20 22 43 6f 70 79 ug:print 4 "Copy
b8e0: 69 6e 67 20 72 65 63 6f 72 64 73 20 69 6e 20 74 ing records in t
b8f0: 65 73 74 5f 73 74 65 70 73 20 66 72 6f 6d 20 74 est_steps from t
b900: 65 73 74 5f 69 64 3d 22 20 28 64 62 3a 74 65 73 est_id=" (db:tes
b910: 74 2d 67 65 74 2d 69 64 20 74 65 73 74 64 61 74 t-get-id testdat
b920: 29 20 22 20 74 6f 20 22 20 28 64 62 3a 74 65 73 ) " to " (db:tes
b930: 74 2d 67 65 74 2d 69 64 20 6e 65 77 2d 74 65 73 t-get-id new-tes
b940: 74 64 61 74 29 29 0a 09 20 28 6f 70 65 6e 2d 72 tdat)).. (open-r
b950: 75 6e 2d 63 6c 6f 73 65 20 0a 09 20 20 28 6c 61 un-close .. (la
b960: 6d 62 64 61 20 28 29 0a 09 20 20 20 20 28 73 71 mbda ().. (sq
b970: 6c 69 74 65 33 3a 65 78 65 63 75 74 65 20 0a 09 lite3:execute ..
b980: 20 20 20 20 20 64 62 20 0a 09 20 20 20 20 20 28 db .. (
b990: 63 6f 6e 63 20 22 49 4e 53 45 52 54 20 4f 52 20 conc "INSERT OR
b9a0: 52 45 50 4c 41 43 45 20 49 4e 54 4f 20 74 65 73 REPLACE INTO tes
b9b0: 74 5f 73 74 65 70 73 20 28 74 65 73 74 5f 69 64 t_steps (test_id
b9c0: 2c 73 74 65 70 6e 61 6d 65 2c 73 74 61 74 65 2c ,stepname,state,
b9d0: 73 74 61 74 75 73 2c 65 76 65 6e 74 5f 74 69 6d status,event_tim
b9e0: 65 2c 63 6f 6d 6d 65 6e 74 29 20 22 0a 09 09 20 e,comment) "...
b9f0: 20 20 22 53 45 4c 45 43 54 20 22 20 28 64 62 3a "SELECT " (db:
ba00: 74 65 73 74 2d 67 65 74 2d 69 64 20 6e 65 77 2d test-get-id new-
ba10: 74 65 73 74 64 61 74 29 20 22 2c 73 74 65 70 6e testdat) ",stepn
ba20: 61 6d 65 2c 73 74 61 74 65 2c 73 74 61 74 75 73 ame,state,status
ba30: 2c 65 76 65 6e 74 5f 74 69 6d 65 2c 63 6f 6d 6d ,event_time,comm
ba40: 65 6e 74 20 46 52 4f 4d 20 74 65 73 74 5f 73 74 ent FROM test_st
ba50: 65 70 73 20 57 48 45 52 45 20 74 65 73 74 5f 69 eps WHERE test_i
ba60: 64 3d 3f 3b 22 29 0a 09 20 20 20 20 20 28 64 62 d=?;").. (db
ba70: 3a 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 73 :test-get-id tes
ba80: 74 64 61 74 29 29 0a 09 20 20 20 20 3b 3b 20 4e tdat)).. ;; N
ba90: 6f 77 20 64 75 70 6c 69 63 61 74 65 20 74 68 65 ow duplicate the
baa0: 20 74 65 73 74 20 64 61 74 61 0a 09 20 20 20 20 test data..
bab0: 28 64 65 62 75 67 3a 70 72 69 6e 74 20 34 20 22 (debug:print 4 "
bac0: 43 6f 70 79 69 6e 67 20 72 65 63 6f 72 64 73 20 Copying records
bad0: 69 6e 20 74 65 73 74 5f 64 61 74 61 20 66 72 6f in test_data fro
bae0: 6d 20 74 65 73 74 5f 69 64 3d 22 20 28 64 62 3a m test_id=" (db:
baf0: 74 65 73 74 2d 67 65 74 2d 69 64 20 74 65 73 74 test-get-id test
bb00: 64 61 74 29 20 22 20 74 6f 20 22 20 28 64 62 3a dat) " to " (db:
bb10: 74 65 73 74 2d 67 65 74 2d 69 64 20 6e 65 77 2d test-get-id new-
bb20: 74 65 73 74 64 61 74 29 29 0a 09 20 20 20 20 28 testdat)).. (
bb30: 73 71 6c 69 74 65 33 3a 65 78 65 63 75 74 65 20 sqlite3:execute
bb40: 0a 09 20 20 20 20 20 64 62 20 0a 09 20 20 20 20 .. db ..
bb50: 20 28 63 6f 6e 63 20 22 49 4e 53 45 52 54 20 4f (conc "INSERT O
bb60: 52 20 52 45 50 4c 41 43 45 20 49 4e 54 4f 20 74 R REPLACE INTO t
bb70: 65 73 74 5f 64 61 74 61 20 28 74 65 73 74 5f 69 est_data (test_i
bb80: 64 2c 63 61 74 65 67 6f 72 79 2c 76 61 72 69 61 d,category,varia
bb90: 62 6c 65 2c 76 61 6c 75 65 2c 65 78 70 65 63 74 ble,value,expect
bba0: 65 64 2c 74 6f 6c 2c 75 6e 69 74 73 2c 63 6f 6d ed,tol,units,com
bbb0: 6d 65 6e 74 29 20 22 0a 09 09 20 20 20 22 53 45 ment) "... "SE
bbc0: 4c 45 43 54 20 22 20 28 64 62 3a 74 65 73 74 2d LECT " (db:test-
bbd0: 67 65 74 2d 69 64 20 6e 65 77 2d 74 65 73 74 64 get-id new-testd
bbe0: 61 74 29 20 22 2c 63 61 74 65 67 6f 72 79 2c 76 at) ",category,v
bbf0: 61 72 69 61 62 6c 65 2c 76 61 6c 75 65 2c 65 78 ariable,value,ex
bc00: 70 65 63 74 65 64 2c 74 6f 6c 2c 75 6e 69 74 73 pected,tol,units
bc10: 2c 63 6f 6d 6d 65 6e 74 20 46 52 4f 4d 20 74 65 ,comment FROM te
bc20: 73 74 5f 64 61 74 61 20 57 48 45 52 45 20 74 65 st_data WHERE te
bc30: 73 74 5f 69 64 3d 3f 3b 22 29 0a 09 20 20 20 20 st_id=?;")..
bc40: 20 28 64 62 3a 74 65 73 74 2d 67 65 74 2d 69 64 (db:test-get-id
bc50: 20 74 65 73 74 64 61 74 29 29 29 29 0a 09 20 29 testdat)))).. )
bc60: 29 0a 20 20 20 20 20 70 72 65 76 2d 74 65 73 74 ). prev-test
bc70: 73 29 29 29 0a 09 20 0a 20 20 20 20 20 0a s))).. . .