Changeset 331 for EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-test
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-test/driver.c
r321 r331 11 11 #include <string.h> 12 12 13 #include "mruby.h"14 #include "mruby/proc.h"15 #include "mruby/data.h"16 #include "mruby/compile.h"17 #include "mruby/string.h"18 #include "mruby/variable.h"19 #include "mruby/array.h"13 #include <mruby.h> 14 #include <mruby/proc.h> 15 #include <mruby/data.h> 16 #include <mruby/compile.h> 17 #include <mruby/string.h> 18 #include <mruby/variable.h> 19 #include <mruby/array.h> 20 20 21 21 void … … 95 95 mrb_define_const(mrb, mrbtest, "FIXNUM_BIT", mrb_fixnum_value(MRB_INT_BIT)); 96 96 97 #ifdef MRB_USE_FLOAT 98 mrb_define_const(mrb, mrbtest, "FLOAT_TOLERANCE", mrb_float_value(mrb, 1e-6)); 99 #else 100 mrb_define_const(mrb, mrbtest, "FLOAT_TOLERANCE", mrb_float_value(mrb, 1e-12)); 101 #endif 102 97 103 if (verbose) { 98 104 mrb_gv_set(mrb, mrb_intern_lit(mrb, "$mrbtest_verbose"), mrb_true_value()); -
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-test/init_mrbtest.c
r321 r331 1 1 #include <stdlib.h> 2 #include "mruby.h"3 #include "mruby/irep.h"4 #include "mruby/variable.h"2 #include <mruby.h> 3 #include <mruby/irep.h> 4 #include <mruby/variable.h> 5 5 6 6 extern const uint8_t mrbtest_assert_irep[]; 7 extern const uint8_t mrbtest_irep[];8 7 9 8 void mrbgemtest_init(mrb_state* mrb); … … 25 24 mrb_init_test_driver(core_test, mrb_test(mrb_gv_get(mrb, mrb_intern_lit(mrb, "$mrbtest_verbose")))); 26 25 mrb_load_irep(core_test, mrbtest_assert_irep); 27 mrb_load_irep(core_test, mrbtest_irep);28 26 mrb_t_pass_result(mrb, core_test); 29 27 -
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-test/mrbgem.rake
r321 r331 7 7 spec.add_dependency('mruby-compiler', :core => 'mruby-compiler') 8 8 9 spec.test_rbfiles = Dir.glob("#{MRUBY_ROOT}/test/t/*.rb") 10 9 11 clib = "#{build_dir}/mrbtest.c" 10 12 mlib = clib.ext(exts.object) 11 mrbs = Dir.glob("#{MRUBY_ROOT}/test/t/*.rb")12 13 exec = exefile("#{build.build_dir}/bin/mrbtest") 13 14 … … 27 28 28 29 file assert_lib => assert_c 29 file assert_c => [build.mrbcfile, assert_rb]do |t|30 file assert_c => assert_rb do |t| 30 31 open(t.name, 'w') do |f| 31 32 mrbc.run f, assert_rb, 'mrbtest_assert_irep' … … 41 42 42 43 file test_rbobj => g.test_rbireps 43 file g.test_rbireps => [g.test_rbfiles].flatten + [File.join(g.dir, 'mrbgem.rake'), g.build.mrbcfile, "#{MRUBY_ROOT}/tasks/mrbgem_spec.rake"]do |t|44 file g.test_rbireps => [g.test_rbfiles].flatten do |t| 44 45 FileUtils.mkdir_p File.dirname(t.name) 45 46 open(t.name, 'w') do |f| … … 146 147 147 148 init = "#{spec.dir}/init_mrbtest.c" 149 150 # store the last gem selection and make the re-build 151 # of the test gem depending on a change to the gem 152 # selection 153 active_gems = "#{build_dir}/active_gems.lst" 154 FileUtils.mkdir_p File.dirname(active_gems) 155 open(active_gems, 'w+') do |f| 156 build.gems.each do |g| 157 f.puts g.name 158 end 159 end 160 file clib => active_gems 161 148 162 file mlib => clib 149 file clib => [build.mrbcfile, init] + mrbsdo |t|163 file clib => init do |t| 150 164 _pp "GEN", "*.rb", "#{clib.relative_path}" 151 165 FileUtils.mkdir_p File.dirname(clib) … … 161 175 f.puts %Q[] 162 176 f.puts IO.read(init) 163 mrbc.run f, mrbs, 'mrbtest_irep'164 177 build.gems.each do |g| 165 178 f.puts %Q[void GENERATED_TMP_mrb_#{g.funcname}_gem_test(mrb_state *mrb);]
Note:
See TracChangeset
for help on using the changeset viewer.