Megatest

Hex Artifact Content
Login

Artifact a780d57ffec081e2d51c896d0ca6f30f5a4e742e:


0000: 3b 3b 20 43 6f 70 79 72 69 67 68 74 20 32 30 30  ;; Copyright 200
0010: 36 2d 32 30 31 32 2c 20 4d 61 74 74 68 65 77 20  6-2012, Matthew 
0020: 57 65 6c 6c 61 6e 64 2e 0a 3b 3b 20 0a 3b 3b 20  Welland..;; .;; 
0030: 20 54 68 69 73 20 70 72 6f 67 72 61 6d 20 69 73   This program is
0040: 20 6d 61 64 65 20 61 76 61 69 6c 61 62 6c 65 20   made available 
0050: 75 6e 64 65 72 20 74 68 65 20 47 4e 55 20 47 50  under the GNU GP
0060: 4c 20 76 65 72 73 69 6f 6e 20 32 2e 30 20 6f 72  L version 2.0 or
0070: 0a 3b 3b 20 20 67 72 65 61 74 65 72 2e 20 53 65  .;;  greater. Se
0080: 65 20 74 68 65 20 61 63 63 6f 6d 70 61 6e 79 69  e the accompanyi
0090: 6e 67 20 66 69 6c 65 20 43 4f 50 59 49 4e 47 20  ng file COPYING 
00a0: 66 6f 72 20 64 65 74 61 69 6c 73 2e 0a 3b 3b 20  for details..;; 
00b0: 0a 3b 3b 20 20 54 68 69 73 20 70 72 6f 67 72 61  .;;  This progra
00c0: 6d 20 69 73 20 64 69 73 74 72 69 62 75 74 65 64  m is distributed
00d0: 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52   WITHOUT ANY WAR
00e0: 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65  RANTY; without e
00f0: 76 65 6e 20 74 68 65 0a 3b 3b 20 20 69 6d 70 6c  ven the.;;  impl
0100: 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 20  ied warranty of 
0110: 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20  MERCHANTABILITY 
0120: 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41  or FITNESS FOR A
0130: 20 50 41 52 54 49 43 55 4c 41 52 0a 3b 3b 20 20   PARTICULAR.;;  
0140: 50 55 52 50 4f 53 45 2e 0a 0a 3b 3b 20 20 73 74  PURPOSE...;;  st
0150: 72 66 74 69 6d 65 28 27 25 6d 2f 25 64 2f 25 59  rftime('%m/%d/%Y
0160: 20 25 48 3a 25 4d 3a 25 53 27 2c 27 6e 6f 77 27   %H:%M:%S','now'
0170: 2c 27 6c 6f 63 61 6c 74 69 6d 65 27 29 0a 0a 28  ,'localtime')..(
0180: 72 65 71 75 69 72 65 2d 65 78 74 65 6e 73 69 6f  require-extensio
0190: 6e 20 74 65 73 74 29 0a 28 72 65 71 75 69 72 65  n test).(require
01a0: 2d 65 78 74 65 6e 73 69 6f 6e 20 72 65 67 65 78  -extension regex
01b0: 29 0a 28 72 65 71 75 69 72 65 2d 65 78 74 65 6e  ).(require-exten
01c0: 73 69 6f 6e 20 73 72 66 69 2d 31 38 29 0a 28 69  sion srfi-18).(i
01d0: 6d 70 6f 72 74 20 73 72 66 69 2d 31 38 29 0a 3b  mport srfi-18).;
01e0: 3b 20 28 72 65 71 75 69 72 65 2d 65 78 74 65 6e  ; (require-exten
01f0: 73 69 6f 6e 20 7a 6d 71 29 0a 3b 3b 20 28 69 6d  sion zmq).;; (im
0200: 70 6f 72 74 20 7a 6d 71 29 0a 0a 28 64 65 66 69  port zmq)..(defi
0210: 6e 65 20 74 65 73 74 2d 77 6f 72 6b 2d 64 69 72  ne test-work-dir
0220: 20 28 63 75 72 72 65 6e 74 2d 64 69 72 65 63 74   (current-direct
0230: 6f 72 79 29 29 0a 0a 3b 3b 20 72 65 61 64 20 69  ory))..;; read i
0240: 6e 20 61 6c 6c 20 74 68 65 20 5f 72 65 63 6f 72  n all the _recor
0250: 64 20 66 69 6c 65 73 0a 28 6c 65 74 20 28 28 66  d files.(let ((f
0260: 69 6c 65 73 20 28 67 6c 6f 62 20 22 2a 5f 72 65  iles (glob "*_re
0270: 63 6f 72 64 73 2e 73 63 6d 22 29 29 29 0a 20 20  cords.scm"))).  
0280: 28 66 6f 72 2d 65 61 63 68 0a 20 20 20 28 6c 61  (for-each.   (la
0290: 6d 62 64 61 20 28 66 69 6c 65 29 0a 20 20 20 20  mbda (file).    
02a0: 20 28 70 72 69 6e 74 20 22 4c 6f 61 64 69 6e 67   (print "Loading
02b0: 20 22 20 66 69 6c 65 29 0a 20 20 20 20 20 28 6c   " file).     (l
02c0: 6f 61 64 20 66 69 6c 65 29 29 0a 20 20 20 66 69  oad file)).   fi
02d0: 6c 65 73 29 29 0a 0a 28 64 65 66 69 6e 65 20 2a  les))..(define *
02e0: 72 75 6e 72 65 6d 6f 74 65 2a 20 23 66 29 0a 0a  runremote* #f)..
02f0: 28 6c 65 74 2a 20 28 28 75 6e 69 74 2d 74 65 73  (let* ((unit-tes
0300: 74 2d 6e 61 6d 65 20 28 6c 69 73 74 2d 72 65 66  t-name (list-ref
0310: 20 28 61 72 67 76 29 20 34 29 29 0a 20 20 20 20   (argv) 4)).    
0320: 20 20 20 28 66 6e 61 6d 65 20 20 20 20 20 20 20     (fname       
0330: 20 20 20 28 63 6f 6e 63 20 22 2e 2e 2f 75 6e 69     (conc "../uni
0340: 74 74 65 73 74 73 2f 22 20 75 6e 69 74 2d 74 65  ttests/" unit-te
0350: 73 74 2d 6e 61 6d 65 20 22 2e 73 63 6d 22 29 29  st-name ".scm"))
0360: 29 0a 20 20 28 69 66 20 28 66 69 6c 65 2d 65 78  ).  (if (file-ex
0370: 69 73 74 73 3f 20 66 6e 61 6d 65 29 0a 20 20 20  ists? fname).   
0380: 20 20 20 28 6c 6f 61 64 20 66 6e 61 6d 65 29 0a     (load fname).
0390: 20 20 20 20 20 20 28 70 72 69 6e 74 20 22 45 52        (print "ER
03a0: 52 4f 52 3a 20 55 6e 69 74 20 74 65 73 74 20 22  ROR: Unit test "
03b0: 20 75 6e 69 74 2d 74 65 73 74 2d 6e 61 6d 65 20   unit-test-name 
03c0: 22 20 6e 6f 74 20 66 6f 75 6e 64 20 69 6e 20 75  " not found in u
03d0: 6e 69 74 74 65 73 74 73 20 64 69 72 65 63 74 6f  nittests directo
03e0: 72 79 22 29 29 29 0a 0a                          ry")))..