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
5dc9a824
Unverified
Commit
5dc9a824
authored
Nov 19, 2020
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Nov 19, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5150 from shuujii/allow-bintest-even-if-build-name-is-not-host
Allow `bintest` even if build name is not `host`
parents
15d6e172
fd113da3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
17 deletions
+19
-17
build_config/boxing.rb
build_config/boxing.rb
+3
-0
lib/mruby/build.rb
lib/mruby/build.rb
+2
-2
mrbgems/mruby-bin-debugger/bintest/mrdb.rb
mrbgems/mruby-bin-debugger/bintest/mrdb.rb
+2
-2
mrbgems/mruby-bin-debugger/bintest/print.rb
mrbgems/mruby-bin-debugger/bintest/print.rb
+2
-2
mrbgems/mruby-bin-mirb/bintest/mirb.rb
mrbgems/mruby-bin-mirb/bintest/mirb.rb
+6
-6
test/bintest.rb
test/bintest.rb
+4
-5
No files found.
build_config/boxing.rb
View file @
5dc9a824
...
...
@@ -6,6 +6,7 @@ MRuby::Build.new('no-boxing') do |conf|
c
.
defines
+=
%w(MRB_NO_BOXING)
end
conf
.
enable_test
conf
.
enable_bintest
end
MRuby
::
Build
.
new
(
'word_boxing'
)
do
|
conf
|
...
...
@@ -16,6 +17,7 @@ MRuby::Build.new('word_boxing') do |conf|
c
.
defines
+=
%w(MRB_WORD_BOXING)
end
conf
.
enable_test
conf
.
enable_bintest
end
MRuby
::
Build
.
new
(
'nan_boxing'
)
do
|
conf
|
...
...
@@ -26,4 +28,5 @@ MRuby::Build.new('nan_boxing') do |conf|
c
.
defines
+=
%w(MRB_NAN_BOXING)
end
conf
.
enable_test
conf
.
enable_bintest
end
lib/mruby/build.rb
View file @
5dc9a824
...
...
@@ -206,7 +206,6 @@ EOS
end
def
enable_bintest
raise
"bintest works only on 'host' target"
unless
name
==
"host"
@enable_bintest
=
true
end
...
...
@@ -339,7 +338,8 @@ EOS
puts
">>> Bintest
#{
name
}
<<<"
targets
=
@gems
.
select
{
|
v
|
File
.
directory?
"
#{
v
.
dir
}
/bintest"
}.
map
{
|
v
|
filename
v
.
dir
}
targets
<<
filename
(
"."
)
if
File
.
directory?
"./bintest"
sh
"ruby test/bintest.rb
#{
verbose_flag
}
#{
targets
.
join
' '
}
"
env
=
{
"BUILD_DIR"
=>
@build_dir
}
sh
env
,
"ruby test/bintest.rb
#{
verbose_flag
}
#{
targets
.
join
' '
}
"
end
def
print_build_summary
...
...
mrbgems/mruby-bin-debugger/bintest/mrdb.rb
View file @
5dc9a824
...
...
@@ -13,14 +13,14 @@ class BinTest_MrubyBinDebugger
script
.
flush
# compile
`
./bin/mrbc
-g -o "
#{
bin
.
path
}
" "
#{
script
.
path
}
"`
`
#{
cmd
(
"mrbc"
)
}
-g -o "
#{
bin
.
path
}
" "
#{
script
.
path
}
"`
# add mrdb quit
testcase
<<
{
:cmd
=>
"quit"
}
stdin_data
=
testcase
.
map
{
|
t
|
t
[
:cmd
]}.
join
(
"
\n
"
)
<<
"
\n
"
[
"
bin/mrdb
#{
script
.
path
}
"
,
"bin/mrdb
-b
#{
bin
.
path
}
"
].
each
do
|
cmd
|
[
"
#{
cmd
(
'mrdb'
)
}
#{
script
.
path
}
"
,
"
#{
cmd
(
'mrdb'
)
}
-b
#{
bin
.
path
}
"
].
each
do
|
cmd
|
o
,
s
=
Open3
.
capture2
(
cmd
,
:stdin_data
=>
stdin_data
)
exp_vals
=
testcase
.
map
{
|
t
|
t
.
fetch
(
:exp
,
nil
)}
...
...
mrbgems/mruby-bin-debugger/bintest/print.rb
View file @
5dc9a824
...
...
@@ -13,7 +13,7 @@ class BinTest_MrubyBinDebugger
script
.
flush
# compile
`
./bin/mrbc
-g -o "
#{
bin
.
path
}
" "
#{
script
.
path
}
"`
`
#{
cmd
(
"mrbc"
)
}
-g -o "
#{
bin
.
path
}
" "
#{
script
.
path
}
"`
# add mrdb quit
testcase
<<
{
:cmd
=>
"quit"
}
...
...
@@ -21,7 +21,7 @@ class BinTest_MrubyBinDebugger
stdin_data
=
testcase
.
map
{
|
t
|
t
[
:cmd
]}.
join
(
"
\n
"
)
<<
"
\n
"
prompt
=
/^\(
#{
Regexp
.
escape
(
script
.
path
)
}
:\d+\) /
[
"
bin/mrdb
#{
script
.
path
}
"
,
"bin/mrdb
-b
#{
bin
.
path
}
"
].
each
do
|
cmd
|
[
"
#{
cmd
(
'mrdb'
)
}
#{
script
.
path
}
"
,
"
#{
cmd
(
'mrdb'
)
}
-b
#{
bin
.
path
}
"
].
each
do
|
cmd
|
o
,
s
=
Open3
.
capture2
(
cmd
,
:stdin_data
=>
stdin_data
)
scanner
=
StringScanner
.
new
(
o
)
scanner
.
skip_until
(
prompt
)
...
...
mrbgems/mruby-bin-mirb/bintest/mirb.rb
View file @
5dc9a824
require
'open3'
assert
(
'mirb normal operations'
)
do
o
,
s
=
Open3
.
capture2
(
'bin/mirb'
,
:stdin_data
=>
"a=1
\n
b=2
\n
a+b
\n
"
)
o
,
s
=
Open3
.
capture2
(
cmd
(
"mirb"
)
,
:stdin_data
=>
"a=1
\n
b=2
\n
a+b
\n
"
)
assert_true
o
.
include?
(
'=> 3'
)
assert_true
o
.
include?
(
'=> 2'
)
end
assert
(
'regression for #1563'
)
do
o
,
s
=
Open3
.
capture2
(
'bin/mirb'
,
:stdin_data
=>
"a=1;b=2;c=3
\n
b
\n
c"
)
o
,
s
=
Open3
.
capture2
(
cmd
(
"mirb"
)
,
:stdin_data
=>
"a=1;b=2;c=3
\n
b
\n
c"
)
assert_true
o
.
include?
(
'=> 3'
)
end
assert
(
'mirb -d option'
)
do
o
,
_
=
Open3
.
capture2
(
'bin/mirb'
,
:stdin_data
=>
"$DEBUG
\n
"
)
o
,
_
=
Open3
.
capture2
(
cmd
(
"mirb"
)
,
:stdin_data
=>
"$DEBUG
\n
"
)
assert_true
o
.
include?
(
'=> false'
)
o
,
_
=
Open3
.
capture2
(
'bin/mirb -d'
,
:stdin_data
=>
"$DEBUG
\n
"
)
o
,
_
=
Open3
.
capture2
(
"
#{
cmd
(
'mirb'
)
}
-d"
,
:stdin_data
=>
"$DEBUG
\n
"
)
assert_true
o
.
include?
(
'=> true'
)
end
...
...
@@ -29,7 +29,7 @@ end
EOS
lib
.
flush
o
,
_
=
Open3
.
capture2
(
"
bin/mirb
-r
#{
lib
.
path
}
"
,
:stdin_data
=>
"Hoge.new.hoge
\n
"
)
o
,
_
=
Open3
.
capture2
(
"
#{
cmd
(
'mirb'
)
}
-r
#{
lib
.
path
}
"
,
:stdin_data
=>
"Hoge.new.hoge
\n
"
)
assert_true
o
.
include?
(
'=> :hoge'
)
end
...
...
@@ -41,7 +41,7 @@ A = -> { a }
TESTLIB
lib
.
flush
o
,
_
=
Open3
.
capture2
(
"
bin/mirb
-r
#{
lib
.
path
}
"
,
:stdin_data
=>
<<-
TESTCODE
)
o
,
_
=
Open3
.
capture2
(
"
#{
cmd
(
'mirb'
)
}
-r
#{
lib
.
path
}
"
,
:stdin_data
=>
<<-
TESTCODE
)
a
a = 5
A.call
...
...
test/bintest.rb
View file @
5dc9a824
...
...
@@ -4,12 +4,11 @@ require 'test/assert.rb'
GEMNAME
=
""
def
cmd
(
s
)
case
RbConfig
::
CONFIG
[
'host_os'
]
when
/mswin(?!ce)|mingw|bccwin/
"bin
\\
#{
s
}
.exe"
else
"bin/
#{
s
}
"
path
=
"
#{
ENV
[
'BUILD_DIR'
]
}
/bin/
#{
s
}
"
if
/mswin(?!ce)|mingw|bccwin/
=~
RbConfig
::
CONFIG
[
'host_os'
]
path
=
"
#{
path
}
.exe"
.
tr
(
"/"
,
"
\\
"
)
end
path
end
def
shellquote
(
s
)
...
...
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