Hello!
I recently wrote a script to run FiveAM tests for one of my
libraries on many different implementations on your own machine:
https://gitlab.common-lisp.net/uri-template/uri-template2/blob/master/run-t…
It would be really nice if I did not have to copy-paste that script
to my other libraries, and instead could contribute a generalized
version to Roswell (on which the script is based) and have it work
for any project using any test library.
What I would like to be able to do, for any system:
(handler-case (asdf:test-system "system")
(asdf:test-op-test-failure (condition)
(princ condition uiop:*stderr*)
(uiop:quit 1)))
The attached patch adds an ASDF:TEST-OP-TEST-FAILURE condition that
test libraries can inherit from. I also added the necessary
functionality to FiveAM:
https://github.com/sionescu/fiveam/pull/58
It should be easy to add similar functionality to other testing
libraries. This will make test automation trivial, with few, if any,
changes required to systems that use ASDF and the testing libraries.
One thing I would like to discuss is which condition
ASDF:TEST-OP-TEST-FAILURE should inherit from. It definitely should
not be ERROR - there is no error in test-op, or in running the tests;
test failures are a regular and expected occurrence of running tests.
Also problematic is widespread abuse of HANDLER-CASE to catch any
ERROR; I am afraid if signaled from popular test libraries it would
break someone's test running code somewhere. WARNING seems like a
nice parent condition, but maybe having ASDF:TEST-OP-TEST-FAILURE
inherit from CONDITION is a better idea. Thoughts?
Vladimir
Hi!
I noticed a possible mistake in the dump-image code for CLISP:
--8<---------------cut here---------------start------------->8---
(apply #'ext:saveinitmem filename
:quiet t
:start-package *package*
:keep-global-handlers nil
:executable (if executable 0 t) ;--- requires clisp 2.48 or later, still catches --clisp-x
(when executable
(list
;; :parse-options nil ;--- requires a non-standard patch to clisp.
:norc t :script nil :init-function #'restore-image)))
--8<---------------cut here---------------end--------------->8---
According to the documentation
(https://clisp.sourceforge.io/impnotes/image.html):
> When non-NIL, the saved file will be a standalone executable. In this
> case, the #P".mem" extension is not added. On Win32 and Cygwin the
> extension #P".exe" is added instead. Additionally, if this argument
> is 0, the standard CLISP command line options will not be processed by
> the executable but will be placed into EXT:*ARGS* instead.
Here since we are setting `:executable` to 0 or t, the result is always
executable. I don't think this is right because then the result cannot
be loaded with `clisp -M path/ro/result`.
I believe the fix would be
```diff
- :executable (if executable 0 t)
+ :executable (if executable 0 nil)
```
Cheers!
--
Pierre Neidhardt
https://ambrevar.xyz/