~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 066047089f58a3a1390d4c95d16716b926c60524
parent 6d11c1604306ed7a346a8ca7a1db9b5af7dbf7b6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu,  5 Aug 2021 10:28:29 +0200

test_all.sh: Improve output, skip pcc and cproc on GNU libc systems


1 file changed, 54 insertions(+), 10 deletions(-)

diff --git a/test_all.sh b/test_all.sh @@ -1,21 +1,65 @@ #!/bin/sh # This is used to run tests on all known and available targets -set -ex +# ./test_all.sh 2>&1 | tee test_all.log ; grep '^TEST-ALL:' test_all.log +set -e +err=0 export CFLAGS="-O2 -g2 -Wall -Wextra -Werror=all" -if command -v nproc >/dev/null 2>&1; then - makeflags="-j$(nproc)" -fi -for make in gmake bmake +for make in gmake bmake pmake do - command -v $make || break + if grep '#define\W__GLIBC__' /usr/include/features.h + then + compilers="tcc gcc clang" + for cc in cproc pcc + do + echo "TEST-ALL: CC=${cc} ${make} clean: SKIPPED (glibc)" + echo "TEST-ALL: CC=${cc} ${make} all: SKIPPED (glibc)" + echo "TEST-ALL: CC=${cc} ${make} test: SKIPPED (glibc)" + done + else + compilers="tcc gcc clang cproc pcc" + fi - for cc in tcc gcc clang cproc + for cc in $compilers do - command -v $cc || break + if command -v $cc && command -v $make + then + echo "CC=${cc} time ${make} clean" + if CC=${cc} time ${make} clean; then + echo "TEST-ALL: CC=${cc} ${make} clean: OK" + else + echo "TEST-ALL: CC=${cc} ${make} clean: FAILED" + echo "TEST-ALL: CC=${cc} ${make} all: SKIPPED (clean fail)" + echo "TEST-ALL: CC=${cc} ${make} test: SKIPPED (clean fail)" + exit 1 + fi - $make clean - CC=$cc time $make $makeflags test + echo "CC=${cc} time ${make} ${makeflags} all" + if CC=${cc} time ${make} -j1 all + then + echo "TEST-ALL: CC=${cc} ${make} all: OK" + else + echo "TEST-ALL: CC=${cc} ${make} all: FAILED" + echo "TEST-ALL: CC=${cc} ${make} test: SKIPPED (build fail)" + err=1 + continue + fi + + echo "CC=${cc} time ${make} ${makeflags} test" + if CC=${cc} time ${make} -j1 test + then + echo "TEST-ALL: CC=${cc} ${make} test: OK" + else + echo "TEST-ALL: CC=${cc} ${make} test: FAILED" + err=1 + fi + else + echo "TEST-ALL: CC=${cc} ${make} clean: SKIPPED (${cc} or ${make} missing)" + echo "TEST-ALL: CC=${cc} ${make} all: SKIPPED (${cc} or ${make} missing)" + echo "TEST-ALL: CC=${cc} ${make} test: SKIPPED (${cc} or ${make} missing)" + fi done done + +exit $err