-
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
70 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,35 @@ | ||
### 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 | ||
|
||
steps: | ||
# This action checks out our code in the working directory | ||
- uses: actions/checkout@v2 | ||
# setup-lisp requires an env variable to be set, not matrix.lisp | ||
- name: Set LISP env var | ||
run: echo "LISP=sbcl-bin" >> $GITHUB_ENV | ||
# This action installs roswell and a few other utilities such as qlot | ||
- uses: 40ants/setup-lisp@v2 | ||
|
||
# These steps run our tests | ||
# Windows needs to be run with the msys2 shell due to how roswell is installed | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
# Install the roswell script for the test library | ||
ros install neil-lindquist/ci-utils # for run-fiveam | ||
#ros install prove # for run-prove: | ||
#ros install rove # for [run-] rove | ||
# Run the tests | ||
run-fiveam -e t -l homestead-tests :homestead-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(asdf:defsystem "homestead-tests" | ||
:author "Gosha Tcherednitchenko <[email protected]>" | ||
:license "MIT License" | ||
:depends-on ("homestead" "fiveam") | ||
:serial t | ||
:components ((:module "tests" | ||
:components ((:file "test-util")))) | ||
:perform (asdf:test-op (op system) | ||
(let* ((fiveam:*on-failure* :backtrace) | ||
(fiveam:*on-error* :backtrace) | ||
(fiveam:*verbose-failures* t)) | ||
(if (fiveam:run-all-tests :summary :end) | ||
(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
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,19 @@ | ||
(defpackage homestead/tests/util | ||
(:use :cl :it.bese.fiveam) | ||
(:export :util-test-suite :|util-test-suite|)) | ||
|
||
(in-package :homestead/tests/util) | ||
|
||
(def-suite | ||
util-test-suite | ||
:description "Util test suite") | ||
(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))))) |