diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-11 15:37:49 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:10 +0900 |
| commit | 52507b1083ba1c562ae506d63a07a51a26815c21 (patch) | |
| tree | 1c4087091f82fd792b5d81c3ef2c8c384e1854f4 /mrbgems/mruby-test | |
| parent | 7deb41b0e88b3670476ed86bab541340f5551b52 (diff) | |
| download | mruby-52507b1083ba1c562ae506d63a07a51a26815c21.tar.gz mruby-52507b1083ba1c562ae506d63a07a51a26815c21.zip | |
Generate C struct from `irep` instead of binary dump.
Diffstat (limited to 'mrbgems/mruby-test')
| -rw-r--r-- | mrbgems/mruby-test/driver.c | 4 | ||||
| -rw-r--r-- | mrbgems/mruby-test/mrbgem.rake | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/mrbgems/mruby-test/driver.c b/mrbgems/mruby-test/driver.c index a5f723927..fe1a475d5 100644 --- a/mrbgems/mruby-test/driver.c +++ b/mrbgems/mruby-test/driver.c @@ -18,7 +18,7 @@ #include <mruby/variable.h> #include <mruby/array.h> -extern const uint8_t mrbtest_assert_irep[]; +extern const struct RProc mrbtest_assert_proc[]; void mrbgemtest_init(mrb_state* mrb); void mrb_init_test_vformat(mrb_state* mrb); @@ -300,7 +300,7 @@ main(int argc, char **argv) } mrb_init_test_driver(mrb, verbose); - mrb_load_irep(mrb, mrbtest_assert_irep); + mrb_load_proc(mrb, mrbtest_assert_proc); mrbgemtest_init(mrb); ret = eval_test(mrb); mrb_close(mrb); diff --git a/mrbgems/mruby-test/mrbgem.rake b/mrbgems/mruby-test/mrbgem.rake index ced252ae6..9e8e4041f 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_irep' + mrbc.run f, assert_rb, 'mrbtest_assert_proc' 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 uint8_t mrbtest_assert_irep[];] + f.puts %Q[extern const struct RProc mrbtest_assert_proc[];] else - g.build.mrbc.run f, test_preload, "gem_test_irep_#{g.funcname}_preload" + g.build.mrbc.run f, test_preload, "gem_test_#{g.funcname}_preload" end g.test_rbfiles.flatten.each_with_index do |rbfile, i| - g.build.mrbc.run f, rbfile, "gem_test_irep_#{g.funcname}_#{i}" + g.build.mrbc.run f, rbfile, "gem_test_#{g.funcname}_#{i}_proc" 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_irep(mrb2, mrbtest_assert_irep);] + f.puts %Q[ mrb_load_proc(mrb2, mrbtest_assert_proc);] else - f.puts %Q[ mrb_load_irep(mrb2, gem_test_irep_#{g.funcname}_preload);] + f.puts %Q[ mrb_load_proc(mrb2, gem_test_#{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_irep(mrb2, gem_test_irep_#{g.funcname}_#{i});] + f.puts %Q[ mrb_load_proc(mrb2, gem_test_#{g.funcname}_#{i}_proc);] f.puts %Q[ ] f.puts %Q[ mrb_t_pass_result(mrb, mrb2);] |
