;; -*- Lisp -*- ;; BKNR build script - Called by buildbot to build/test (setf *compile-verbose* nil) (setf *compile-print* nil) #+sbcl (require "ASDF") (load (compile-file "thirdparty/asdf/asdf.lisp")) (defpackage :build (:use :cl)) (in-package :build) (format t "Building with ~A ~A.~%Features: ~S~%" (lisp-implementation-type) (lisp-implementation-version) *features*) #+openmcl (setf ccl::*defmethod-declare-all-arguments-ignorable* t) (defun setup-registry (directory-path) (flet ((valid-p (asd-pathname) (and (not (member "_darcs" (pathname-directory asd-pathname) :test #'equal)) (not (member "asd" (pathname-directory asd-pathname) :test #'equal))))) (format t "; adding components under ~A to asdf registry~%" directory-path) (mapc (lambda (asd-pathname) (when (valid-p asd-pathname) (let ((member (member (file-namestring asd-pathname) asdf:*central-registry* :key #'(lambda (entry) (if (or (stringp entry) (pathnamep entry)) (file-namestring entry) nil)) :test #'equal))) (assert (not member) nil "Found ~a,~%but ~a~%already exists in the asdf registry." asd-pathname (first member)) (push asd-pathname asdf:*central-registry*)))) (directory (merge-pathnames #p"**/*.asd" directory-path))))) (defun exit (code) #+sbcl (sb-unix:unix-exit code) #+openmcl (ccl:quit code) #+cmu (unix:unix-exit code)) #+openmcl (defvar *initial-shared-libraries* (copy-list ccl::*shared-libraries*)) #+openmcl (defun dump-image (&optional (image-name "bknr-sbcl.image")) (format t "~&;;; --- dumping image ~A~%" image-name) (dolist (lib ccl::*shared-libraries*) (ignore-errors (ccl::close-shared-library lib))) (setf ccl::*shared-libraries* *initial-shared-libraries*) (ccl:save-application "bknr-ccl.image")) #+sbcl (defun dump-image (&optional (image-name "bknr-sbcl.image")) (format t "~&;;; --- dumping image ~A~%" image-name) (sb-ext:save-lisp-and-die "bknr-sbcl.image")) (setup-registry (probe-file *default-pathname-defaults*)) (dolist (system '(:bknr.web :quickhoney :bos.web :bos.test :lisp-ecoop :bknr.datastore.test :bknr.indices.test :bknr.skip-list.test :html-match :html-match.test :cl-gd-test :cl-ppcre-test :cl-json :cl-json.test :kmrcl-tests :flexi-streams :flexi-streams-test :uffi #+(or) :uffi-tests :screamer :cl-fad :xhtmlgen-test #+(or) :cffi-tests #+(or) :usocket #+(or) :usocket-test #+(or) :uffi-test #+(or) :usocket-test )) (format t "~&;;; --- loading system ~A~%" system) (asdf:oos 'asdf:load-op system :verbose nil)) ;; For some reason, automatic loading of the GD library does not work ;; on FreeBSD/i386 with SBCL. This temporary fix hopefully cures the ;; problem for the moment: #+(and sbcl freebsd x86) (progn (eval (read-from-string "(uffi:load-foreign-library \"/usr/local/lib/libgd.so\")")) (eval (read-from-string "(uffi:load-foreign-library \"/usr/local/lib/cl-gd-glue.so\")"))) (defun build () (exit 0)) (defmacro run-tests (&body forms) `(let (any-failed) ,@(mapcar (lambda (form) `(progn (format t "~&====================== RUNNING ~S~%" ',form) ; quoted (let ((failed (null ,form))) (format t "~&====================== ~S ~A~%~%" ',form (if failed "FAILED xxxxx" "SUCCEEDED")) (setf any-failed (or any-failed failed))))) forms) (exit (if any-failed 1 0)))) #+(or) (defun cl-ppcre-run-no-failures-p () (let ((expected ".......... .......... .......... .......... .......... .......... ...... 662 (\"a\" =~ /((a)*)*/): \\2: expected NIL but got \"a\" .... ......... 790 (\"babc\" =~ /^(b*|ba){1,2}bc/): \\1: expected \"\" but got \"ba\" . .......... .......... .......... .......... .......... .......... ... 1439 (\"dbaacb\" =~ /(?