1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

A minor fix to catch sqrt Domain error on Win32. Also made rcov task conditional to avoid test/build issues with users that don't have it installed.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@219 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
luislavena 2006-06-01 20:41:34 +00:00
parent d7cc24df04
commit 6806c3b2cf
2 changed files with 15 additions and 7 deletions

View file

@ -74,7 +74,11 @@ class Stats
# Calculates the standard deviation of the data so far.
def sd
# (sqrt( ((s).sumsq - ( (s).sum * (s).sum / (s).n)) / ((s).n-1) ))
Math.sqrt( (@sumsq - ( @sum * @sum / @n)) / (@n-1) )
begin
return Math.sqrt( (@sumsq - ( @sum * @sum / @n)) / (@n-1) )
rescue Errno::EDOM
return 0.0
end
end

View file

@ -1,5 +1,3 @@
require 'rcov/rcovtask'
def make(makedir)
Dir.chdir(makedir) do
sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
@ -111,8 +109,14 @@ def sub_project(project, *targets)
end
end
Rcov::RcovTask.new do |t|
t.test_files = FileList['test/test*.rb']
t.rcov_opts << "-x /usr"
t.output_dir = "test/coverage"
# Conditional require rcov/rcovtask if present
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |t|
t.test_files = FileList['test/test*.rb']
t.rcov_opts << "-x /usr"
t.output_dir = "test/coverage"
end
rescue
end