git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] tests: add initial bash completion tests
Date: Fri, 6 Apr 2012 16:19:26 -0400	[thread overview]
Message-ID: <20120406201926.GA1677@sigill.intra.peff.net> (raw)
In-Reply-To: <1333740519-3792-1-git-send-email-felipe.contreras@gmail.com>

On Fri, Apr 06, 2012 at 10:28:39PM +0300, Felipe Contreras wrote:

> Something is better than nothing.

Yes, but...

> --- /dev/null
> +++ b/t/t9902-completion.sh
> @@ -0,0 +1,198 @@
> +#!/bin/bash

Won't this test break "make test" on systems without bash (or with bash
elsewhere)?

I think you need to start with something like:

  #!/bin/sh

  if ! type bash; then
          echo '1..0 # SKIP skipping bash tests, bash not available'
          exit 0
  fi

  bash <<\END_OF_BASH_SCRIPT

  test_description='test bash completion'
  . ./test-lib.sh

  [... actual tests ...]

  test_done

  END_OF_BASH_SCRIPT

You could also run the main harness in the outer sh script, and just run
bash inside each test, but I suspect that would end up cumbersome. I
don't really care strongly which, as long as it gracefully skips on
non-bash systems.

-Peff

  reply	other threads:[~2012-04-06 20:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 19:28 [RFC/PATCH] tests: add initial bash completion tests Felipe Contreras
2012-04-06 20:19 ` Jeff King [this message]
2012-04-06 20:24   ` Junio C Hamano
2012-04-06 21:28     ` Felipe Contreras
2012-04-06 21:42       ` Jeff King
2012-04-06 22:22         ` Felipe Contreras
2012-04-06 21:42       ` Junio C Hamano
2012-04-06 21:21   ` Felipe Contreras
2012-04-06 21:34     ` Jeff King
2012-04-06 22:05       ` Felipe Contreras
2012-04-06 22:46         ` Junio C Hamano
2012-04-06 23:30           ` Felipe Contreras
2012-04-06 23:45         ` Jeff King
2012-04-06 23:12   ` Felipe Contreras
2012-04-06 23:22     ` Junio C Hamano
2012-04-06 23:33       ` Junio C Hamano
2012-04-07  0:02         ` Felipe Contreras
2012-04-06 23:52     ` Jeff King

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

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

  git send-email \
    --in-reply-to=20120406201926.GA1677@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.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.
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 NNTP newsgroup(s).