diff --git a/.travis.yml b/.travis.yml index 9d92d9b..4a244ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,13 +15,4 @@ before_script: - git clone https://github.com/fukamachi/cl-coveralls $TRAVIS_BUILD_DIR/quicklisp/local-projects/cl-coveralls script: - - ros -s prove -s cl-coveralls - -e '(or (coveralls:with-coveralls (:exclude (list "t" "quicklisp")) - (loop for file in (uiop:directory-files (uiop:ensure-directory-pathname (uiop:getenv "TRAVIS_BUILD_DIR"))) - when (and (string= (pathname-type file) "asd") - (< 2 (length (pathname-name file))) - (string= (pathname-name file) "t-" :end1 2)) - collect (pathname-name file) into test-files - finally - (return (not (some (function null) (mapcar (function prove:run) test-files)))))) - (uiop:quit -1))' + - COVERAGE_EXCLUDE=t/ ./run-test.ros t-*.asd diff --git a/run-test.ros b/run-test.ros index 67a7844..4d839e1 100755 --- a/run-test.ros +++ b/run-test.ros @@ -7,16 +7,24 @@ exec ros -Q -- $0 "$@" (unless (find-package :uiop) (ql:quickload :uiop :silent t)) -(ql:quickload :prove :silent t) +(ql:quickload '(:prove :cl-coveralls :split-sequence) :silent t) (defun main (&rest test-files) - (when (some #'null - (mapcar (lambda (test-file) - (let ((test-file (pathname test-file))) - (unless (or (probe-file test-file) - (string= (pathname-type test-file) "asd")) - (error "~S is not an asd file." test-file)) - (load test-file) - (prove:run-test-system (asdf:find-system (pathname-name test-file))))) - test-files)) - (uiop:quit -1))) + (labels ((run-tests () + (not + (some #'null + (mapcar (lambda (test-file) + (let ((test-file (pathname test-file))) + (unless (or (probe-file test-file) + (string= (pathname-type test-file) "asd")) + (error "~S is not an asd file." test-file)) + (load test-file) + (prove:run-test-system (asdf:find-system (pathname-name test-file))))) + test-files))))) + (or (if (uiop:getenv "COVERALLS") + (coveralls:with-coveralls (:exclude + (split-sequence:split-sequence #\: (or (uiop:getenv "COVERAGE_EXCLUDE") "") + :remove-empty-subseqs t)) + (run-tests)) + (run-tests)) + (uiop:quit -1))))