Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,17 @@ The following methods are available in Ruby test programs.
`true` if the FORM job issued the expected warning, otherwise `false`.

The following methods are similar to `warning?`,
but they check for preprocessor errors, compile-time errors,
and run-time errors, respectively:
but they check for preprocessor errors, compile-time errors, run-time errors,
and internal errors (which should never happen), respectively:

- `preprocess_error? → bool`
`preprocess_error?(expected_message : string) → bool`
- `compile_error? → bool`
`compile_error?(expected_message : string) → bool`
- `runtime_error? → bool`
`runtime_error?(expected_message : string) → bool`
- `internal_error? → bool`
`internal_error?(expected_message : string) → bool`

#### Standard streams

Expand Down
11 changes: 10 additions & 1 deletion check/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,19 @@ def runtime_error?(expected_message = nil)
end
end

# true if the FORM job reported an internal error, which should never happen.
def internal_error?(expected_message = nil)
if expected_message.nil?
@stdout =~ / ~~> Internal error/
else
@cleaned_stdout =~ / ~~> Internal error.*#{Regexp.escape(expected_message)}/
end
end

# true if the FORM job completed without any warnings/errors and
# the exit code was 0.
def succeeded?
if finished? && !warning? && !preprocess_error? && !compile_error? && !runtime_error? && return_value == 0
if finished? && !warning? && !preprocess_error? && !compile_error? && !runtime_error? && !internal_error? && return_value == 0
if FormTest.cfg.valgrind.nil?
if @stderr.empty?
return true
Expand Down
Loading