Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge test-including default-template #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions default-template/.gitignore
@@ -0,0 +1 @@
*~
8 changes: 8 additions & 0 deletions default-template/.travis.yml
@@ -0,0 +1,8 @@
language: common-lisp
sudo: required

install:
- curl -L https://raw.githubusercontent.com/snmsts/roswell/release/scripts/install-for-ci.sh | sh

script:
- ros -s prove -e '(progn (ql:quickload (list :(#| TMPL_VAR name |#) :(#| TMPL_VAR name |#)-test)) (or (prove:run :(#| TMPL_VAR name |#)-test) (uiop:quit -1)))'
2 changes: 2 additions & 0 deletions default-template/README.md
@@ -1,6 +1,8 @@
# (#| TMPL_VAR name |#)
### _(#| TMPL_VAR author |#)_

[![Build Status](https://travis-ci.org/(#| TMPL_VAR author |#)/(#| TMPL_VAR name |#).svg?branch=master)](https://travis-ci.org/(#| TMPL_VAR author |#)/(#| TMPL_VAR name |#))

This is a project to do ... something.

## License
Expand Down
5 changes: 0 additions & 5 deletions default-template/application.lisp

This file was deleted.

4 changes: 4 additions & 0 deletions default-template/run-tests
@@ -0,0 +1,4 @@
#!/bin/bash
sbcl \
--eval '(ql:quickload (list :(#| TMPL_VAR name |#) :(#| TMPL_VAR name |#)/test))' \
--eval '(or (and (prove:run :(#| TMPL_VAR name |#)/test) (uiop:quit 0)) (uiop:quit -1))'
7 changes: 7 additions & 0 deletions default-template/src/application.lisp
@@ -0,0 +1,7 @@
;;;; src/(#| TMPL_VAR name |#).lisp(#| TMPL_IF copyright |#)
;;
;;;; (#| TMPL_VAR copyright |#)(#| /TMPL_IF |#)

(in-package #:(#| TMPL_VAR name |#))

;; (#| TMPL_VAR name |#) goes here. Hacks and glory await!
@@ -1,4 +1,4 @@
;;;; package.lisp(#| TMPL_IF copyright |#)
;;;; src/package.lisp(#| TMPL_IF copyright |#)
;;
;;;; (#| TMPL_VAR copyright |#)(#| /TMPL_IF |#)

Expand Down
25 changes: 21 additions & 4 deletions default-template/system.asd
Expand Up @@ -4,10 +4,27 @@

(asdf:defsystem #:(#| TMPL_VAR name |#)
:description "Describe (#| TMPL_VAR name |#) here"
:author "(#| TMPL_VAR author |#)"
:license "(#| TMPL_VAR license |#)"
:author "(#| TMPL_VAR author |#)"
:license "(#| TMPL_VAR license |#)"
:version "0.0.1"
:serial t(#| TMPL_IF depends-on |#)
:depends-on (#| TMPL_VAR dependencies-string |#)(#| /TMPL_IF |#)
:components ((:file "package")
(:file "(#| TMPL_VAR name |#)")))
:components ((:module
src :components
((:file "package")
(:file "(#| TMPL_VAR name |#)")))))

(asdf:defsystem #:(#| TMPL_VAR name |#)/test
:description "Test suite for :(#| TMPL_VAR name |#)"
:author "(#| TMPL_VAR author |#)"
:license "(#| TMPL_VAR license |#)"
:serial t
:depends-on (#:(#| TMPL_VAR name |#) #:test-utils)
:defsystem-depends-on (#:prove-asdf)
:components ((:module
test :components
((:file "package")
(:test-file "(#| TMPL_VAR name |#)"))))
:perform (test-op
:after (op c)
(funcall (intern #.(string :run) :prove) c)))
16 changes: 16 additions & 0 deletions default-template/test/application.lisp
@@ -0,0 +1,16 @@
;;;; test/(#| TMPL_VAR name |#).lisp(#| TMPL_IF copyright |#)
;;
;;;; (#| TMPL_VAR copyright |#)(#| /TMPL_IF |#)

(in-package #:(#| TMPL_VAR name |#)/test)

(tests
(is (+ 2 3) 5 "Addition works")
(is (+ 2 3) 6 "Intentionally fails")

(for-all ((a a-number) (b a-number))
(is= (+ a b) (+ b a))
"Addition is commutative")
(for-all ((a a-number) (b a-number))
(is= (- a b) (- b a))
"Subtraction is not, so this should fail"))
6 changes: 6 additions & 0 deletions default-template/test/package.lisp
@@ -0,0 +1,6 @@
;;;; test/package.lisp(#| TMPL_IF copyright |#)
;;
;;;; (#| TMPL_VAR copyright |#)(#| /TMPL_IF |#)

(defpackage #:(#| TMPL_VAR name |#)/test
(:use #:cl #:(#| TMPL_VAR name |#) #:test-utils))