On Feb 5, 2007, at 5:41 AM, Adam Kennedy wrote:

Short of running each test in some sort of transactional file system (do such things exist? Are they common?) or cloning the build directory before each test...


Here's a terrible, non-portable idea:
 * create a new, empty temp directory
* use UnionFS[1] or Aufs[2] to mount that temp dir read-write overlaid on your build folder as read-only.
 * chdir to that new filesystem (or chroot?)
* run your tests (which copy-on-write through the unioned FS to the temp dir)
 * chdir back
 * unmount the unioned FS
 * delete the temp dir

Rather than being transactional, it's instead a throw-away branch of your filesystem. Like a BEGIN where you never plan to COMMIT.

Chris

[1] http://en.wikipedia.org/wiki/UnionFS
http://lwn.net/Articles/219827/ (subscribers only until this Thursday)
[2] http://aufs.sourceforge.net/


--
Chris Dolan, Equilibrious LLC, http://equilibrious.net/
Public key: http://chrisdolan.net/public.key
vCard: http://chrisdolan.net/ChrisDolan.vcf



Reply via email to