diff --git a/Makefile b/Makefile index ddca322f..37033653 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ STEPS= audit arm base boot chroot clean clone compress confirm \ connect core distfiles download dvd fingerprint info \ kernel list make.conf nano options packages plugins ports \ prefetch print rebase release rename serial sign skim \ - sync test update upload verify vga vm xtools + sync test tests update upload verify vga vm xtools SCRIPTS= custom distribution factory hotfix nightly watch .PHONY: ${STEPS} ${SCRIPTS} @@ -136,7 +136,8 @@ SRCDIR?= ${ROOTDIR}/src # A couple of meta-targets for easy use and ordering: -kernel ports distfiles: base +kernel tests ports distfiles: base +kernel: tests audit plugins: ports core: plugins packages test: core diff --git a/build/clean.sh b/build/clean.sh index c0b4ed91..3cadffd4 100644 --- a/build/clean.sh +++ b/build/clean.sh @@ -37,13 +37,14 @@ for ARG in ${@}; do echo ">>> Removing arm image" rm -f ${IMAGESDIR}/*-arm-${PRODUCT_ARCH}-${PRODUCT_DEVICE}.img* ;; - aux) - echo ">>> Removing aux set" - rm -f ${SETSDIR}/aux-*-${PRODUCT_ARCH}.* + aux|tests|xtools) + echo ">>> Removing ${ARG} set" + rm -f ${SETSDIR}/${ARG}-*-${PRODUCT_ARCH}.* ;; base) - echo ">>> Removing base set" + echo ">>> Removing base including tests set" rm -f ${SETSDIR}/base-*-${PRODUCT_ARCH}${PRODUCT_DEVICE+"-${PRODUCT_DEVICE}"}.* + rm -f ${SETSDIR}/tests-*-${PRODUCT_ARCH}.* ;; core) echo ">>> Removing core from packages set" @@ -141,9 +142,5 @@ for ARG in ${@}; do echo ">>> Removing vm image" rm -f ${IMAGESDIR}/*-vm-${PRODUCT_ARCH}.* ;; - xtools) - echo ">>> Removing xtools set" - rm -f ${SETSDIR}/xtools-*-${PRODUCT_ARCH}.* - ;; esac done diff --git a/build/common.sh b/build/common.sh index 1318b114..0a4e9a20 100644 --- a/build/common.sh +++ b/build/common.sh @@ -731,6 +731,7 @@ check_packages() PKG_HAVE=$(pkg -v | cut -d. -f 1-2) if [ "${PKG_WANT}" != "${PKG_HAVE}" ]; then echo "Installed pkg version '${PKG_HAVE}' does not match required version '${PKG_WANT}'" >&2 + echo "To fix this please run 'make -C ${PORTSDIR}/ports-mgmt/pkg clean all reinstall'" >&2 exit 1 fi @@ -771,7 +772,7 @@ find_set() aux|packages|release) echo $(find ${SETSDIR} -name "${1}-*-${PRODUCT_ARCH}.tar") ;; - xtools) + tests|xtools) echo $(find ${SETSDIR} -name "${1}-*-${PRODUCT_ARCH}.txz") ;; *) diff --git a/build/rename.sh b/build/rename.sh index d5ef9ac8..9ce64776 100644 --- a/build/rename.sh +++ b/build/rename.sh @@ -40,7 +40,7 @@ for ARG in ${@}; do mv ${FILE} ${IMAGESDIR}/${PRODUCT_NAME}${PRODUCT_SUFFIX}-${PRODUCT_VERSION}-arm-${FILE##*-arm-} done ;; - aux|distfiles|packages) + aux|distfiles|packages|tests) echo ">>> Renaming ${ARG} set: ${PRODUCT_VERSION}" for FILE in $(find ${SETSDIR} -name \ "${ARG}-*-${PRODUCT_ARCH}.*"); do diff --git a/build/tests.sh b/build/tests.sh new file mode 100644 index 00000000..2b72dd20 --- /dev/null +++ b/build/tests.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +# Copyright (c) 2024 Franco Fichtner +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +set -e + +SELF=tests + +. ./common.sh + +TESTSSET=$(find_set tests) + +if [ -f "${TESTSSET}" -a -z "${1}" ]; then + echo ">>> Reusing tests set: ${TESTSSET}" + exit 0 +fi + +git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH +git_version ${SRCDIR} + +TESTSSET=${SETSDIR}/tests-${PRODUCT_VERSION}-${PRODUCT_ARCH}.txz + +MAKE_ARGS=" +TARGET_ARCH=${PRODUCT_ARCH} +TARGET=${PRODUCT_TARGET} +SRCCONF=${CONFIGDIR}/src.conf +WITHOUT_DEBUG_FILES=yes +__MAKE_CONF= +${MAKE_ARGS_DEV} +" + +${ENV_FILTER} make -C${SRCDIR}/lib/libnetbsd -j${CPUS} all ${MAKE_ARGS} +${ENV_FILTER} make -C${SRCDIR}/tests -j${CPUS} all ${MAKE_ARGS} + +setup_stage ${STAGEDIR} work/usr/tests +mtree -deiU -f ${SRCDIR}/etc/mtree/BSD.tests.dist -p ${STAGEDIR}/work/usr/tests + +${ENV_FILTER} make -C${SRCDIR}/tests install ${MAKE_ARGS} DESTDIR=${STAGEDIR}/work + +generate_set ${STAGEDIR}/work ${TESTSSET} +generate_signature ${TESTSSET} diff --git a/build/upload.sh b/build/upload.sh index c94ab6ee..41f73fd0 100644 --- a/build/upload.sh +++ b/build/upload.sh @@ -42,7 +42,7 @@ for ARG in ${@}; do arm|dvd|nano|serial|vga|vm) upload ${ARG} ${IMAGESDIR} "*-${ARG}-*${PRODUCT_DEVICE+"-${PRODUCT_DEVICE}"}*" ;; - aux|distfiles|packages|release) + aux|distfiles|packages|release|tests) upload ${ARG} ${SETSDIR} "${ARG}-*" ;; base|kernel)