Could you use applescript to kill the job? I don't like that running the test would kill every instance of iTerm that it finds, since I usually have more than one running, and you could lose a lot of data this way.