Re: [PATCH v3 5/7] remote-bzr: add simple tests
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 28, 2012, 17:36 UTC
- Message-ID
- <7vy5hlvddb.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1352643598-8500-6-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 30 quoted lines
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> > --- > contrib/remote-helpers/test-bzr.sh | 111 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 111 insertions(+) > create mode 100755 contrib/remote-helpers/test-bzr.sh > > diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh > new file mode 100755 > index 0000000..8594ffc > --- /dev/null > +++ b/contrib/remote-helpers/test-bzr.sh > @@ -0,0 +1,111 @@ > +#!/bin/sh > +# > +# Copyright (c) 2012 Felipe Contreras > +# > + > +test_description='Test remote-bzr' > + > +. ./test-lib.sh > + > +if ! test_have_prereq PYTHON; then > + skip_all='skipping remote-bzr tests; python not available' > + test_done > +fi > + > +if ! "$PYTHON_PATH" -c 'import bzrlib'; then > + skip_all='skipping remote-bzr tests; bzr not available' > + test_done > +fi
Show 8 quoted lines
> +cmd=<<EOF > +import bzrlib > +bzrlib.initialize() > +import bzrlib.plugin > +bzrlib.plugin.load_plugins() > +import bzrlib.plugins.fastimport > +EOF > +if ! "$PYTHON_PATH" -c "$cmd"; then
I cannot see how this could have ever worked. It could be that you wrote it for zsh and tested only with the version of zsh you have; zsh I have here does not grok it (and of course dash and bash won't).
In any case, I do not think this is a POSIX shell. Just replace "=<<EOF" and "EOF" with single quote and everybody's shell should be able to read it.
Show 11 quoted lines
> + echo "consider setting BZR_PLUGIN_PATH=$HOME/.bazaar/plugins" 1>&2
> + skip_all='skipping remote-bzr tests; bzr-fastimport not available'
> + test_done
> +fi
> +
> +check () {
> + (cd $1 &&
> + git log --format='%s' -1 &&
> + git symbolic-ref HEAD) > actual &&
> + (echo $2 &&
> + echo "refs/heads/$3") > expected &&Style: s/> expected/>expected/; I won't repeat this but there are many others in this file.
Thanks.