Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into nginx

Conflicts:

	Rakefile
	bin/passenger-install-apache2-module
	test/integration_tests.rb
  • Loading branch information...
commit 119f839163dcd9148c6a02f4b4eb2ab73b78808f 2 parents 800ff29 + a7051bf
Hongli Lai FooBarWidget authored
39 Rakefile
View
@@ -471,17 +471,26 @@ end
desc "Run unit tests for the Ruby libraries"
task 'test:ruby' => :native_support do
- sh "cd test && 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
+ Dir.chdir("test") do
+ ruby "#{PlatformInfo.rspec} -c -f s ruby/*.rb ruby/*/*.rb"
+ end
+ end
end
desc "Run coverage tests for the Ruby libraries"
task 'test:rcov' => :native_support do
- rspec = PlatformInfo.find_command('spec')
- Dir.chdir("test") do
- 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
+ Dir.chdir("test") do
+ 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
end
@@ -491,12 +500,24 @@ end
desc "Run Apache 2 integration tests"
task 'test:integration:apache2' => [:apache2, :native_support] do
- sh "cd test && spec -c -f s integration_tests/apache2_tests.rb"
+ if PlatformInfo.rspec.nil?
+ abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
+ else
+ Dir.chdir("test") do
+ ruby "#{PlatformInfo.rspec} -c -f s integration_tests/apache2_tests.rb"
+ end
+ end
end
desc "Run Nginx integration tests"
task 'test:integration:nginx' => :nginx do
- sh "cd test && spec -c -f s integration_tests/nginx_tests.rb"
+ if PlatformInfo.rspec.nil?
+ abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
+ else
+ Dir.chdir("test") do
+ ruby "#{PlatformInfo.rspec} -c -f s integration_tests/nginx_tests.rb"
+ end
+ end
end
oxt_test_main_dependencies = TEST_OXT_OBJECTS.keys.map do |object|
8 bin/passenger-install-apache2-module
View
@@ -150,11 +150,11 @@ private
color_puts '<banner>Compiling and installing Apache 2 module...</banner>'
puts "cd #{PASSENGER_ROOT}"
if ENV['TRACE']
- puts "#{RUBY} -S #{RAKE} --trace clean apache2"
- return sh(RUBY, "-S", RAKE, "--trace", "clean", "apache2")
+ puts "#{RUBY} -S #{PlatformInfo.rake} --trace clean apache2"
+ return sh(RUBY, "-S", PlatformInfo.rake, "--trace", "clean", "apache2")
else
- puts "#{RUBY} -S #{RAKE} clean apache2"
- return sh(RUBY, "-S", RAKE, "clean", "apache2")
+ puts "#{RUBY} -S #{PlatformInfo.rake} clean apache2"
+ return sh(RUBY, "-S", PlatformInfo.rake, "clean", "apache2")
end
end
10 ext/common/ApplicationPoolServerExecutable.cpp
View
@@ -177,16 +177,16 @@ class Server {
} else {
calledBefore = true;
write(STDERR_FILENO,
- "*** ERROR: ApplicationPoolServerExecutable caught "
+ "*** ERROR: ApplicationPoolServerExecutable received a "
"fatal signal. Running gdb to obtain the backtrace:\n\n",
sizeof("*** ERROR: ApplicationPoolServerExecutable caught "
- "fatal signal. Running gdb to obtain the backtrace:\n\n")
+ "fatal signal. Running gdb to obtain the backtrace:\n\n") - 1
);
write(STDERR_FILENO, "----------------- Begin gdb output -----------------\n",
- sizeof("----------------- Begin gdb output -----------------\n"));
+ sizeof("----------------- Begin gdb output -----------------\n") - 1);
system(gdbBacktraceGenerationCommandStr);
write(STDERR_FILENO, "----------------- End gdb output -----------------\n",
- sizeof("----------------- End gdb output -----------------\n"));
+ sizeof("----------------- End gdb output -----------------\n") - 1);
defaultHandler(signum);
}
}
@@ -210,7 +210,7 @@ class Server {
// Write a file which contains commands for gdb to obtain
// the backtrace of this process.
fprintf(f, "attach %lu\n", (unsigned long) getpid());
- fprintf(f, "thread apply all bt\n");
+ fprintf(f, "thread apply all bt full\n");
fclose(f);
chmod(gdbCommandFile.c_str(), S_IRUSR | S_IRGRP | S_IROTH);
7 lib/phusion_passenger/dependencies.rb
View
@@ -195,11 +195,10 @@ def self.fastthread_required?
Rake = Dependency.new do |dep|
dep.name = "Rake"
dep.define_checker do |result|
- rake = PlatformInfo::RAKE
- if File.executable?(rake)
- result.found(rake)
- else
+ if PlatformInfo.rake.nil?
result.not_found
+ else
+ result.found(PlatformInfo.rake)
end
end
dep.website = "http://rake.rubyforge.org/"
41 lib/phusion_passenger/platform_info.rb
View
@@ -86,9 +86,27 @@ 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
+ # RubyGems might put binaries in a directory other
+ # than Ruby's bindir. Debian packaged RubyGems and
+ # DebGem packaged RubyGems are the prime examples.
+ begin
+ require 'rubygems' unless defined?(Gem)
+ filename = Gem.bindir + "/#{name}"
+ if File.file?(filename) && File.executable?(filename)
+ return filename
+ else
+ return nil
+ end
+ rescue LoadError
+ return nil
+ end
end
end
@@ -157,9 +175,8 @@ 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' command for this Ruby interpreter.
GEM = locate_ruby_executable('gem')
- RAKE = locate_ruby_executable('rake')
# Check whether the specified command is in $PATH, and return its
# absolute filename. Returns nil if the command is not found.
@@ -180,6 +197,22 @@ def self.find_command(name)
################ Programs ################
+ # Returns the absolute path to the Rake executable that
+ # belongs to the current Ruby interpreter. Returns nil if it
+ # doesn't exist.
+ def self.rake
+ return locate_ruby_executable('rake')
+ end
+ memoize :rake
+
+ # Returns the absolute path to the RSpec runner program that
+ # belongs to the current Ruby interpreter. Returns nil if it
+ # doesn't exist.
+ def self.rspec
+ return locate_ruby_executable('spec')
+ end
+ memoize :rspec
+
# The absolute path to the 'apxs' or 'apxs2' executable, or nil if not found.
def self.apxs2
if env_defined?("APXS2")
3  test/stub/apache2/httpd.conf.erb
View
@@ -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 %>
5 test/support/test_helper.rb
View
@@ -119,7 +119,10 @@ def post(uri, params = {})
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
Please sign in to comment.
Something went wrong with that request. Please try again.