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