]> git.wincent.com - wikitext.git/commitdiff
Set-up autotest to run whenever a new binary is built
authorWincent Colaiuta <win@wincent.com>
Wed, 30 Jan 2008 14:05:18 +0000 (15:05 +0100)
committerWincent Colaiuta <win@wincent.com>
Wed, 30 Jan 2008 14:05:18 +0000 (15:05 +0100)
This is made possible now thanks to the new "add_mapping" method in
ZenTest 3.8.0.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
.autotest [new file with mode: 0644]
Rakefile
ext/.gitignore

diff --git a/.autotest b/.autotest
new file mode 100644 (file)
index 0000000..523f127
--- /dev/null
+++ b/.autotest
@@ -0,0 +1,9 @@
+Autotest.add_hook :initialize do |a|
+  all_specs = %r%^spec/.+_spec\.rb$%
+  a.add_mapping(%r%^ext/\.built$%) {
+    a.files_matching all_specs
+  }
+  a.add_mapping(%r%^\.autotest$%) {
+    a.files_matching all_specs
+  }
+end
index d99f84d098e79b2e06ca19044586965b2a655d80..72234a745a9a1e59ad97c13a361f9b2aa7311230 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -52,7 +52,7 @@ end
 
 file built_extension => extension_files do
   Dir.chdir('ext') do
-    sh 'make'
+    sh 'make && touch .built'
   end
 end
 
index 57b7201e0024703d7e136e10637d2a811be737dd..a6fd420a5e1310471631b323f758ddc40cfd0c6c 100644 (file)
@@ -4,4 +4,5 @@ Makefile
 *.tokens
 *.bundle
 *.so
+.built