mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-25 19:04:53 +01:00
test: remove unused test_external and test_external_without_stderr
They've been unused since their introduction in commit 0083854b12
("Copy test framework from Git"), only causing maintenance burden.
This commit is contained in:
parent
cfc0909511
commit
8af6fc5e6e
1 changed files with 0 additions and 59 deletions
|
@ -962,65 +962,6 @@ test_expect_code () {
|
|||
fi
|
||||
}
|
||||
|
||||
# test_external runs external test scripts that provide continuous
|
||||
# test output about their progress, and succeeds/fails on
|
||||
# zero/non-zero exit code. It outputs the test output on stdout even
|
||||
# in non-verbose mode, and announces the external script with "* run
|
||||
# <n>: ..." before running it. When providing relative paths, keep in
|
||||
# mind that all scripts run in "trash directory".
|
||||
# Usage: test_external description command arguments...
|
||||
# Example: test_external 'Perl API' perl ../path/to/test.pl
|
||||
test_external () {
|
||||
test "$#" = 4 && { prereq=$1; shift; } || prereq=
|
||||
test "$#" = 3 ||
|
||||
error >&6 "bug in the test script: not 3 or 4 parameters to test_external"
|
||||
test_subtest_name="$1"
|
||||
shift
|
||||
test_reset_state_
|
||||
if ! test_skip "$test_subtest_name" "$@"
|
||||
then
|
||||
# Announce the script to reduce confusion about the
|
||||
# test output that follows.
|
||||
say_color "" " run $test_count: $descr ($*)"
|
||||
# Run command; redirect its stderr to &4 as in
|
||||
# test_run_, but keep its stdout on our stdout even in
|
||||
# non-verbose mode.
|
||||
"$@" 2>&4
|
||||
if [ "$?" = 0 ]
|
||||
then
|
||||
test_ok_
|
||||
else
|
||||
test_failure_ "$@"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Like test_external, but in addition tests that the command generated
|
||||
# no output on stderr.
|
||||
test_external_without_stderr () {
|
||||
# The temporary file has no (and must have no) security
|
||||
# implications.
|
||||
tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi
|
||||
stderr="$tmp/git-external-stderr.$$.tmp"
|
||||
test_external "$@" 4> "$stderr"
|
||||
[ -f "$stderr" ] || error "Internal error: $stderr disappeared."
|
||||
test_subtest_name="no stderr: $1"
|
||||
shift
|
||||
if [ ! -s "$stderr" ]; then
|
||||
rm "$stderr"
|
||||
test_ok_
|
||||
else
|
||||
if [ "$verbose" = t ]; then
|
||||
output=`echo; echo Stderr is:; cat "$stderr"`
|
||||
else
|
||||
output=
|
||||
fi
|
||||
# rm first in case test_failure exits.
|
||||
rm "$stderr"
|
||||
test_failure_ "$@" "$output"
|
||||
fi
|
||||
}
|
||||
|
||||
# This is not among top-level (test_expect_success)
|
||||
# but is a prefix that can be used in the test script, like:
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue