зеркало из https://github.com/github/ruby.git
test_open3.rb: let test_popen2 work with --jit
test/lib/jit_support.rb: add .remove_mjit_logs to normalize stderr git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6090206275
Коммит
d025f64a9f
|
@ -33,4 +33,12 @@ module JITSupport
|
||||||
err.match?(JIT_SUCCESS_PREFIX)
|
err.match?(JIT_SUCCESS_PREFIX)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def remove_mjit_logs(stderr)
|
||||||
|
if RubyVM::MJIT.enabled?
|
||||||
|
stderr.gsub(/^MJIT warning: Skipped to compile unsupported instruction: \w+\n/m, '')
|
||||||
|
else
|
||||||
|
stderr
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'open3'
|
require 'open3'
|
||||||
|
require_relative 'lib/jit_support'
|
||||||
|
|
||||||
class TestOpen3 < Test::Unit::TestCase
|
class TestOpen3 < Test::Unit::TestCase
|
||||||
RUBY = EnvUtil.rubybin
|
RUBY = EnvUtil.rubybin
|
||||||
|
@ -126,7 +127,7 @@ class TestOpen3 < Test::Unit::TestCase
|
||||||
i.close
|
i.close
|
||||||
STDERR.reopen(old)
|
STDERR.reopen(old)
|
||||||
assert_equal("zo", o.read)
|
assert_equal("zo", o.read)
|
||||||
assert_equal("ze", r.read)
|
assert_equal("ze", JITSupport.remove_mjit_logs(r.read))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче