Re: [PATCH 2/3] test: Add `test_emacs_expect_t'.

Subject: Re: [PATCH 2/3] test: Add `test_emacs_expect_t'.

Date: Tue, 17 Jan 2012 15:09:22 +0000

To: Dmitry Kurochkin

Cc: notmuch

From: David Edmondson


On Tue, 17 Jan 2012 18:49:36 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> > +		# We cannot call 'test_emacs' in a subshell, because
> > +		# the setting of EMACS_SERVER would not persist
> > +		# throughout a sequence of tests, so we use a
> > +		# temporary file.
> > +		tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi
> > +		output="$tmp/test_emacs_output.$$"
> > +		test_emacs "$1" > "${output}"
> > +		result=$(cat "${output}")
> > +		rm -f "${output}"
> 
> I wonder if there is any bash trick which can help here?

I'm not aware of one, but I'm not a bash expert.

> Another option is to start emacs server before using test_emacs in
> subshell.  See emacs-subject-to-filename for an example.  I think this
> is a better option than using a temporary file.

I think that's a very poor option. Forcing knowledge the breakage into
all of the users may make applying any future fix more difficult.
part-000.sig (application/pgp-signature)

Thread: