Hi All, After I saw John Wiegley's chat with Sacha Chua a few months ago I decided to try writing some tests for Emacs and after going off on a few tangents along the way I've come up with the following: - kmacro-tests.el, tests for kmacro.el - should-call, a context-creating macro which can temporarily add advice to one or more named functions around the execution of some test code, and its close relative, should-not-call - autocover.el, a batch-mode code coverage tool Originally I thought it would be nice to see code coverage summarized as percentages instead of having to eyeball pink and tan splotches, then I got the idea to see if I could get it to run on all of Emacs's tests in batch mode. A substantial proportion of the .el files loaded by the test suite show buggy behavior under testcover, so I ended up making a list of over 100 files to exclude from code coverage. I've attached the results of my "make check-coverage" for the curious, but the testcover-related bugs need to be found and fixed before this is going to be useful for anyone. I have a couple of them narrowed down to nice reproducible cases and reported, but there are definitely more. I wrote should-call to make writing tests for kmacro.el easier. Advice is a really useful tool when writing tests, but making sure each advice-add is matched by an advice-remove inside an unwind-protect is a chore. I think other test writers would find should-call useful so I'd like to propose it for inclusion in ert. Is sending it to bug-gnu-emacs labeled WIP and PATCH like the recent lispy backtrace thread the best way to do that? Best regards, Gemini