Skip to content

Commit

Permalink
failures_formatter: display all result type except succeed
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1nksm committed Mar 6, 2020
1 parent 8a56cb3 commit bcd92ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/libexec/reporter/failures_formatter.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#shellcheck shell=sh disable=SC2004

: "${field_type:-} ${field_fail:-} ${field_specfile:-} ${field_lineno_range:-}"
: "${field_type:-} ${field_tag:-} ${field_fail:-}"
: "${field_note:-} ${field_specfile:-} ${field_lineno_range:-}"
: "${temporary_skip:-}"

create_buffers failures

failures_each() {
case $field_type in (result)
[ "$field_fail" ] || return 0
failures '=' "./$field_specfile:${field_lineno_range%-*}:$(field_description)${LF}"
[ "$field_tag" = "succeeded" ] && return 0
[ "$field_tag" = "skipped" ] && [ "$temporary_skip" -eq 0 ] && return 0
failures '=' "./$field_specfile:${field_lineno_range%-*}:${field_note}"
failures '+=' ":$(field_description)${LF}"
esac
}

Expand Down
3 changes: 2 additions & 1 deletion libexec/shellspec-reporter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ each_line() {
;;
example)
# shellcheck disable=SC2034
field_evaluation='' field_pending='' reason=''
field_evaluation='' field_pending='' reason='' temporary_skip=0
if [ "$field_example_no" -le "$last_example_no" ]; then
abort "${LF}Illegal executed the same example" \
"(did you execute in a loop?) in ${field_specfile:-}" \
Expand All @@ -100,6 +100,7 @@ each_line() {
[ "$field_skipid" = "$last_skip_id" ] && break
last_skip_id=$field_skipid
esac
inc temporary_skip
esac

# shellcheck disable=SC2034
Expand Down

0 comments on commit bcd92ba

Please sign in to comment.