mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Reuse -v
option result as target_platform
Backticks method invokes `/bin/sh` when the command contains quotes, and `sh` clears some environment variables set in runruby.rb to search the built shared library.
This commit is contained in:
parent
dfe7faa6b6
commit
c8b414b334
1 changed files with 5 additions and 6 deletions
|
@ -74,6 +74,7 @@ BT = Struct.new(:ruby,
|
||||||
:reset,
|
:reset,
|
||||||
:columns,
|
:columns,
|
||||||
:width,
|
:width,
|
||||||
|
:platform,
|
||||||
).new
|
).new
|
||||||
|
|
||||||
BT_STATE = Struct.new(:count, :error).new
|
BT_STATE = Struct.new(:count, :error).new
|
||||||
|
@ -184,6 +185,8 @@ End
|
||||||
else
|
else
|
||||||
BT.passed = BT.failed = BT.reset = ""
|
BT.passed = BT.failed = BT.reset = ""
|
||||||
end
|
end
|
||||||
|
target_version = `#{BT.ruby} -v`.chomp
|
||||||
|
BT.platform = target_version[/\[(.*)\]\z/, 1]
|
||||||
unless quiet
|
unless quiet
|
||||||
puts $start_time
|
puts $start_time
|
||||||
if defined?(RUBY_DESCRIPTION)
|
if defined?(RUBY_DESCRIPTION)
|
||||||
|
@ -193,7 +196,7 @@ End
|
||||||
else
|
else
|
||||||
puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
||||||
end
|
end
|
||||||
puts "Target is #{`#{BT.ruby} -v`.chomp}"
|
puts "Target is #{target_version}"
|
||||||
puts
|
puts
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
end
|
end
|
||||||
|
@ -334,11 +337,7 @@ def exec_test(pathes)
|
||||||
end
|
end
|
||||||
|
|
||||||
def target_platform
|
def target_platform
|
||||||
if BT.ruby
|
BT.platform or RUBY_PLATFORM
|
||||||
`#{BT.ruby} --disable-gems -e 'print RUBY_PLATFORM'`
|
|
||||||
else
|
|
||||||
RUBY_PLATFORM
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class Assertion < Struct.new(:src, :path, :lineno, :proc)
|
class Assertion < Struct.new(:src, :path, :lineno, :proc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue