Re: [RFC/PATCH] tests: add initial bash completion tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]