It's a hassle to have to switch from emacs to the shell, run unit tests, pick out the failure, switch back to emacs, navigate to the line, forget where you were supposed to go, switch back, etc etc.
The whole process is much easier with compilation-perl.el. This handy bit of code sets up patterns for compilation-mode so that test failures (among other things) are recognized. Just add compilation-perl.el to your emacs lisp directory and follow the directions at the top of the file for installation instructions.
So my test process is now:
- Hit
F4
(which I have mapped tocompile
). - If necessary, change the command to either
make test
or to run a specific test I'm working on (e.g.perl t/MyModule.t
). - If there's a failure, press
C-F4
(which I have mapped tonext-error
) and it brings me right to the failure. - Repeat from step 1 (but the second time around I don't need to do step 2 since the command is already set properly).