diff --git a/default-template/.gitignore b/default-template/.gitignore new file mode 100644 index 0000000..e4e5f6c --- /dev/null +++ b/default-template/.gitignore @@ -0,0 +1 @@ +*~ \ No newline at end of file diff --git a/default-template/.travis.yml b/default-template/.travis.yml new file mode 100644 index 0000000..bbbace3 --- /dev/null +++ b/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)))' \ No newline at end of file diff --git a/default-template/README.md b/default-template/README.md index 97588dd..881e45c 100644 --- a/default-template/README.md +++ b/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 diff --git a/default-template/application.lisp b/default-template/application.lisp deleted file mode 100644 index 564d244..0000000 --- a/default-template/application.lisp +++ /dev/null @@ -1,5 +0,0 @@ -;;;; (#| TMPL_VAR name |#).lisp(#| TMPL_IF copyright |#) -;; -;;;; (#| TMPL_VAR copyright |#)(#| /TMPL_IF |#) - -(in-package #:(#| TMPL_VAR name |#)) diff --git a/default-template/run-tests b/default-template/run-tests new file mode 100644 index 0000000..92589d9 --- /dev/null +++ b/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))' diff --git a/default-template/src/application.lisp b/default-template/src/application.lisp new file mode 100644 index 0000000..ff1c074 --- /dev/null +++ b/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! diff --git a/default-template/package.lisp b/default-template/src/package.lisp similarity index 68% rename from default-template/package.lisp rename to default-template/src/package.lisp index ae60d64..0911a9d 100644 --- a/default-template/package.lisp +++ b/default-template/src/package.lisp @@ -1,4 +1,4 @@ -;;;; package.lisp(#| TMPL_IF copyright |#) +;;;; src/package.lisp(#| TMPL_IF copyright |#) ;; ;;;; (#| TMPL_VAR copyright |#)(#| /TMPL_IF |#) diff --git a/default-template/system.asd b/default-template/system.asd index 186db66..cb1a9d3 100644 --- a/default-template/system.asd +++ b/default-template/system.asd @@ -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))) diff --git a/default-template/test/application.lisp b/default-template/test/application.lisp new file mode 100644 index 0000000..9a20610 --- /dev/null +++ b/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")) diff --git a/default-template/test/package.lisp b/default-template/test/package.lisp new file mode 100644 index 0000000..7ca8af1 --- /dev/null +++ b/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))