Building simplicidade.org: notes, projects, and occasional rants

x-test-continuous

I've pushed a new tool to my scripts repository at GitHub, x-test-continuous.

This script watches changes in the ./lib and ./t directories, and executes the command given as argument on any changes. Right now, I've hardcoded a one second delay.

My usual command while I'm writing a new Perl module is this one:

x-test-continuous prove -l -v -r t

Now, my tests are a single "Save all" away.

An even better usage, in case you are using TextMate. First, open your TextMate preferences and enable Advanced > Saving > Save files when focus is lost. Then, run this command on a tall terminal window:

x-test-continuous 'clear; prove -l -v -r t'

Now you can just click or Cmd-Tab between TextMate and your Terminal window.

This script only runs on Mac OS X 10.5.x for now. Need to learn how to use inotify on Linux.