Permalink
Browse files

Merge branch 'stable-2.1' of git@github.com:FooBarWidget/passenger in…

…to stable-2.1
  • Loading branch information...
FooBarWidget committed Mar 13, 2009
2 parents aca72e8 + 66cbcc2 commit 01c0f89a805878f741cb871de30d30b563c4a26d
Showing with 31 additions and 14 deletions.
  1. +18 −7 Rakefile
  2. +9 −3 lib/phusion_passenger/platform_info.rb
  3. +4 −1 test/integration_tests.rb
  4. +0 −3 test/stub/apache2/httpd.conf.erb
View
@@ -286,20 +286,31 @@ subdir 'test' do
desc "Run unit tests for the Ruby libraries"
task 'test:ruby' => [:native_support] do
- sh "spec -c -f s ruby/*.rb ruby/*/*.rb"
+ if PlatformInfo::RSPEC.nil?
+ abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
+ else
+ ruby "#{PlatformInfo::RSPEC} -c -f s ruby/*.rb ruby/*/*.rb"
+ end
end
task 'test:rcov' => [:native_support] do
- rspec = PlatformInfo.find_command('spec')
- sh "rcov", "--exclude",
- "lib\/spec,\/spec$,_spec\.rb$,support\/,platform_info,integration_tests",
- rspec, "--", "-c", "-f", "s",
- *Dir["ruby/*.rb", "ruby/*/*.rb", "integration_tests.rb"]
+ if PlatformInfo::RSPEC.nil?
+ abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
+ else
+ sh "rcov", "--exclude",
+ "lib\/spec,\/spec$,_spec\.rb$,support\/,platform_info,integration_tests",
+ PlatformInfo::RSPEC, "--", "-c", "-f", "s",
+ *Dir["ruby/*.rb", "ruby/*/*.rb", "integration_tests.rb"]
+ end
end
desc "Run integration tests"
task 'test:integration' => [:apache2, :native_support] do
- sh "spec -c -f s integration_tests.rb"
+ if PlatformInfo::RSPEC.nil?
+ abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
+ else
+ ruby "#{PlatformInfo::RSPEC} -c -f s integration_tests.rb"
+ end
end
file 'oxt/oxt_test_main' => TEST::OXT_OBJECTS.keys.map{ |x| "oxt/#{x}" } +
@@ -81,9 +81,14 @@ def self.locate_ruby_executable(name)
# On OS X we must look for Ruby binaries in /usr/bin.
# RubyGems puts executables (e.g. 'rake') in there, not in
# /System/Libraries/(...)/bin.
- return "/usr/bin/#{name}"
+ filename = "/usr/bin/#{name}"
else
- return File.dirname(RUBY) + "/#{name}"
+ filename = File.dirname(RUBY) + "/#{name}"
+ end
+ if File.file?(filename) && File.executable?(filename)
+ return filename
+ else
+ return nil
end
end
@@ -152,9 +157,10 @@ def self.read_file(filename)
public
# The absolute path to the current Ruby interpreter.
RUBY = Config::CONFIG['bindir'] + '/' + Config::CONFIG['RUBY_INSTALL_NAME'] + Config::CONFIG['EXEEXT']
- # The correct 'gem' and 'rake' commands for this Ruby interpreter.
+ # The correct 'gem', 'rake' and 'spec' commands for this Ruby interpreter.
GEM = locate_ruby_executable('gem')
RAKE = locate_ruby_executable('rake')
+ RSPEC = locate_ruby_executable('spec')
# Check whether the specified command is in $PATH, and return its
# absolute filename. Returns nil if the command is not found.
@@ -766,7 +766,10 @@ def public_file(name)
def check_hosts_configuration
begin
ok = Resolv.getaddress("passenger.test") == "127.0.0.1"
- rescue Resolv::ResolvError
+ rescue Resolv::ResolvError, ArgumentError
+ # There's a bug in Ruby 1.8.6-p287's resolv.rb library, which causes
+ # an ArgumentError to be raised instead of ResolvError when resolving
+ # failed.
ok = false
end
if !ok
@@ -11,9 +11,6 @@ Listen 127.0.0.1:<%= @port %>
<% if !has_builtin_module?('mod_log_config.c') %>
LoadModule log_config_module "<%= modules_dir %>/mod_log_config.so"
<% end %>
-<% if !has_builtin_module?('mod_mime.c') && has_module?('mod_unique_id.so') %>
- LoadModule unique_id_module "<%= modules_dir %>/mod_unique_id.so"
-<% end %>
<% if !has_builtin_module?('mod_mime.c') %>
LoadModule mime_module "<%= modules_dir %>/mod_mime.so"
<% end %>

0 comments on commit 01c0f89

Please sign in to comment.