unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH 3/9] test: remove unused test_external and test_external_without_stderr
Date: Sun, 26 Feb 2017 15:42:55 +0200	[thread overview]
Message-ID: <151d381216d7befdb973743ff3f62cc12fe82cc8.1488116461.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1488116461.git.jani@nikula.org>
In-Reply-To: <cover.1488116461.git.jani@nikula.org>

They've been unused since their introduction in commit 0083854b1204
("Copy test framework from Git"), only causing maintenance burden.
---
 test/test-lib.sh | 59 --------------------------------------------------------
 1 file changed, 59 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 2ccb62eec122..218a06527f88 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -963,65 +963,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:
 #
-- 
2.11.0

  parent reply	other threads:[~2017-02-26 13:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26 13:42 [PATCH 0/9] test: cleanup and refactoring Jani Nikula
2017-02-26 13:42 ` [PATCH 1/9] test: remove unused regexp convenience variables Jani Nikula
2017-02-26 13:42 ` [PATCH 2/9] test: remove unused filter functions Jani Nikula
2017-02-26 13:42 ` Jani Nikula [this message]
2017-02-26 13:42 ` [PATCH 4/9] test: remove unused and no-op --long-tests parameter Jani Nikula
2017-02-26 13:42 ` [PATCH 5/9] test: only accept short and long options, not silly in-betweens Jani Nikula
2017-02-26 13:42 ` [PATCH 6/9] test: ensure test_begin_subtest has been called before test_expect_* Jani Nikula
2017-02-26 13:42 ` [PATCH 7/9] test: drop the implicit prereq check mechanism from test_expect_* Jani Nikula
2017-02-26 13:43 ` [PATCH 8/9] test: require test_begin_subtest before test_expect_success Jani Nikula
2017-02-26 13:43 ` [PATCH 9/9] test: require test_begin_subtest before test_expect_code Jani Nikula
2017-03-10 11:45 ` [PATCH 0/9] test: cleanup and refactoring David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151d381216d7befdb973743ff3f62cc12fe82cc8.1488116461.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).