[PATCH] Add a TEST-OP-TEST-FAILURE condition for test libraries to sub-class

Vladimir Sedach vas at oneofus.la
Sun Sep 15 03:07:48 UTC 2019


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-tests.lisp

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-TEST-OP-TEST-FAILURE-condition-for-test-librar.patch
Type: text/x-diff
Size: 3282 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20190914/1f64b0e4/attachment.patch>


More information about the asdf-devel mailing list