This could be done by having an
ASDF-SINGLE-TEST-FAILURE
and anASDF-TEST-FAILURE
and raising the first at each failure, but by default trapping them and bundling them into theASDF-TEST-FAILURE
condition.It might make sense to bundle FiveAM's test report into the
ASDF-TEST-FAILURE
(or subclass thereof), so that it can be printed at an appropriate time.On 14 Sep 2019, at 20:48, Vladimir Sedach wrote:
Hello!I have a proposed patch to FiveAM on GitHub:I recently wrote a script to run FiveAM tests for one of mylibraries on many different implementations on your own machine:I do not want to copy-paste that script for all of my libraries. Itwould be nice to contribute a generalized version of the script toRoswell (on which the script is based), and just be able to say "rostest my-system in all installed implementations" for any system.The first step to doing that is to get ASDF:TEST-SYSTEM to reporterrors using a common interface.Because of the way ASDF is designed, ASDF:TEST-SYSTEM needs to useconditions to signal test failures. I like this idea. Since you donot have to handle conditions raised by SIGNAL, the functionality canbe added without impacting existing use or interfaces of FiveAM (theuse of WARNING instead of ERROR as the parent condition ofTEST-SPEC-FAILURE also ensures this, as many people tend to abuseHANDLER-CASE to indiscriminately catch ERRORs).With this patch, all projects that use FiveAM and define ASDF test-opshould be testable from a generic version of the Roswell scriptwithout any changes.The basic mechanism for test automation with FiveAM is then verysimple:(handler-case (asdf:test-system "system")(fiveam:test-spec-failure (condition)(princ condition uiop:*stderr*)(uiop:quit 1)))Other test libraries can have supported added as well:(handler-case (asdf:test-system "system")((or fiveam:test-spec-failure prove:test-failure) (condition)(princ condition uiop:*stderr*)(uiop:quit 1)))The goal is to introduce a parent condition in ASDF that FiveAM, etc., will then inherit from:(handler-case (asdf:test-system "system")(asdf:test-failure (condition)(princ condition uiop:*stderr*)(uiop:quit 1)))Ultimately, any system using any test library should be testable this way, ensuring that test automation becomes trivial to build.I am going to propose adding the parent condition to ASDF, but in themeantime (until the ASDF patch makes it to the repository, anotherrelease comes out, release becomes widely available…), I would like to get this code into FiveAM.Vladimir