Monday, February 02, 2009

shepherd: Re-run tests automatically on save

For the past few months I've been using a tool I wrote called Shepherd to help run my tests for me when I'm doing a fast edit/re-test cycle. Shepherd is an OS X only shell tool (although I'd like to see equivalents for other platforms) that uses FSEvents to watch a directory for edits and re-run the tests only when the right kind of file has been edited. This is nice for a couple of reasons: Your editor doesn't need to know tests are being run, and it'll automatically re-run the tests if the code changes for some other reason, like an hg revert.

There are some bugs (^C in the middle of a test run doesn't actually stop the in-progress test run, for example), but it's been a valuable tool for me, and I'm quite late in blogging about it so others can try it out. The code is hosted on BitBucket, so if you have improvements to make, please publish them there in a fork or queue so I can pick them up!


Post a Comment

<< Home