[git] CMU Common Lisp branch master updated. snapshot-2014-08-40-gb48c235

Raymond Toy rtoy at common-lisp.net
Thu Aug 28 03:45:16 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".

The branch, master has been updated
       via  b48c235255ef3e9cf0f47446a3adf8ce0abbe07f (commit)
      from  074f4d0bac83c1f2f8aff49ec9dd6e23950106fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b48c235255ef3e9cf0f47446a3adf8ce0abbe07f
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Wed Aug 27 20:45:10 2014 -0700

    Add function to run selected tests. Makes it a bit easier to run a
    selected set instead of all tests.

diff --git a/tests/run-tests.lisp b/tests/run-tests.lisp
index 46ec3a3..50f1ce6 100644
--- a/tests/run-tests.lisp
+++ b/tests/run-tests.lisp
@@ -5,6 +5,11 @@
 ;;;;
 ;;;;   lisp -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
 ;;;;
+;;;;
+;;;; To run selected tests:
+;;;;
+;;;;   lisp -noinit -load tests/run-tests.lisp -eval '(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test <list>))'
+;;;;
 ;;;; Note that you cannot run these tests from a binary created during
 ;;;; a build process. You must run
 ;;;;
@@ -25,6 +30,7 @@
 	   #:load-test-files
 	   #:run-loaded-tests
 	   #:run-all-tests
+	   #:run-test
 	   #:print-test-results))
 
 (in-package :cmucl-test-runner)
@@ -65,8 +71,16 @@
 	    test-results))
     (nreverse test-results)))
 
+;; Run selected tests
+(defun run-test (&rest tests)
+  (let (test-results)
+    (dolist (test tests)
+      (push (lisp-unit:run-tests :all test)
+	    test-results))
+    (print-test-results (nreverse test-results) :verbose t)))
+
 ;; Print out a summary of test results produced from RUN-LOADED-TESTS.
-(defun print-test-results (results &key verbose)
+(defun print-test-results (results &key verbose exitp)
   (let ((passed 0)
 	(failed 0)
 	(execute-errors 0)
@@ -106,9 +120,11 @@
 	     (format t "~2&Execute failures: ~S~%" execute-error-tests)
 	     (dolist (result results)
 	       (lisp-unit:print-errors result)))
-	   (unix:unix-exit 1))
+	   (when exitp
+	     (unix:unix-exit 1)))
 	  (t
-	   (unix:unix-exit 0)))))
+	   (when exitp
+	     (unix:unix-exit 0))))))
 
 ;; Look through all the files in the TEST-DIRECTORY and load them.
 ;; Then run all of the tests.  For each file, it ia assumed that a
@@ -116,7 +132,7 @@
 ;; pathname-name of the file.
 (defun run-all-tests (&key (test-directory #P"tests/") (verbose t))
   (load-test-files test-directory)
-  (print-test-results (run-loaded-tests) :verbose t))
+  (print-test-results (run-loaded-tests) :verbose t :exitp t))
 
 ;;(run-all-tests)
 ;;(quit)

-----------------------------------------------------------------------

Summary of changes:
 tests/run-tests.lisp |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMU Common Lisp



More information about the cmucl-cvs mailing list