aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest/runner.rb
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 02:47:16 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 02:47:16 +0000
commit589602f1fe3cdc753d4dad588933738faf71eb87 (patch)
tree8d3b9e7c97dc6919da402c07ce8c9fdf73b6e8d3 /bootstraptest/runner.rb
parentde4b26bf1061ae9c15cc0d393ea14f7950ea4975 (diff)
downloadruby-589602f1fe3cdc753d4dad588933738faf71eb87.tar.gz
improve C0 coverage of insns.def from 65.9% to 96.1%
While I was developing my private topic branch I found that the VM itself is not tested very much in `make test` tests. Of course `make test-all` covers vast majority of the VM but running that task is not an immediately possible thing when we are touching the VM. In order to boost development in a rapid cycle I decided to add some tests to the bootstraptest. Here it is. * test_insns.rb: new test that covers insns.def. * runner.rb (#assert_equal): pass extra options to the target so that we can test frozen_string_literal: true situation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/runner.rb')
-rwxr-xr-xbootstraptest/runner.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 754c3f0f3b..110b00d658 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -267,17 +267,17 @@ def nacl?
@ruby and File.basename(@ruby.split(/\s/).first)['sel_ldr']
end
-def assert_check(testsrc, message = '', opt = '')
+def assert_check(testsrc, message = '', opt = '', **argh)
show_progress(message) {
- result = get_result_string(testsrc, opt)
+ result = get_result_string(testsrc, opt, **argh)
check_coredump
yield(result)
}
end
-def assert_equal(expected, testsrc, message = '')
+def assert_equal(expected, testsrc, message = '', opt = '', **argh)
newtest
- assert_check(testsrc, message) {|result|
+ assert_check(testsrc, message, opt, **argh) {|result|
if expected == result
nil
else
@@ -419,18 +419,19 @@ def untabify(str)
str.gsub(/^\t+/) {' ' * (8 * $&.size) }
end
-def make_srcfile(src)
+def make_srcfile(src, frozen_string_literal: nil)
filename = 'bootstraptest.tmp.rb'
File.open(filename, 'w') {|f|
+ f.puts "#frozen_string_literal:true" if frozen_string_literal
f.puts "GC.stress = true" if $stress
f.puts "print(begin; #{src}; end)"
}
filename
end
-def get_result_string(src, opt = '')
+def get_result_string(src, opt = '', **argh)
if @ruby
- filename = make_srcfile(src)
+ filename = make_srcfile(src, **argh)
begin
`#{@ruby} -W0 #{opt} #{filename}`
ensure