inotify support for autotest

autotest is a really great tool. But my laptop is too old and the current autotest method to detect modifications is a bit heavy for it.

Like Mark Scottishclimbs, I thought about using ruby-inotify to detect changes in source files.

Add to your .autotest file this piece of code to add inotify support. A small change in Autotest#wait_for_changes replaces the simple sleep by a waiting of an inotify event.

Update: ruby-inotify seems buggy. I’ve switched successfully the implementation to inotify. Just download INotify-0.3.0.rb into your load path (such /usr/local/lib/site_ruby/1.8). No native library is required.

6 thoughts on “inotify support for autotest

  1. Ryan Davis

    I dunno what lappy you’re running on, but it ran very light on my 12″ pb (1.2Mhz PPC G4?).

    autotest’s file scan runs proportional to the number of files in the directory tree it starts in (obviously) minus the files you tell it to exclude.

    If you’re doing rails development and have a way packed vendor dir, add vendor to the exclusions regexp (it’ll be a much cleaner process in the next release of zentest) and you should see a drop in CPU.

  2. joe

    What bugs did you run into with ruby-inotify? You solution requires that /dev/inotify exist, and that doesn’t exist on my system (I heard that it got phased out, something about inotifyfs)… I also ran across RInotify which i haven’t tried yet: http://rubyforge.org/projects/rinotify/

    anyways, I wrote a little script with ruby-inotify and it’s been working ok to monitor directory changes for the last 15 minutes or so, just curious what I have to watch out for.

  3. she

    Are there really bugs in ruby-inotify?

    I am a bit unsure now, would be nice if you could explain what is the problem

  4. Ryan Davis

    If you’re running high CPU on autotest, you either have too much crap in your project and/or you’re not excluding enough in your .autotest.

    I won’t be touching inotify or any other platform specific hacks.

  5. Pingback: autotest-inotify: extend autotest to use inotify - Duplo

Comments are closed.