[Pdbg] [PATCH 2/2] utils: Add script to run make check

Amitay Isaacs amitay at ozlabs.org
Mon Aug 13 17:26:25 AEST 2018


On Mon, 2018-08-13 at 16:06 +0930, Joel Stanley wrote:
> This builds the software for the host architecture and runs make
> check
> inside a container.
> 
> Added to the travis configuration.
> 
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
>  .travis.yml   |  1 +
>  utils/test.sh | 33 +++++++++++++++++++++++++++++++++
>  2 files changed, 34 insertions(+)
>  create mode 100755 utils/test.sh
> 
> diff --git a/.travis.yml b/.travis.yml
> index 9e1a86bc3140..596b50ff4e1e 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -3,3 +3,4 @@ services:
>  
>  script:
>      - ./utils/build.sh
> +    - ./utils/test.sh
> diff --git a/utils/test.sh b/utils/test.sh
> new file mode 100755
> index 000000000000..e2bd25893910
> --- /dev/null
> +++ b/utils/test.sh
> @@ -0,0 +1,33 @@
> +#!/bin/bash
> +
> +set -e
> +
> +CONTAINER=pdbg-check
> +
> +Dockerfile=$(cat << EOF
> +FROM ubuntu:18.04
> +RUN apt-get update && apt-get install --no-install-recommends -yy \
> +	make \
> +	gcc \
> +	autoconf \
> +	automake \
> +	libtool \
> +	git \
> +	device-tree-compiler
> +RUN groupadd -g ${GROUPS} ${USER} && useradd -d ${HOME} -m -u ${UID}
> -g ${GROUPS} ${USER}
> +USER ${USER}
> +ENV HOME ${HOME}
> +RUN /bin/bash
> +EOF
> +)
> +
> +docker pull ubuntu:18.04
> +docker build -t ${CONTAINER} - <<< "${Dockerfile}"
> +
> +RUN="docker run --rm=true --user=${USER} -w ${PWD} -v
> ${HOME}:${HOME} -t ${CONTAINER}"
> +
> +${RUN} ./bootstrap.sh
> +${RUN} ./configure
> +${RUN} make clean

Does travis cache the older image?  Or it's always created from
scratch?  If it's created from scratch, then we don't really need "make
clean".  If not, we also should add "git clean -x -d -f" before running
"./bootstrap.sh"

The same logic applies to build.sh.

> +${RUN} make
> +${RUN} make check
> -- 
> 2.17.1
> 

Amitay.
-- 

Everyone is a genius at least once a year. A real genius has his ideas
closer together.



More information about the Pdbg mailing list