Merged in longchar-typespecifier-fix branch
[clsql.git] / examples / run-tests.sh
1 #!/bin/bash
2
3 REPORT_FILE=/tmp/clsql-test-report.txt
4 SEXP_REPORT_FILE=/tmp/clsql-test-report.sexp
5 LISP_CMD_FILE=/tmp/clsql-test.lisp
6
7 CMD="
8 (setq *print-readably* nil)
9 (let ((boot-file
10        (merge-pathnames
11         (parse-namestring #+allegro \".clinit.cl\"
12                           #+cmu \".cmucl-init.lisp\"
13                           #+lispworks \".lispworks\"
14                           #+openmcl \"openmcl-init.lisp\"
15                           #+sbcl \".sbclrc\"
16                           #+scl \".scl-init.lisp\"
17                           )
18         (user-homedir-pathname))))
19   (if (probe-file boot-file)
20     (load boot-file)
21     (warn \"Unable to load boot file ~A.\" boot-file)))
22
23   (asdf:operate 'asdf:load-op 'clsql-tests)
24   (clsql-tests:run-tests-append-report-file \"${REPORT_FILE}\")
25
26   #+allegro (excl:exit)
27   #+clisp (#+lisp=cl ext:quit #-lisp=cl lisp:quit)
28   #+cmu (ext:quit)
29   #+lispworks (lw:quit)
30   #+openmcl (ccl:quit)
31   #+sbcl (sb-ext:quit)
32   #+scl (ext:quit)"
33
34 SUMMARY_CMD="
35 (asdf:operate 'asdf:load-op 'clsql-tests)
36 (clsql-tests:summarize-test-report \"${SEXP_REPORT_FILE}\")
37
38 #+allegro (excl:exit :quiet t)
39 #+clisp (#+lisp=cl ext:quit #-lisp=cl lisp:quit)
40 #+cmu (ext:quit)
41 #+lispworks (lw:quit)
42 #+openmcl (ccl:quit)
43 #+sbcl (sb-ext:quit))
44 #+scl (ext:quit)"
45
46 rm -rf $REPORT_FILE $SEXP_REPORT_FILE $LISP_CMD_FILE
47 echo $CMD > $LISP_CMD_FILE
48
49 ALLEGRO=mlisp
50 if [ "`which $ALLEGRO`" ]; then
51   $ALLEGRO -q -L $LISP_CMD_FILE
52 fi
53
54 CMUCL=lisp
55 if [ "`which $CMUCL`" ]; then
56   $CMUCL -init $LISP_CMD_FILE
57 fi
58
59 LISPWORKS=lw-console
60 #if [ "`which $LISPWORKS`" ]; then
61  $LISPWORKS -init $LISP_CMD_FILE
62 #fi
63
64 OPENCML=openmcl
65 #if [ "`which $OPENMCL`" ]; then
66   $OPENMCL -init $LISP_CMD_FILE
67 #fi
68
69 SBCL=sbcl
70 if [ "`which $SBCL`" ]; then
71   $SBCL --noinform --disable-debugger --userinit $LISP_CMD_FILE
72 fi
73
74 if [ -s $SEXP_REPORT_FILE ]; then
75     echo "$SUMMARY_CMD" | $SBCL
76 fi
77
78 #rm -rf $LISP_CMD_FILE