git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
  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
Previous: Felipe ContrerasNext: Junio C Hamano
Message 2 of 18 in “tests: add initial bash completion tests”
  1. tests: add initial bash completion testsFelipe Contreras, Apr 6, 2012
  2. Jeff KingApr 6, 2012
  3. Junio C HamanoApr 6, 2012
  4. Felipe ContrerasApr 6, 2012
  5. Jeff KingApr 6, 2012
  6. Felipe ContrerasApr 6, 2012
  7. Junio C HamanoApr 6, 2012
  8. Felipe ContrerasApr 6, 2012
  9. Jeff KingApr 6, 2012
  10. Felipe ContrerasApr 6, 2012
  11. Junio C HamanoApr 6, 2012
  12. Felipe ContrerasApr 6, 2012
  13. Jeff KingApr 6, 2012
  14. Felipe ContrerasApr 6, 2012
  15. Junio C HamanoApr 6, 2012
  16. Junio C HamanoApr 6, 2012
  17. Felipe ContrerasApr 7, 2012
  18. Jeff KingApr 6, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.