| 1 | ;;;; Run a bisection tool to determine where a test fails |
|---|
| 2 | ;;; This file is in the public domain. |
|---|
| 3 | ;;; Copyright (C) 2012 by Mark <evenson.not.org@gmail.com> |
|---|
| 4 | (in-package :cl-user) |
|---|
| 5 | |
|---|
| 6 | (defun generate-bisect-wrapper () |
|---|
| 7 | "Create 'check.sh', a script suitable for use with hg bisect. |
|---|
| 8 | |
|---|
| 9 | To use, first clone |
|---|
| 10 | |
|---|
| 11 | hg clone https://evenson.not.org@code.google.com/p/abcl-dynamic-install/ ./abcl |
|---|
| 12 | cd abcl |
|---|
| 13 | |
|---|
| 14 | Then copy 'check.lisp' to this directory, as well as the bisect |
|---|
| 15 | wrapper script 'check.sh'. Adjust 'check.lisp' to raise an error if |
|---|
| 16 | the problem exists in a given changeset. |
|---|
| 17 | |
|---|
| 18 | Then reset the hg bisection data via: |
|---|
| 19 | |
|---|
| 20 | hg bisect --reset |
|---|
| 21 | |
|---|
| 22 | Mark the last known good and earliest known bad changeset via |
|---|
| 23 | |
|---|
| 24 | hg bisect --good <revision> |
|---|
| 25 | hg bisect --bad <revision> |
|---|
| 26 | |
|---|
| 27 | Then issue |
|---|
| 28 | |
|---|
| 29 | hg bisect --command sh ./check.sh |
|---|
| 30 | |
|---|
| 31 | which will churn through the revisions until it finds the earliest |
|---|
| 32 | known version in which the 'check.lisp' raises the error. |
|---|
| 33 | " |
|---|
| 34 | (let ((check.sh #p"check.sh")) |
|---|
| 35 | (unless (probe-file check.sh) |
|---|
| 36 | (with-open-file (output check.sh :direction :output) |
|---|
| 37 | (format output "#!/bin/sh~A~%" |
|---|
| 38 | "ant && ./abcl --noinit --batch --eval \"(load \\\"check.lisp\\\""))))) |
|---|
| 39 | |
|---|
| 40 | ;;; XXX separate out runtime yucky top-level forms |
|---|
| 41 | (require :asdf) |
|---|
| 42 | (require :abcl-contrib) |
|---|
| 43 | |
|---|
| 44 | ;;; The ASDF definition for ANSI-COMPILED contains the ANSI-TESTS package. |
|---|
| 45 | ;;; The CL-TEST package is defined by the GCL ANSI tests. |
|---|
| 46 | (eval-when (:load-toplevel :execute) |
|---|
| 47 | (asdf:load-system :abcl/test/ansi/compiled) |
|---|
| 48 | (ansi-tests:load-tests)) ;; TODO figure out how to not load all the tests |
|---|
| 49 | |
|---|
| 50 | (defparameter *test* |
|---|
| 51 | 'CL-TEST::SYNTAX.SHARP-BACKSLASH.7) |
|---|
| 52 | |
|---|
| 53 | (unless (rt:do-test *test*) |
|---|
| 54 | (error "~A failed" *test*)) |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|