Support coverage report in ./run-test.ros.

This commit is contained in:
Eitaro Fukamachi 2015-06-16 03:28:44 +09:00
parent 5fceea7d90
commit 89d85aad36
2 changed files with 20 additions and 21 deletions

View file

@ -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

View file

@ -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))))