From: Ian Jackson Date: Fri, 6 Dec 2019 22:24:26 +0000 (+0000) Subject: comprehensive-test: new script X-Git-Tag: v0.6.0~261 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=55b32c21451698763ebf9fa4a6e5ad035523f114;hp=2a01345b9034b947bb179bce29a13028ea9ca64d;p=secnet.git comprehensive-test: new script This does an in-tree build, and two out-of-tree builds, one absolute, and one relative. It runs `make check' (not fullcheck, which is very slow indeed). Signed-off-by: Ian Jackson --- diff --git a/comprehensive-test b/comprehensive-test new file mode 100755 index 0000000..12d63d6 --- /dev/null +++ b/comprehensive-test @@ -0,0 +1,40 @@ +#!/bin/bash +set -e +set -o pipefail + +oot_rel=oot-rel.tmp~ +oot_abs=$(cd .. && pwd)/oot-comprehensive-test.tmp~ + +nproc=$(nproc || echo 1) +mflags=-j$nproc + +for arg in "$@"; do + case "$arg" in + --oot-abs=*) oot_abs=${arg%*=} ;; + *) echo >&2 "unknown arg/option $1"; exit 1;; + esac +done + +x () { echo >&2 "x $*"; "$@"; } + +srcdir=$(pwd) + +build_and_test () { + cd "$srcdir" + x git clean -xdff + if [ "x$1" != x. ]; then + rm -rf "$1" + mkdir "$1" + fi + x ./autogen.sh + x cd "$1" + x "$srcdir/configure" CFLAGS='-O0 -g' + x make $mflags all check + cd "$srcdir" +} + +build_and_test . +build_and_test "$oot_rel" +build_and_test "$oot_abs" + +echo "----- $0 ok -----"