-
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.
- Loading branch information
1 parent
b99cb37
commit 03eb789
Showing
6 changed files
with
108 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: 👷 Testing | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: containers.common-lisp.net/cl-docker-images/sbcl:latest | ||
|
||
env: | ||
GITHUB_ACTION: true | ||
QUICKLISP_SETUP: /github/home/quicklisp/setup.lisp | ||
GITHUB_WORKSPACE: | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: prepare quicklisp | ||
shell: bash | ||
run: | | ||
install-quicklisp && \ | ||
if [ ! -f ${{ env.QUICKLISP_SETUP }} ]; then \ | ||
echo "Did not find Quicklisp setup file where expected: ${QUICKLISP_SETUP}"; \ | ||
find / -name 'quicklisp' -type d ; \ | ||
fi | ||
- name: test | ||
shell: bash | ||
run: | | ||
./run-tests.sh |
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
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,33 @@ | ||
(in-package :common-lisp-user) | ||
|
||
(require :asdf) | ||
|
||
(declaim (optimize (speed 3) (space 3) (safety 3))) | ||
|
||
(asdf:load-system "asdf") | ||
|
||
(asdf:initialize-source-registry '(:source-registry (:tree :here) :inherit-configuration)) | ||
|
||
;;; try to find Quicklisp -- this is a mess because it isn't consistently installed in the | ||
;;; same location. | ||
(if (uiop:find-package* '#:ql nil) | ||
(format t "~&Quicklisp pre-loaded into image.~%") | ||
(let ((ql-filename (uiop:getenv "QUICKLISP_SETUP")) | ||
loaded) | ||
(if ql-filename | ||
(if (probe-file ql-filename) | ||
(let ((result (load ql-filename :if-does-not-exist nil))) | ||
(when result | ||
(format t "~&Have loaded quicklisp setup file ~a.~%" ql-filename) | ||
(setf loaded t))) | ||
(format t "Quicklisp not installed where expected: ~a~%" ql-filename))) | ||
(unless loaded | ||
(let* ((fallback-name "/root/quicklisp/setup.lisp") | ||
(result (load fallback-name :if-does-not-exist nil))) | ||
(when result | ||
(format t "~&Have loaded quicklisp setup file from /root.~%") | ||
(setf loaded t)))) | ||
(unless loaded | ||
(format t "~&Unable to find quicklisp.~%") | ||
(uiop:quit 1 t)))) | ||
|
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,7 @@ | ||
#!/bin/bash | ||
|
||
sbcl --non-interactive \ | ||
--load 'load-deps.lisp' \ | ||
--eval '(ql:quickload :html2clwho/tests)' \ | ||
--eval '(asdf:load-system :html2clwho)' \ | ||
--eval '(uiop:quit (if (html2clwho.test::run-tests) 0 1))' |
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,23 @@ | ||
(defpackage :html2clwho.test | ||
(:use :cl :html2clwho :fiveam)) | ||
(in-package :html2clwho.test) | ||
|
||
(def-suite html2clwho-suite :description "Build sexp from html") | ||
(in-suite html2clwho-suite) | ||
|
||
(defun is-html (str sexp) | ||
(is (equal (string-trim '(#\Newline) (html2clwho::build-sexp str)) sexp))) | ||
|
||
(def-test empty-tag () | ||
(is-html "<html></html>" "(:html)")) | ||
|
||
(def-test some-classes () | ||
(is-html "<div class=\"col-md-4\"></div>" "(:div :class \"col-md-4\")")) | ||
|
||
(def-test some-content () | ||
(is-html "<div><span>Hello</span></div>" "(:div | ||
(:span \"Hello\"))")) | ||
|
||
;; https://stackoverflow.com/questions/54889460/asdftest-system-from-a-makefile-doesnt-return-an-error-return-code | ||
(defun run-tests () | ||
(run! 'html2clwho-suite)) |