1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#!/bin/sh
#
# Run tests for continuous integration.
#
# This script is normally run in a test container or VM, such as via GitHub
# Actions.
#
# Copyright 2015-2020 Russ Allbery <eagle@eyrie.org>
#
# SPDX-License-Identifier: MIT
set -eux
# Normally, COMPILER and KERBEROS are set based on the CI matrix, but provide
# a default in case someone runs this test by hand.
COMPILER="${COMPILER:-gcc}"
KERBEROS="${KERBEROS:-mit}"
# Build everything.
./bootstrap
if [ "$KERBEROS" = 'heimdal' ]; then
./configure CC="$COMPILER" PATH_KRB5_CONFIG=/usr/bin/krb5-config.heimdal
else
./configure CC="$COMPILER"
fi
make warnings
# Run the tests with valgrind for one of the compilers. Arbitrarily
# pick the GCC build. (The assumption here is that other compilers won't
# produce sufficiently different code as to create memory management
# problems.)
if [ "$COMPILER" = 'gcc' ]; then
make check-valgrind
else
make check
fi
# Run some additional checks for one of the builds. Arbitrarily pick the GCC
# MIT build.
if [ "$COMPILER" = 'gcc' ] && [ "$KERBEROS" = 'mit' ]; then
make check-cppcheck
fi
|