Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
79f80236
Commit
79f80236
authored
12 years ago
by
Carson McDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to pass parameters from mrbgem.rake spec into test scripts.
parent
e43216c4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
2 deletions
+21
-2
examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake
examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake
+3
-0
examples/mrbgems/c_extension_example/mrbgem.rake
examples/mrbgems/c_extension_example/mrbgem.rake
+3
-0
examples/mrbgems/ruby_extension_example/mrbgem.rake
examples/mrbgems/ruby_extension_example/mrbgem.rake
+3
-0
tasks/mrbgem_spec.rake
tasks/mrbgem_spec.rake
+3
-1
tasks/mrbgems_test.rake
tasks/mrbgems_test.rake
+9
-1
No files found.
examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake
View file @
79f80236
...
...
@@ -17,4 +17,7 @@ MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec|
# spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb")
# spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) }
# spec.test_preload = 'test/assert.rb'
# Values accessible as $test_args inside test scripts
# spec.test_args = {'tmp_dir' => Dir::tmpdir}
end
This diff is collapsed.
Click to expand it.
examples/mrbgems/c_extension_example/mrbgem.rake
View file @
79f80236
...
...
@@ -17,4 +17,7 @@ MRuby::Gem::Specification.new('c_extension_example') do |spec|
# spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb")
# spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) }
# spec.test_preload = 'test/assert.rb'
# Values accessible as $test_args inside test scripts
# spec.test_args = {'tmp_dir' => Dir::tmpdir}
end
This diff is collapsed.
Click to expand it.
examples/mrbgems/ruby_extension_example/mrbgem.rake
View file @
79f80236
...
...
@@ -17,4 +17,7 @@ MRuby::Gem::Specification.new('ruby_extension_example') do |spec|
# spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb")
# spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) }
# spec.test_preload = 'test/assert.rb'
# Values accessible as $test_args inside test scripts
# spec.test_args = {'tmp_dir' => Dir::tmpdir}
end
This diff is collapsed.
Click to expand it.
tasks/mrbgem_spec.rake
View file @
79f80236
...
...
@@ -22,7 +22,7 @@ module MRuby
alias
:author
=
:authors
=
attr_accessor
:rbfiles
,
:objs
attr_accessor
:test_objs
,
:test_rbfiles
attr_accessor
:test_objs
,
:test_rbfiles
,
:test_args
attr_accessor
:test_preload
attr_block
MRuby
::
Build
::
COMMANDS
...
...
@@ -54,6 +54,7 @@ module MRuby
objfile
(
f
.
relative_path_from
(
dir
).
to_s
.
pathmap
(
"
#{
build_dir
}
/%X"
))
end
@test_preload
=
'test/assert.rb'
@test_args
=
{}
instance_eval
(
&
@initializer
)
...
...
@@ -140,6 +141,7 @@ module MRuby
f
.
puts
%Q[#include "mruby/proc.h"]
f
.
puts
%Q[#include "mruby/variable.h"]
f
.
puts
%Q[#include "mruby/array.h"]
f
.
puts
%Q[#include "mruby/hash.h"]
end
end
# Specification
...
...
This diff is collapsed.
Click to expand it.
tasks/mrbgems_test.rake
View file @
79f80236
...
...
@@ -33,6 +33,14 @@ MRuby.each_target do
f
.
puts
%Q[ }]
f
.
puts
%Q[ mrb_const_set(mrb2, mrb_obj_value(mrb2->object_class), mrb_intern(mrb2, "GEMNAME"), mrb_str_new(mrb2, "
#{
g
.
name
}
",
#{
g
.
name
.
length
}
));]
if
not
g
.
test_args
.
empty?
f
.
puts
%Q[ mrb_value test_args_hash = mrb_hash_new_capa(mrb,
#{
g
.
test_args
.
length
}
); ]
g
.
test_args
.
each
do
|
arg_name
,
arg_value
|
f
.
puts
%Q[ mrb_hash_set(mrb2, test_args_hash, mrb_str_new(mrb2, "
#{
arg_name
.
to_s
}
",
#{
arg_name
.
to_s
.
length
}
), mrb_str_new(mrb2, "
#{
arg_value
.
to_s
}
",
#{
arg_value
.
to_s
.
length
}
)); ]
end
f
.
puts
%Q[ mrb_gv_set(mrb2, mrb_intern(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_load_irep(mrb2, gem_test_irep_
#{
g
.
funcname
}
_
#{
i
}
);]
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment