(Or at least a close approximation.)
This way, the ERT progress information in the mode line will be removed from all windows immediately after the test run finishes, rather than lingering around in some windows until you switch to them.
This should have been part of the previous commit.
On my machine, now runs ~500 tests per second rather than ~110. (Batch mode runs ~4000 per second.)
Removed the code that was commented out. Dropped `ert-simulate-command-post-hook' since it's probably not useful. Its only use (in nxhtmltest-suites) was rather questionable since the test code had a permanent side-effect on the value of the hook. Dropped `ert-simulate-command-delay' since its implementation (renaming the current buffer to display a temporary message) seemed too brittle. Split out `ert-run-idle-timers' as a separate function since what it does is orthogonal. If someone wants a function with all the above features, they can easily write one as a private utility for their own tests; it can call `ert-simulate-command' and (conditionally) `ert-run-idle-timers', do whatever would go in the post-hook, display a message, and delay. Until a convincing implementation of such a combined utility function emerges, it is better for ERT to provide only the building blocks.
Dropped `buffer-contains-p' and `buffer-changes-p' since they are currently unused, don't simplify the calling code much, and spelling out their definitions in-line can actually lead to better error messages from `should'. Replaced `correctly-indented-p' with `ert-buffer-string-reindented'.
…instead. This is simpler to understand and use.
…d-error'. Masatake YAMATO pointed out that these areas were unclear.
The new macro `ert-with-test-buffer' replaces both `with-test-buffer' and `ert-with-temp-buffer-include-file'. If you need input from files, combine `ert-with-temp-buffer' with `insert-file-contents'. The macro `with-test-buffer' was ad-hoc syntactic sugar around `insert', `goto-char', and `mark', and was not useful enough. Since test buffers are now linked from the results buffer, there no longer is a way to browse test buffers. Also gone is `ert-test-buffer-substitute'. It had too much overlap with `ert-filter-string' and was untested and unused.
This simplifies the code slightly, but not as much I had hoped: The distinction between `ert-test-result-with-condition' and `ert-test-failed' remains because of `ert-test-quit', which I am reluctant to merge with `ert-test-failed'.