Re: [PATCH 05/16] test-lib: Infrastructure to test and check for prerequisites

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

 



Johannes Sixt <j6t@xxxxxxxx> writes:

> Some tests can be run only if a particular prerequisite is available. For
> example, some tests require that an UTF-8 locale is available. Here we
> introduce functions that are used in this way:
>
> 1. Insert code that checks whether the prerequisite is available. If it is,
>    call test_set_prereq with an arbitrary tag name that subsequently can be
>    used to check for the prerequisite:
>
>       case $LANG in
>       *.utf-8)
>             test_set_prereq UTF8
>             ;;
>       esac
>
> 2. In the calls to test_expect_success pass the tag name:
>
>       test_expect_success UTF8 '...description...' '...tests...'
>
> 3. There is an auxiliary predicate that can be used anywhere to test for
>    a prerequisite explicitly:
>
>       if test_have_prereq UTF8
>       then
>             ...code to be skipped if prerequisite is not available...
>       fi
>
> Signed-off-by: Johannes Sixt <j6t@xxxxxxxx>

Very nicely done.  Thanks.
--
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]

  Powered by Linux