ruby-changes:3605
From: ko1@a...
Date: Fri, 18 Jan 2008 02:25:45 +0900 (JST)
Subject: [ruby-changes:3605] nobu - Ruby:r15094 (trunk): * bootstraptest/runner.rb (assert_valid_syntax): added.
nobu 2008-01-18 02:02:30 +0900 (Fri, 18 Jan 2008)
New Revision: 15094
Modified files:
trunk/ChangeLog
trunk/bootstraptest/runner.rb
trunk/bootstraptest/test_knownbug.rb
Log:
* bootstraptest/runner.rb (assert_valid_syntax): added.
* bootstraptest/test_knownbug.rb: added test for [ruby-list:44479]
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15094&r2=15093&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/runner.rb?r1=15094&r2=15093&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_knownbug.rb?r1=15094&r2=15093&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15093)
+++ ChangeLog (revision 15094)
@@ -1,3 +1,9 @@
+Fri Jan 18 02:02:28 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * 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@r...>
* vm_insnhelper.c (vm_call_method): check argument number to
Index: bootstraptest/test_knownbug.rb
===================================================================
--- bootstraptest/test_knownbug.rb (revision 15093)
+++ bootstraptest/test_knownbug.rb (revision 15094)
@@ -75,3 +75,4 @@
$?.success?
}
+assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
Index: bootstraptest/runner.rb
===================================================================
--- bootstraptest/runner.rb (revision 15093)
+++ bootstraptest/runner.rb (revision 15094)
@@ -127,9 +127,9 @@
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 @@
}
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 @@
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
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/