test_all.sh (1885B)
- #!/bin/sh
- # SPDX-FileCopyrightText: 2017-2022 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- # SPDX-License-Identifier: MPL-2.0
- # This is used to run tests on all known and available targets
- # ./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"
- for make in gmake bmake pmake
- do
- if grep -q '#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 $compilers
- do
- 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
- echo "CC=${cc} time ${make} 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} 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