-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copied over test packaging and travis build changes from the diverged…
… branch.
- Loading branch information
Showing
7 changed files
with
151 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,61 @@ | ||
language: lisp | ||
|
||
env: | ||
global: | ||
- PATH=~/.roswell/bin:$PATH | ||
- ROSWELL_INSTALL_DIR=$HOME/.roswell | ||
matrix: | ||
- LISP=sbcl | ||
- LISP=sbcl32 | ||
- LISP=sbcl COVERALLS=true | ||
- LISP=allegro | ||
- LISP=allegromodern | ||
- LISP=abcl | ||
- LISP=ccl | ||
- LISP=ccl32 | ||
- LISP=clisp | ||
- LISP=clisp32 | ||
- LISP=cmucl | ||
- LISP=ecl | ||
# - LISP=abcl | ||
# - LISP=ccl-bin | ||
# - LISP=clisp | ||
# - LISP=cmu-bin | ||
# - LISP=ecl | ||
#- LISP=allegromodern | ||
#- LISP=abcl | ||
#- LISP=ccl | ||
#- LISP=ccl32 | ||
#- LISP=clisp | ||
#- LISP=clisp32 | ||
#- LISP=cmucl | ||
#- LISP=ecl | ||
|
||
matrix: | ||
allow_failures: | ||
# Only plan to support SBCL, but check compatilibity issues on other | ||
# distributions. | ||
- env: LISP=allegro | ||
- env: LISP=allegromodern | ||
- env: LISP=abcl | ||
- env: LISP=ccl | ||
- env: LISP=ccl32 | ||
- env: LISP=clisp | ||
- env: LISP=clisp32 | ||
- env: LISP=ecl | ||
# CIM not available for CMUCL | ||
- env: LISP=cmucl | ||
#- env: LISP=allegromodern | ||
#- env: LISP=abcl | ||
#- env: LISP=ccl | ||
#- env: LISP=ccl32 | ||
#- env: LISP=clisp | ||
#- env: LISP=clisp32 | ||
#- env: LISP=ecl | ||
## CIM not available for CMUCL | ||
#- env: LISP=cmucl | ||
|
||
install: | ||
- curl https://raw.githubusercontent.com/luismbo/cl-travis/master/install.sh | sh; | ||
# Install roswell | ||
#- curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh; | ||
- curl -L https://raw.githubusercontent.com/genelkim/custom-ci-scripts/master/install-for-ci-sbcl-2.0.7.sh | sh; | ||
# Make current project accessible by roswell | ||
- ln -s $(pwd) ~/.roswell/local-projects/ttt | ||
|
||
before_script: | ||
- echo "(defsystem :dummy-cl-travis-system)" > ~/lisp/dummy-cl-travis-system.asd | ||
# Custom cl-coveralls | ||
- ros install genelkim/cl-coveralls | ||
|
||
cache: | ||
directories: | ||
# Cache roswell | ||
- $HOME/.roswell | ||
|
||
script: | ||
- cd src; cl -e '(ql:quickload :ttt) | ||
(ql:quickload :uiop) | ||
(in-package :ttt) | ||
(load-tests-all) | ||
(format t "Original TTT tests...~%") | ||
(compile-tests) | ||
(run-tests) | ||
(format t "New unit tests...~%") | ||
(loop for test-file in (directory "test/*.lisp") | ||
do (load test-file)) | ||
(lisp-unit:run-tests)' | ||
- if [[ "$LISP" == "sbcl" ]]; then | ||
ros -s cl-coveralls -e '(or (coveralls:with-coveralls (:exclude (cons "tests.lisp" (directory "test/*.lisp"))) | ||
(load "src/run-tests")) | ||
(uiop:quit -1))'; | ||
else | ||
cd src; ros -l run-tests.lisp; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(ql:quickload :ttt/tests) | ||
(in-package :ttt/tests) | ||
(run) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
(defpackage #:ttt/tests | ||
(:use #:cl #:lisp-unit #:ttt) | ||
(:shadow :run-tests) | ||
(:export #:run)) | ||
|
||
(in-package :ttt/tests) | ||
|
||
;; These functions are borrowed from the cl-util library. This is defined here | ||
;; since cl-util currently depends on TTT so we can't import these functions. | ||
;; TODO: Move TTT-dependant code to this repo and change dependency order. | ||
;; Macro for pre- and post- interning symbols. | ||
;; bgnval: initial symbol or s-expr of symbols | ||
;; midval: name of variable storing bgnvar after it is interned into the ulf-lib package | ||
;; callpkg: optional argument for the package that the output should be interned to | ||
;; if nil, it defaults to the value *ulf-lib-caller-pkg* | ||
;; body: body of the code (using midval) | ||
;; outval: immediate output of the body | ||
(defmacro inout-intern ((bgnval midval inpkg &key (callpkg nil)) &body body) | ||
`(let* ((,midval (intern-symbols-recursive ,bgnval ,inpkg)) | ||
(outval (multiple-value-list (progn ,@body)))) | ||
(values-list | ||
(cond | ||
(,callpkg (intern-symbols-recursive outval ,callpkg)) | ||
(*intern-caller-pkg* (intern-symbols-recursive outval *intern-caller-pkg*)) | ||
(t outval))))) | ||
;; Same as inout-intern macro but only performs the pre- interning portion. | ||
;; Interns the incoming symbols and stores it in midval before evaluating | ||
;; the body. | ||
(defmacro in-intern ((bgnval midval inpkg) &body body) | ||
`(let* ((,midval (intern-symbols-recursive ,bgnval ,inpkg))) | ||
,@body)) | ||
|
||
(defun run (&key tests tags | ||
;; lisp-unit verbosity parameters. | ||
(print-failures t) | ||
(print-errors t) | ||
(print-summary t) | ||
(summarize-results t)) | ||
"Run all TTT tests. | ||
Optional arguments: | ||
tests: list of test names, defaults to running all tests | ||
tags: list of test tags | ||
`tests` and `tags` should not both be set. The `tags` argument will be | ||
ignored if that is the case. | ||
" | ||
|
||
(format t "Original TTT tests...~%") | ||
(load-tests-all) | ||
(compile-tests) | ||
(run-tests) | ||
|
||
(format t "New unit tests...") | ||
(let ((*print-failures* print-failures) | ||
(*print-errors* print-errors) | ||
(*print-summary* print-summary) | ||
(*summarize-results* summarize-results)) | ||
;; Run tests. | ||
(cond | ||
;; Specified tests. | ||
(tests | ||
(when tags | ||
(warn (concatenate 'string | ||
"Both the :tags and :tests keyword " | ||
"arguments are given for ttt/tests:run. " | ||
"Ignoring the :tags argument..."))) | ||
(in-intern (tests pkgtests :ttt/tests) | ||
(lisp-unit:run-tests pkgtests :ttt/tests))) | ||
;; Specified tags. | ||
(tags (run-tags tags :ttt/tests)) | ||
;; Default, all tests. | ||
(t (lisp-unit:run-tests :all :ttt/tests))))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters