[parted-devel] [PATCH] tests: skip tests requiring mkfs.hfs if it is not available

Jim Meyering jim at meyering.net
Mon Mar 1 15:26:00 UTC 2010


Petr Uzel wrote:
> Testsuite fails if mkfs.hfs is not installed on the system.
> * tests/t-lib.sh (_require_hfs): New function. The mkfs.hfs does

Thank you!
Would you please adjust that to use something like this instead?

  ( mkfs.hfs | grep '^usage:' ) > /dev/null 2>&1 \

I prefer to avoid "which", because in some environments it is not available.
Plus two nits in the log:

s/_require_hfs/require_hfs_/

>   not provide any option like --version, so 'which mkfs.hfs' is
>   is used instead.
> * tests/t3000-resize-fs.sh: Use _require_hfs

Likewise.

> ---
>  tests/t-lib.sh           |    6 ++++++
>  tests/t3000-resize-fs.sh |    1 +
>  2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/tests/t-lib.sh b/tests/t-lib.sh
> index 73454ce..280f876 100644
> --- a/tests/t-lib.sh
> +++ b/tests/t-lib.sh
> @@ -54,6 +54,12 @@ require_acl_()
>      || skip_test_ "This test requires a local user named bin."
>  }
>
> +require_hfs_()
> +{
> +  which mkfs.hfs > /dev/null 2>&1 \



More information about the parted-devel mailing list