forked from pluskid/rmmseg-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.rake
38 lines (29 loc) · 855 Bytes
/
test.rake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# $Id$
require 'rake/testtask'
namespace :test do
Rake::TestTask.new(:run) do |t|
t.libs = PROJ.libs
t.test_files = if test(?f, PROJ.test.file) then [PROJ.test.file]
else PROJ.test.files end
t.ruby_opts += PROJ.ruby_opts
t.ruby_opts += PROJ.test.opts
end
if HAVE_RCOV
desc 'Run rcov on the unit tests'
task :rcov => :clobber_rcov do
opts = PROJ.rcov.opts.dup << '-o' << PROJ.rcov.dir
opts = opts.join(' ')
files = if test(?f, PROJ.test.file) then [PROJ.test.file]
else PROJ.test.files end
files = files.join(' ')
sh "#{RCOV} #{files} #{opts}"
end
task :clobber_rcov do
rm_r 'coverage' rescue nil
end
end
end # namespace :test
desc 'Alias to test:run'
task :test => 'test:run'
task :clobber => 'test:clobber_rcov' if HAVE_RCOV
# EOF