Permalink
Browse files

update Guardfile to use rebar suites intead of suite

also make it more resilient in case of missing Growl and
update rebar
  • Loading branch information...
1 parent ee02142 commit 73c0fab5d43d1a540e5519b3c3d65679cd6c2e45 @martinrehfeld committed Sep 23, 2012
Showing with 12 additions and 6 deletions.
  1. +12 −6 Guardfile
  2. BIN rebar
View
@@ -2,6 +2,14 @@
# automatically run the eunit tests
+unless defined?(Growl)
+ class Growl
+ def self.notify_ok(*args); end
+ def self.notify_warning(*args); end
+ def self.notify_error(*args); end
+ end
+end
+
def run_eunit_all
cmd = "./rebar eunit skip_deps=true"
puts "Executing #{cmd}"
@@ -13,9 +21,10 @@ def run_eunit_all
end
end
-def run_eunit(app, src, suite)
- if File.exist?(File.join(File.dirname(__FILE__), app, 'test', "#{suite}_tests.erl"))
- cmd = "./rebar eunit skip_deps=true suite=#{suite}"
+def run_eunit(app_dir, src, suite)
+ if File.exist?(File.join(File.dirname(__FILE__), app_dir, 'test', "#{suite}_tests.erl"))
+ app = app_dir.sub(/^apps\//, '').chop
+ cmd = "./rebar eunit skip_deps=true apps=#{app} suites=#{suite}"
puts "Executing #{cmd}"
puts `#{cmd}`
if $? == 0
@@ -29,9 +38,6 @@ def run_eunit(app, src, suite)
end
end
-def run_spec
-end
-
guard 'shell' do
watch(%r{(apps/.*?)(src|test)/([^.].*?)(_tests)?.erl}) {|m| run_eunit(m[1], m[2], m[3]) }
watch(%r{apps/(.*?)/include/([^.].*).hrl}) {|m| run_eunit_all }
View
Binary file not shown.

0 comments on commit 73c0fab

Please sign in to comment.