Skip to content

Commit 3a8d308

Browse files
committed
merge revision(s) 40059,40061:
* test/ruby/envutil.rb (assert_separately): stop_auto_run of Test::Unit::Runner to prevent auto runner use ARGV. * test/ruby/envutil.rb (assert_separately): add $: to separate process. * test/ruby/envutil.rb (assert_separately): fail if stderr is not empty and ignore_stderr is false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 5201338 commit 3a8d308

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Tue Jun 18 02:49:20 2013 NARUSE, Yui <[email protected]>
2+
3+
* test/ruby/envutil.rb (assert_separately): stop_auto_run of
4+
Test::Unit::Runner to prevent auto runner use ARGV.
5+
6+
* test/ruby/envutil.rb (assert_separately): add $: to separate process.
7+
8+
* test/ruby/envutil.rb (assert_separately): fail if stderr is not
9+
empty and ignore_stderr is false.
10+
111
Tue Jun 18 02:21:54 2013 NARUSE, Yui <[email protected]>
212

313
* test/ruby/envutil.rb (EnvUtil.with_default_external): add for

test/ruby/envutil.rb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,31 @@ def assert_separately(args, file = nil, line = nil, src, **opt)
286286
ensure
287287
puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
288288
end
289+
class Test::Unit::Runner
290+
@@stop_auto_run = true
291+
end
289292
eom
293+
args = args.dup
294+
$:.each{|l| args.unshift "-I#{l}" }
295+
ignore_stderr = opt.delete(:ignore_stderr)
290296
stdout, stderr, status = EnvUtil.invoke_ruby(args, src, true, true, opt)
291297
abort = status.coredump? || (status.signaled? && ABORT_SIGNALS.include?(status.termsig))
292298
assert(!abort, FailDesc[status, stderr])
293299
self._assertions += stdout[/^assertions=(\d+)/, 1].to_i
294300
res = Marshal.load(stdout.unpack("m")[0])
295-
return unless res
296-
res.backtrace.each do |l|
297-
l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"}
301+
if res
302+
res.backtrace.each do |l|
303+
l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"}
304+
end
305+
raise res
306+
end
307+
308+
# really is it succeed?
309+
unless ignore_stderr
310+
# the body of assert_separately must not output anything to detect errror
311+
assert_equal("", stderr, "assert_separately failed with error message")
298312
end
299-
raise res
313+
assert_equal(0, status, "assert_separately failed: '#{stderr}'")
300314
end
301315

302316
def assert_warning(pat, message = nil)

test/ruby/test_require.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def test_race_exception
423423
# in C-level. And redirecting stderr to a pipe seems to change
424424
# some blocking timings and causes a deadlock, so run in a
425425
# separated process for the time being.
426-
assert_separately(["-w", "-", path, bug5754], <<-'end;')
426+
assert_separately(["-w", "-", path, bug5754], <<-'end;', ignore_stderr: true)
427427
path, bug5754 = *ARGV
428428
start = false
429429

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.0.0"
22
#define RUBY_RELEASE_DATE "2013-06-18"
3-
#define RUBY_PATCHLEVEL 225
3+
#define RUBY_PATCHLEVEL 226
44

55
#define RUBY_RELEASE_YEAR 2013
66
#define RUBY_RELEASE_MONTH 6

0 commit comments

Comments
 (0)