mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bootstraptest/runner.rb (assert_valid_syntax): added.
* bootstraptest/test_knownbug.rb: added test for [ruby-list:44479] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
23980c8ba0
commit
c8272db179
3 changed files with 18 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
Fri Jan 18 02:02:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* bootstraptest/runner.rb (assert_valid_syntax): added.
|
||||
|
||||
* bootstraptest/test_knownbug.rb: added test for [ruby-list:44479]
|
||||
|
||||
Fri Jan 18 01:48:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.c (vm_call_method): check argument number to
|
||||
|
|
|
@ -127,9 +127,9 @@ def exec_test(pathes)
|
|||
end
|
||||
end
|
||||
|
||||
def assert_check(testsrc, message = '')
|
||||
def assert_check(testsrc, message = '', opt = '')
|
||||
$stderr.puts "\##{@count} #{@location}" if @verbose
|
||||
result = get_result_string(testsrc)
|
||||
result = get_result_string(testsrc, opt)
|
||||
check_coredump
|
||||
faildesc = yield(result)
|
||||
if !faildesc
|
||||
|
@ -179,6 +179,13 @@ def assert_not_match(unexpected_pattern, testsrc, message = '')
|
|||
}
|
||||
end
|
||||
|
||||
def assert_valid_syntax(testsrc, message = '')
|
||||
newtest
|
||||
assert_check(testsrc, message, '-c') {|result|
|
||||
result if /Syntax OK/ !~ result
|
||||
}
|
||||
end
|
||||
|
||||
def assert_normal_exit(testsrc, message = '')
|
||||
newtest
|
||||
$stderr.puts "\##{@count} #{@location}" if @verbose
|
||||
|
@ -268,11 +275,11 @@ def make_srcfile(src)
|
|||
filename
|
||||
end
|
||||
|
||||
def get_result_string(src)
|
||||
def get_result_string(src, opt = '')
|
||||
if @ruby
|
||||
filename = make_srcfile(src)
|
||||
begin
|
||||
`#{@ruby} -W0 #{filename}`
|
||||
`#{@ruby} -W0 #{opt} #{filename}`
|
||||
ensure
|
||||
raise CoreDumpError, "core dumped" if $? and $?.coredump?
|
||||
end
|
||||
|
|
|
@ -75,3 +75,4 @@ assert_equal 'true', %{
|
|||
$?.success?
|
||||
}
|
||||
|
||||
assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
|
||||
|
|
Loading…
Reference in a new issue