X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=subdirmk%2Ftests%2Fcheck;h=2bb0d6801407df0768111e68deec6c72e0d86521;hb=16bce837ffe3527d4e8ed306f4436a86891d6e60;hp=f0914dd597e456fd0a14287f1bb73d6834bcd44a;hpb=4ab0e4ad32e169bfd9e3af465e5850ccb8520890;p=secnet.git diff --git a/subdirmk/tests/check b/subdirmk/tests/check index f0914dd..2bb0d68 100755 --- a/subdirmk/tests/check +++ b/subdirmk/tests/check @@ -1,27 +1,15 @@ -#!/bin/sh -set -ex +#!/bin/bash +# subdirmk - toplevel invocation script for the test suite +# Copyright 2019 Mark Wooding +# Copyright 2019 Ian Jackson +# SPDX-License-Identifier: LGPL-2.0-or-later +# There is NO WARRANTY. -cd example -git clean -xdff -./autogen.sh && ./configure -make -j4 all check -make -j4 clean -make -j4 all check +set -e -git clean -xdff -mkdir build -cd build ->>../src/for-test.sd.mk ->>../lib/for-test.mk.in -.././autogen.sh && ../configure -make -j4 all check +j=$(nproc 2>/dev/null || echo 1) +j=$(( $j * 5 / 4 + 1 )) -echo '# for-check 1' >>../src/for-test.sd.mk -make -j4 -grep '^# for-check 1' src/Subdir.mk || false - -echo '# for-check 2' >>../lib/for-test.mk.in -make -j4 -grep '^# for-check 2' lib/for-test.mk || false - -echo ok. +x () { echo "$@"; "$@"; } +x ${MAKE-make} -f tests/tests.mk -j$j +echo 'ok.'