summaryrefslogtreecommitdiffhomepage
path: root/tasks
diff options
context:
space:
mode:
authortake_cheeze <[email protected]>2014-07-12 21:26:47 +0900
committertake_cheeze <[email protected]>2014-07-12 21:41:44 +0900
commit3b8a797a4cc227006942fb780590c6513bb53dc7 (patch)
treed523319c93f7863f023f68d6e95a0bc0bfef009e /tasks
parenta16a53b5ebc0fb6a7dc448130ea8f34575d85a3d (diff)
downloadmruby-3b8a797a4cc227006942fb780590c6513bb53dc7.tar.gz
mruby-3b8a797a4cc227006942fb780590c6513bb53dc7.zip
Fix rake failure since `mrbtest_objs` isn't flattened.
Append generated test object to `@test_objs` of mrbgem spec. Add method `custom_test_init?` to check whether mrbgem has custom test init function.
Diffstat (limited to 'tasks')
-rw-r--r--tasks/mrbgem_spec.rake5
-rw-r--r--tasks/mrbgems_test.rake3
2 files changed, 7 insertions, 1 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake
index 9e461d42b..745b2f29d 100644
--- a/tasks/mrbgem_spec.rake
+++ b/tasks/mrbgem_spec.rake
@@ -62,6 +62,7 @@ module MRuby
@test_objs = Dir.glob("#{dir}/test/*.{c,cpp,cxx,cc,m,asm,s,S}").map do |f|
objfile(f.relative_path_from(dir).to_s.pathmap("#{build_dir}/%X"))
end
+ @custom_test_init = !@test_objs.empty?
@test_preload = nil # 'test/assert.rb'
@test_args = {}
@@ -189,6 +190,10 @@ module MRuby
[@name]
end
+ def custom_test_init?
+ @custom_test_init
+ end
+
def version_ok?(req_versions)
req_versions.map do |req|
cmp, ver = req.split
diff --git a/tasks/mrbgems_test.rake b/tasks/mrbgems_test.rake
index 9fc9a9d2a..1c3067ca4 100644
--- a/tasks/mrbgems_test.rake
+++ b/tasks/mrbgems_test.rake
@@ -3,6 +3,7 @@ MRuby.each_target do
gems.each do |g|
test_rbobj = g.test_rbireps.ext(exts.object)
+ g.test_objs << test_rbobj
dep_list = gems.tsort_dependencies g.test_dependencies, gem_table
file test_rbobj => g.test_rbireps
@@ -77,7 +78,7 @@ MRuby.each_target do
f.puts %Q[ mrb_const_set(mrb2, mrb_obj_value(mrb2->object_class), mrb_intern_lit(mrb2, "TEST_ARGS"), test_args_hash); ]
end
- f.puts %Q[ mrb_#{g.funcname}_gem_test(mrb2);] unless g.test_objs.empty?
+ 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[ ]