summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-17 17:54:44 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-17 17:54:44 +0000
commit3a8d3080292073a5df9ce70f34c92a3fc6312c9a (patch)
tree77cf0cc2de30fdde1d029c4f70112c760b300efd
parent520133871f1dfdf9b454f7710f753343c37406cb (diff)
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
-rw-r--r--ChangeLog10
-rw-r--r--test/ruby/envutil.rb22
-rw-r--r--test/ruby/test_require.rb2
-rw-r--r--version.h2
4 files changed, 30 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f4fcc66d4d..a78c763994 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Jun 18 02:49:20 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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.
+
Tue Jun 18 02:21:54 2013 NARUSE, Yui <naruse@ruby-lang.org>
* test/ruby/envutil.rb (EnvUtil.with_default_external): add for
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index 0aa97e4341..cceadb9495 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -286,17 +286,31 @@ module Test
ensure
puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
end
+ class Test::Unit::Runner
+ @@stop_auto_run = true
+ end
eom
+ args = args.dup
+ $:.each{|l| args.unshift "-I#{l}" }
+ ignore_stderr = opt.delete(:ignore_stderr)
stdout, stderr, status = EnvUtil.invoke_ruby(args, src, true, true, opt)
abort = status.coredump? || (status.signaled? && ABORT_SIGNALS.include?(status.termsig))
assert(!abort, FailDesc[status, stderr])
self._assertions += stdout[/^assertions=(\d+)/, 1].to_i
res = Marshal.load(stdout.unpack("m")[0])
- return unless res
- res.backtrace.each do |l|
- l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"}
+ if res
+ res.backtrace.each do |l|
+ l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"}
+ end
+ raise res
+ end
+
+ # really is it succeed?
+ unless ignore_stderr
+ # the body of assert_separately must not output anything to detect errror
+ assert_equal("", stderr, "assert_separately failed with error message")
end
- raise res
+ assert_equal(0, status, "assert_separately failed: '#{stderr}'")
end
def assert_warning(pat, message = nil)
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index ff5a519638..c03876d223 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -423,7 +423,7 @@ class TestRequire < Test::Unit::TestCase
# in C-level. And redirecting stderr to a pipe seems to change
# some blocking timings and causes a deadlock, so run in a
# separated process for the time being.
- assert_separately(["-w", "-", path, bug5754], <<-'end;')
+ assert_separately(["-w", "-", path, bug5754], <<-'end;', ignore_stderr: true)
path, bug5754 = *ARGV
start = false
diff --git a/version.h b/version.h
index 632351734b..b11950e4d2 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-06-18"
-#define RUBY_PATCHLEVEL 225
+#define RUBY_PATCHLEVEL 226
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 6