Skip to content

Commit

Permalink
API to run tests and collect test suite status
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsurti committed Nov 16, 2014
1 parent 5b7ad1a commit dbc1d0e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -31,4 +31,4 @@ before_script:
- git clone https://github.com/vseloved/should-test.git

script:
- sbcl --non-interactive --eval '(progn (pushnew :dev *features*) (ql:quickload :cl-nlp) (unless (asdf:test-system :cl-nlp) (uiop:quit 1)))'
- sbcl --non-interactive --eval '(progn (pushnew :dev *features*) (ql:quickload :cl-nlp) (asdf:test-system :cl-nlp) (uiop:quit (test-suite-status)))'
2 changes: 0 additions & 2 deletions src/packages.lisp
@@ -1,6 +1,5 @@
;;; (c) 2013-2014 Vsevolod Dyomkin


(cl:defpackage #:nlp.util
(:nicknames #:nutil)
(:use #:common-lisp #:rutilsx
Expand Down Expand Up @@ -300,7 +299,6 @@
#:plot
))


(rutils:re-export-symbols '#:nutil '#:nlp-user)
(rutils:re-export-symbols '#:ncorp '#:nlp-user)
(rutils:re-export-symbols '#:ncore '#:nlp-user)
Expand Down
18 changes: 15 additions & 3 deletions test/ci.lisp
Expand Up @@ -3,9 +3,21 @@
;;; Test operation to test entire NLP test suite
;;; This test operation is also used by Travis CI

(defparameter *test-failures-or-errors* 0)

(defmethod asdf:perform ((o asdf:test-op)
(s (eql (asdf:find-system :cl-nlp))))
(asdf:load-system :cl-nlp)
;;; TO DO: Fix and add other package tests
(every #'identity (mapcar #'(lambda (pkg) (should-test:test :package pkg))
'(:ncore :ncorp :nlearn :ntag :nlp-user))))
(run-all-tests)
(test-suite-status))

(defun run-all-tests ()
"Run all test modules and keep track of number of failures/errors."
(setf *test-failures-or-errors* 0)
(dolist (package '(:ncore :ncorp :nlearn :ntag :nlp-user))
(unless (should-test:test :package package)
(incf *test-failures-or-errors* 1))))

(defun test-suite-status ()
"Used by CI as unix command status."
(values *test-failures-or-errors*))

0 comments on commit dbc1d0e

Please sign in to comment.