aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest/runner.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/runner.rb')
-rw-r--r--bootstraptest/runner.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index e8651fea4a..27b82947f2 100644
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -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