Skip to content

Commit f5b7ce1

Browse files
jrngitster
authored andcommitted
tests: make test_expect_code quieter on success
A command exiting with the expected status is not particularly notable. While the indication of progress might be useful when tracking down where in a test a failure has happened, the same applies to most other test helpers, which are quiet about success, so this single helper's output stands out in an unpleasant way. An alternative method for showing progress information might to invent a --progress option that runs tests with "set -x", or until that is available, to run tests using commands like prove -v -j2 --shuffle --exec='sh -x' t2202-add-addremove.sh Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ea2ca44 commit f5b7ce1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

t/test-lib.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,12 +731,11 @@ test_expect_code () {
731731
exit_code=$?
732732
if test $exit_code = $want_code
733733
then
734-
echo >&2 "test_expect_code: command exited with $exit_code: $*"
735734
return 0
736-
else
737-
echo >&2 "test_expect_code: command exited with $exit_code, we wanted $want_code $*"
738-
return 1
739735
fi
736+
737+
echo >&2 "test_expect_code: command exited with $exit_code, we wanted $want_code $*"
738+
return 1
740739
}
741740

742741
# test_cmp is a helper function to compare actual and expected output.

0 commit comments

Comments
 (0)