[OE-core] [PATCH] libusb: Add ptest

Anuj Mittal anuj.mittal at intel.com
Mon Aug 6 13:39:54 UTC 2018


On 08/06/2018 08:08 PM, Maksym Kokhan via Openembedded-core wrote:
> Add ptest support to libusb package.
> Uses existing libusb tests.
> 
> Signed-off-by: Maksym Kokhan <maksym.kokhan at globallogic.com>
> Reviewed-by: Andrii Bordunov <andrii.bordunov at globallogic.com>
> ---
>  meta/recipes-support/libusb/libusb1/run-ptest | 15 +++++++++++++++
>  meta/recipes-support/libusb/libusb1_1.0.21.bb | 11 ++++++++++-
>  2 files changed, 25 insertions(+), 1 deletion(-)
>  create mode 100755 meta/recipes-support/libusb/libusb1/run-ptest
> 
> diff --git a/meta/recipes-support/libusb/libusb1/run-ptest b/meta/recipes-support/libusb/libusb1/run-ptest
> new file mode 100755
> index 0000000..646a966
> --- /dev/null
> +++ b/meta/recipes-support/libusb/libusb1/run-ptest
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +
> +echo
> +echo "---------------------------- libusb1 tests ---------------------------"
> +echo
> +
> +./stress | tr '\n' ' '  | \
> +sed 's/Starting test run: \([a-zA-Z_]*\)\.\.\. \([a-zA-Z_]*\) (.) /\2 \1\n/g' | \
> +sed '$d' | \
> +sed '{
> +	s/^Success/PASS:/g
> +	s/^Failure/FAIL:/g
> +	s/^Error/FAIL:/g
> +	s/^Skip/SKIP:/g
> +}' 
> diff --git a/meta/recipes-support/libusb/libusb1_1.0.21.bb b/meta/recipes-support/libusb/libusb1_1.0.21.bb
> index 1fefd14..073de38 100644
> --- a/meta/recipes-support/libusb/libusb1_1.0.21.bb
> +++ b/meta/recipes-support/libusb/libusb1_1.0.21.bb
> @@ -10,6 +10,7 @@ BBCLASSEXTEND = "native nativesdk"
>  
>  SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
>             file://no-dll.patch \
> +           file://run-ptest \
>            "
>  
>  SRC_URI[md5sum] = "1da9ea3c27b3858fa85c5f4466003e44"
> @@ -17,7 +18,7 @@ SRC_URI[sha256sum] = "7dce9cce9a81194b7065ee912bcd55eeffebab694ea403ffb91b67db66
>  
>  S = "${WORKDIR}/libusb-${PV}"
>  
> -inherit autotools pkgconfig
> +inherit autotools pkgconfig ptest
>  
>  # Don't configure udev by default since it will cause a circular
>  # dependecy with udev package, which depends on libusb
> @@ -30,6 +31,14 @@ do_install_append() {
>  	fi
>  }
>  
> +do_compile_ptest() {                                                             
> +    oe_runmake -C tests stress                                                   
> +}                                                                                
> +                                                                                 
> +do_install_ptest() {                                                             
> +    install -m 755 ${WORKDIR}/build/tests/.libs/stress ${D}${PTEST_PATH}         

This should use ${B} instead of ${WORKDIR}/build otherwise this will
fail when using devtool or externalsrc class or in general when
WORKDIR/build != B.

Thanks,

Anuj



More information about the Openembedded-core mailing list