-
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.
feat(tests): initial setup for tests
- Loading branch information
Showing
4 changed files
with
71 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### Adapted from: https://github.com/neil-lindquist/CI-Utils/blob/master/config-examples/.github/workflows/ci.yml | ||
name: CI | ||
|
||
# Github Actions allows for running jobs on a wide variety of events | ||
on: | ||
push: # Commits pushed to Github | ||
pull_request: # Pull request is update | ||
workflow_dispatch: # Manually dispatched from Github's UI | ||
|
||
jobs: | ||
test: | ||
name: "sbcl on ubuntu" | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
LISP: sbcl-bin | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: 40ants/setup-lisp@v4 | ||
with: | ||
asdf-system: homestead | ||
- uses: 40ants/run-tests@v2 | ||
with: | ||
asdf-system: homestead | ||
run-test: | | ||
(ql:quickload :fiveam) | ||
(asdf:test-system :homestead) |
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,13 @@ | ||
(defpackage homestead/tests | ||
(:use :cl :fiveam) | ||
(:export :all-tests)) | ||
|
||
(in-package :homestead/tests) | ||
|
||
(def-suite all-tests :description "Top-level test suite for all tests.") | ||
|
||
(defun run-all! () | ||
(let ((ok (run! 'all-tests))) | ||
(if ok | ||
(format t "✅ All tests passed") | ||
(error "❌ At least one suite failed")))) |
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,20 @@ | ||
(defpackage homestead/tests/util | ||
(:use :cl :fiveam) | ||
(:export :util-test-suite :|util-test-suite|)) | ||
|
||
(in-package :homestead/tests/util) | ||
|
||
(def-suite | ||
util-test-suite | ||
:description "Util test suite" | ||
:in homestead/tests:all-tests) | ||
(in-suite util-test-suite) | ||
|
||
(test join | ||
(let ((list '("a" "b"))) | ||
(is (string= (homestead/util:join list) "a, b")) | ||
(is (string= (homestead/util:join list " | ") "a | b")))) | ||
|
||
(test slurp | ||
(let ((missing-file "/tmp/bob.txt")) | ||
(is (equal '() (homestead/util:slurp missing-file))))) |