check.lisp 1.65 KB
Newer Older
1 2 3 4 5 6 7 8
;;;; Run a bisection tool to determine where a test fails
;;; This file is in the public domain.
;;; Copyright (C) 2012 by Mark <evenson.not.org@gmail.com>
(in-package :cl-user)

(defun generate-bisect-wrapper ()
  "Create 'check.sh', a script suitable for use with hg bisect.

9
To use, first clone 
10 11

   hg clone https://evenson.not.org@code.google.com/p/abcl-dynamic-install/ ./abcl
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
   cd abcl

Then copy 'check.lisp' to this directory, as well as the bisect
wrapper script 'check.sh'.  Adjust 'check.lisp' to raise an error if
the problem exists in a given changeset.

Then reset the hg bisection data via:

   hg bisect --reset

Mark the last known good and earliest known bad changeset via

   hg bisect --good <revision>
   hg bisect --bad <revision>

Then issue

   hg bisect --command sh ./check.sh

which will churn through the revisions until it finds the earliest
known version in which the 'check.lisp' raises the error.
33 34 35 36 37 38 39 40 41 42 43 44 45 46
"
  (let ((check.sh #p"check.sh"))
    (unless (probe-file check.sh)
      (with-open-file (output check.sh :direction :output)
        (format output "#!/bin/sh~A~%"
                "ant && ./abcl --noinit --batch --eval \"(load \\\"check.lisp\\\"")))))

;;; XXX separate out runtime yucky top-level forms
(require :asdf)
(require :abcl-contrib)

;;; The ASDF definition for ANSI-COMPILED contains the ANSI-TESTS package.
;;; The CL-TEST package is defined by the GCL ANSI tests.
(eval-when (:load-toplevel :execute)
47
  (asdf:load-system :abcl/test/ansi/compiled)
48 49 50 51 52 53 54 55 56 57
  (ansi-tests:load-tests)) ;; TODO figure out how to not load all the tests

(defparameter *test*
  'CL-TEST::SYNTAX.SHARP-BACKSLASH.7)

(unless (rt:do-test *test*)
  (error "~A failed" *test*))