summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-test/mrbgem.rake
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-10-14 15:52:14 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-14 15:52:14 +0900
commit5b40bb8d159c1432bb87973b2b5f42473dd0c623 (patch)
tree7d845bda931b2842c21ed5e6113243d067103fc4 /mrbgems/mruby-test/mrbgem.rake
parent82046ff26ec9ae93d6d0cb5132a1dfd9651b5c3f (diff)
downloadmruby-5b40bb8d159c1432bb87973b2b5f42473dd0c623.tar.gz
mruby-5b40bb8d159c1432bb87973b2b5f42473dd0c623.zip
Avoid using C struct dump for test Ruby code.
Files under `test/t` and `mrbgem/*/test` are for tests, not for actual execution. So symbols in those files need not to be pre-allocated. This change slightly reduce the memory consumption.
Diffstat (limited to 'mrbgems/mruby-test/mrbgem.rake')
-rw-r--r--mrbgems/mruby-test/mrbgem.rake14
1 files changed, 7 insertions, 7 deletions
diff --git a/mrbgems/mruby-test/mrbgem.rake b/mrbgems/mruby-test/mrbgem.rake
index 9e8e4041f..0df683f7f 100644
--- a/mrbgems/mruby-test/mrbgem.rake
+++ b/mrbgems/mruby-test/mrbgem.rake
@@ -28,7 +28,7 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
file assert_c => [assert_rb, build.mrbcfile] do |t|
mkdir_p File.dirname(t.name)
open(t.name, 'w') do |f|
- mrbc.run f, assert_rb, 'mrbtest_assert_proc'
+ mrbc.run f, assert_rb, 'mrbtest_assert_irep', false
end
end
@@ -56,12 +56,12 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
f.puts %Q[ * All manual changes will get lost.]
f.puts %Q[ */]
if test_preload.nil?
- f.puts %Q[extern const struct RProc mrbtest_assert_proc[];]
+ f.puts %Q[extern const uint8_t mrbtest_assert_irep[];]
else
- g.build.mrbc.run f, test_preload, "gem_test_#{g.funcname}_preload"
+ g.build.mrbc.run f, test_preload, "gem_test_irep_#{g.funcname}_preload", false
end
g.test_rbfiles.flatten.each_with_index do |rbfile, i|
- g.build.mrbc.run f, rbfile, "gem_test_#{g.funcname}_#{i}_proc"
+ g.build.mrbc.run f, rbfile, "gem_test_irep_#{g.funcname}_#{i}", false
end
f.puts %Q[void mrb_#{g.funcname}_gem_test(mrb_state *mrb);] unless g.test_objs.empty?
dep_list.each do |d|
@@ -90,9 +90,9 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
end
f.puts %Q[ mrb_init_test_driver(mrb2, mrb_test(mrb_gv_get(mrb, mrb_intern_lit(mrb, "$mrbtest_verbose"))));]
if test_preload.nil?
- f.puts %Q[ mrb_load_proc(mrb2, mrbtest_assert_proc);]
+ f.puts %Q[ mrb_load_irep(mrb2, mrbtest_assert_irep);]
else
- f.puts %Q[ mrb_load_proc(mrb2, gem_test_#{g.funcname}_preload);]
+ f.puts %Q[ mrb_load_irep(mrb2, gem_test_irep_#{g.funcname}_preload);]
end
f.puts %Q[ if (mrb2->exc) {]
f.puts %Q[ mrb_print_error(mrb2);]
@@ -113,7 +113,7 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
f.puts %Q[ mrb_#{g.funcname}_gem_test(mrb2);] if g.custom_test_init?
- f.puts %Q[ mrb_load_proc(mrb2, gem_test_#{g.funcname}_#{i}_proc);]
+ f.puts %Q[ mrb_load_irep(mrb2, gem_test_irep_#{g.funcname}_#{i});]
f.puts %Q[ ]
f.puts %Q[ mrb_t_pass_result(mrb, mrb2);]