5
5
n_procs=" $( getconf _NPROCESSORS_ONLN) "
6
6
7
7
function check_with_gcc() {
8
+ # previous runs may have cached configuration based on a different CC
8
9
rm -f config.cache
9
10
make clean
10
- ./configure -C --enable-debug CC=gcc
11
+ # here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
12
+ ./configure --config-cache --enable-debug CC=gcc
11
13
local gcc_exceptions=" -Wno-sign-compare -Wno-enum-int-mismatch"
12
14
make -j -l${n_procs} --keep-going CFLAGS=" -Werror -Wall -Wextra $gcc_exceptions "
13
15
}
14
16
15
17
function check_with_clang() {
18
+ # previous runs may have cached configuration based on a different CC
16
19
rm -f config.cache
17
20
make clean
18
- ./configure -C --enable-debug CC=clang
21
+ # here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
22
+ ./configure --config-cache --enable-debug CC=clang
19
23
make -j -l${n_procs} --keep-going CFLAGS=" -Werror -Wall -Wextra -Wno-sign-compare"
20
24
}
21
25
22
26
function check_with_cppcheck() {
27
+ # previous runs may have cached configuration based on a different CC
23
28
rm -f config.cache
24
29
make clean
30
+ # here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
31
+ ./configure --config-cache --enable-debug
25
32
make -C libpromises/ bootstrap.inc # needed by libpromises/bootstrap.c
26
- ./configure -C --enable-debug
33
+
34
+ # print out cppcheck version for comparisons over time in case of regressions due to newer versions
35
+ cppcheck --version
27
36
28
37
# cppcheck options:
29
38
# -I -- include paths
@@ -43,6 +52,13 @@ cd "$(dirname $0)"/../../
43
52
44
53
failure=0
45
54
failures=" "
55
+
56
+ # in jenkins the workdir is already autogen'd
57
+ # in github it is not, so do that work here
58
+ if [ ! -f configure ]; then
59
+ ./autogen.sh --enable-debug
60
+ fi
61
+
46
62
check_with_gcc || { failures=" ${failures} FAIL: GCC check failed\n" ; failure=1; }
47
63
check_with_clang || { failures=" ${failures} FAIL: Clang check failed\n" ; failure=1; }
48
64
check_with_cppcheck || { failures=" ${failures} FAIL: cppcheck failed\n" ; failure=1; }
0 commit comments