Re: [RFC/PATCH] tests: add initial bash completion tests
- From
Jeff King <peff@peff.net>
- Date
- Apr 6, 2012, 20:19 UTC
- Message-ID
- <20120406201926.GA1677@sigill.intra.peff.net>
- 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
fibash <<\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