|
From: <jh...@us...> - 2011-05-04 05:37:18
|
Revision: 275
http://etch.svn.sourceforge.net/etch/?rev=275&view=rev
Author: jheiss
Date: 2011-05-04 05:37:12 +0000 (Wed, 04 May 2011)
Log Message:
-----------
Ensure that the client and server are invoked with the same ruby the
user used to invoke the test suite. This allows us to test etch under
various ruby versions, etc.
Modified Paths:
--------------
trunk/test/etchtest.rb
Modified: trunk/test/etchtest.rb
===================================================================
--- trunk/test/etchtest.rb 2011-05-04 05:02:05 UTC (rev 274)
+++ trunk/test/etchtest.rb 2011-05-04 05:37:12 UTC (rev 275)
@@ -6,7 +6,10 @@
require 'tempfile'
require 'fileutils'
require 'net/http'
+require 'rbconfig'
+RUBY = File.join(*RbConfig::CONFIG.values_at("bindir", "ruby_install_name")) + RbConfig::CONFIG["EXEEXT"]
+
module EtchTests
# Roughly ../server and ../client
SERVERDIR = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/server"
@@ -47,7 +50,8 @@
repo = tempdir
# Put the basic files into that directory needed for a basic etch tree
- FileUtils.cp_r(Dir.glob("#{File.dirname(__FILE__)}/testrepo/*"), repo)
+ # :preserve to maintain executable permissions on the scripts
+ FileUtils.cp_r(Dir.glob("#{File.dirname(__FILE__)}/testrepo/*"), repo, :preserve => true)
hostname = `facter fqdn`.chomp
nodegroups_string = ''
@@ -127,9 +131,9 @@
end
else
if UNICORN
- exec("cd #{SERVERDIR} && unicorn_rails -p #{port}")
+ exec("cd #{SERVERDIR} && #{RUBY} `which unicorn_rails` -p #{port}")
else
- exec("cd #{SERVERDIR} && ./script/server -p #{port}")
+ exec("cd #{SERVERDIR} && #{RUBY} ./script/server -p #{port}")
end
end
{:port => port, :pid => pid, :repo => serverbase}
@@ -171,7 +175,7 @@
puts "#"
#sleep 3
end
- result = system("ruby #{CLIENTDIR}/etch --generate-all --test-root=#{testroot} #{server} #{key} #{extra_args}")
+ result = system("#{RUBY} #{CLIENTDIR}/etch --generate-all --test-root=#{testroot} #{server} #{key} #{extra_args}")
if options[:errors_expected]
assert(!result, options[:testname])
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|