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 found a ASDF-related CFFI bug a couple of days ago. Can anyone think of a
good way of fixing it?
A method in grovel/asdf.lisp adds output files of process-op to output
files of compile-op:
;;; Declare the .o and .so files as compilation outputs,
;;; so they get picked up by bundle operations.
#.(when (version<= "3.1.6" (asdf-version))
'(defmethod output-files ((op compile-op) (c wrapper-file))
(destructuring-bind (generated-lisp lib-file c-file o-file)
(output-files 'process-op c)
(declare (ignore generated-lisp c-file))
(multiple-value-bind (files translatedp) (call-next-method)
(values (append files (list lib-file o-file)) translatedp)))))
As a result inputs and outputs of the ops look like this:
process-op:
input: wrapper-file
output: bindings-file.lisp file.c FILE.O FILE.SO
compile-op:
input: bindings-file.lisp
output: bindings-file.fasl FILE.O FILE.SO
The problem is that process-op generates file.o and file.so before it
generates bindings-file.lisp. Thus compile-op gets re-executed all the
time, because its output files file.o and file.so are always older than its
input file bindings-file.lisp. And an execution of the compile-op does not
change anything, because it does not really generate .o and .so.
One way to fix it would be to "touch" .o and .so to get the right order of
file modification times, but there may be a better way.
CFFI bug report: https://bugs.launchpad.net/cffi/+bug/1889491
Thanks,
Ilya