Skip to content

Commit

Permalink
Merge branch 'master' of github.com:s-expressionists/Clostrum
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-strandh committed Jun 28, 2024
2 parents 3288f1a + ee8cd8c commit e748a58
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: SBCL environment variables
if: matrix.lisp == 'sbcl'
run: |
echo -e "LISP=sbcl\nLOAD=--load\nEVAL=--eval\nQUIT=--quit" >> $GITHUB_ENV
echo -e "LISP=sbcl --disable-debugger\nLOAD=--load\nEVAL=--eval\nQUIT=--quit" >> $GITHUB_ENV
- name: Install Ubuntu dependencies
if: matrix.os == 'ubuntu-22.04'
Expand All @@ -61,7 +61,7 @@ jobs:
curl -kLO https://beta.quicklisp.org/quicklisp.lisp
$LISP $LOAD quicklisp.lisp $EVAL "(quicklisp-quickstart:install)" $EVAL "(ql-util:without-prompting (ql:add-to-init-file))" $QUIT
$LISP $EVAL "(ql:quickload '(:clostrum-basic :clostrum-test))" $QUIT
- name: Run Regression Tests
run: |
$LISP $EVAL "(mapc #'asdf:load-system '(:clostrum-basic :clostrum-test))" $EVAL "(clostrum/test:run-tests-exit nil 'clostrum-basic:run-time-environment nil 'clostrum-basic:compilation-environment)"
13 changes: 11 additions & 2 deletions Code/Test/clostrum-test.asd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

(defsystem "clostrum-test"
:description "Test suite for a Clostrum implementation."
:depends-on ("clostrum" "fiveam")
:depends-on ("clostrum"
"clostrum-basic"
"fiveam")
:components
((:file "packages")
(:file "tests")))
(:file "tests"))
:perform (test-op (operation component)
(uiop:symbol-call
'#:clostrum/test '#:run-tests
nil ; client
(find-symbol "RUN-TIME-ENVIRONMENT" (find-package "CLOSTRUM-BASIC")) ; runtime env
nil ; evaluation env
(find-symbol "COMPILATION-ENVIRONMENT" (find-package "CLOSTRUM-BASIC"))))) ; compilation env
8 changes: 4 additions & 4 deletions Code/Test/tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
;;; on implementations than the cell merely existing and being boundp.
(test (call-undefined-function :fixture with-envs)
(let* ((fname (make-symbol "F"))
(cell (sys:operator-cell cli renv fname)))
(cell (sys:ensure-operator-cell cli renv fname)))
(signals undefined-function (funcall (sys:operator-cell-value cli cell)))))

(test (function-binding :fixture with-envs)
Expand Down Expand Up @@ -223,7 +223,7 @@
(is-false (sys:type-cell-boundp
cli (sys:type-cell cli renv cname)))))

(test (make-class :fixture with-envs)
(test (find-class :fixture with-envs)
(let ((cname (make-symbol "C"))
(class (cl:find-class 'cons)))
(finishes (setf (env:find-class cli renv cname) class))
Expand All @@ -235,12 +235,12 @@
(signals error (env:find-class cli renv cname))
(is (null (env:find-class cli renv cname nil)))))

(test (make-type :fixture with-envs)
(test (type-expander :fixture with-envs)
(let ((tname (make-symbol "T"))
(expander (lambda (specifier env)
(declare (ignore specifier env))
'(or cons null))))
(finishes (env:make-type cli renv tname expander))
(finishes (setf (env:type-expander cli renv tname) expander))
(is (eql expander (env:type-expander cli renv tname)))
(is (equal '(or cons null) (env:type-expand-1 cli renv tname)))
(is (equal '(or cons null) (env:type-expand-1 cli renv `(,tname))))))
3 changes: 2 additions & 1 deletion Code/clostrum.asd
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
(:file "clostrum")
(:file "default-methods")
(:file "conditions")
(:file "documentation")))
(:file "documentation"))
:in-order-to ((test-op (test-op "clostrum-test"))))
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The Clostrum API is divided into two parts, a "high level" package `clostrum`, a

For operating on run-time environments, the `clostrum` package makes available environment manipulation functions and accessors similar to those in the standard: `fdefinition`, `fboundp`, `fmakunbound`, `macro-function`, `special-operator-p` for functions; `symbol-value`, `boundp`, `makunbound`, `symbol-plist` for variables; `find-class` for classes; `find-package` for packages; and `macroexpand-1`, `macroexpand`, and `constantp`.

There are additional functions and accessors corresponding to some other Lisp operators. `setf-expander` can be used for `define-setf-expander`; `make-variable`, `make-parameter`, `make-constant`, and `make-symbol-macro` for `defvar`, `defparameter`, `defconstant`, and `define-symbol-macro` respectively; and `make-type` and `type-expander` for `deftype`, along with `type-expand-1` and `type-expand` to work with type specifiers.
There are additional functions and accessors corresponding to some other Lisp operators. `setf-expander` can be used for `define-setf-expander`; `make-variable`, `make-parameter`, `make-constant`, and `make-symbol-macro` for `defvar`, `defparameter`, `defconstant`, and `define-symbol-macro` respectively; `type-expander` for `deftype`, along with `type-expand-1` and `type-expand` to work with type specifiers.

For proclamations, `proclamation` can be used for `declaration` or CLtL2's `define-declaration`. `variable-type` covers `type`, and `special` proclamations can be done with `make-variable`. `operator-ftype` handles `ftype` and `operator-inline` `inline`. User-defined inlining data, such as a definition, can be associated with an operator through `operator-inline-data`.

Expand Down

0 comments on commit e748a58

Please sign in to comment.