1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-09-29 20:48:27 +02:00

test/bats: Add statements to debug Travis macOS

The following build is demonstrating failures I can't reproduce on my
own macOS system:

  https://travis-ci.org/bats-core/bats-core/jobs/281719290
This commit is contained in:
Mike Bland 2017-09-30 14:51:45 -04:00
parent d310b25911
commit 918714dd4d
No known key found for this signature in database
GPG Key ID: 5121C73A6E07384B

View File

@ -67,6 +67,8 @@ fixtures bats
@test "one failing test" {
run bats "$FIXTURE_ROOT/failing.bats"
[ $status -eq 1 ]
printf 'lines:\n' >&2
printf '%s\n' "${lines[@]}" >&2
[ "${lines[0]}" = '1..1' ]
[ "${lines[1]}" = 'not ok 1 a failing test' ]
[ "${lines[2]}" = "# (in test file $RELATIVE_FIXTURE_ROOT/failing.bats, line 4)" ]
@ -86,6 +88,8 @@ fixtures bats
@test "failing test with significant status" {
STATUS=2 run bats "$FIXTURE_ROOT/failing.bats"
[ $status -eq 1 ]
printf 'lines:\n' >&2
printf '%s\n' "${lines[@]}" >&2
[ "${lines[3]}" = "# \`eval \"( exit \${STATUS:-1} )\"' failed with status 2" ]
}
@ -153,6 +157,8 @@ fixtures bats
cd "$TMP"
run bats "$FIXTURE_ROOT/failing.bats"
[ $status -eq 1 ]
printf 'lines:\n' >&2
printf '%s\n' "${lines[@]}" >&2
[ "${lines[2]}" = "# (in test file $FIXTURE_ROOT/failing.bats, line 4)" ]
}