Skip to content

Commit e31600b

Browse files
committed
Revert "tests: when run in Bash, annotate test failures with file name/line number"
This reverts commit 662f9cf, to fix the TAP output broken for bash.
1 parent 4024295 commit e31600b

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

t/test-lib.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -675,18 +675,6 @@ die () {
675675
fi
676676
}
677677

678-
file_lineno () {
679-
test -z "$GIT_TEST_FRAMEWORK_SELFTEST" && test -n "$BASH" || return 0
680-
local i
681-
for i in ${!BASH_SOURCE[*]}
682-
do
683-
case $i,"${BASH_SOURCE[$i]##*/}" in
684-
0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;;
685-
*,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;;
686-
esac
687-
done
688-
}
689-
690678
GIT_EXIT_OK=
691679
trap 'die' EXIT
692680
# Disable '-x' tracing, because with some shells, notably dash, it
@@ -732,7 +720,7 @@ test_failure_ () {
732720
write_junit_xml_testcase "$1" " $junit_insert"
733721
fi
734722
test_failure=$(($test_failure + 1))
735-
say_color error "$(file_lineno error)not ok $test_count - $1"
723+
say_color error "not ok $test_count - $1"
736724
shift
737725
printf '%s\n' "$*" | sed -e 's/^/# /'
738726
test "$immediate" = "" || { finalize_junit_xml; GIT_EXIT_OK=t; exit 1; }

0 commit comments

Comments
 (0)