Skip to content

Commit 3d784ee

Browse files
Merge pull request #5761 from craigcomstock/ENT-11515/master
Adjusted static-checks test to use half the number of available processors to avoid cppcheckerror segfaults
2 parents 373d92b + cd4dce1 commit 3d784ee

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/static-check/run_checks.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -x
44

55
n_procs="$(getconf _NPROCESSORS_ONLN)"
6+
use_procs=$((n_procs/2))
67

78
function check_with_gcc() {
89
# previous runs may have cached configuration based on a different CC
@@ -11,7 +12,7 @@ function check_with_gcc() {
1112
# here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
1213
./configure --config-cache --enable-debug CC=gcc
1314
local gcc_exceptions="-Wno-sign-compare -Wno-enum-int-mismatch"
14-
make -j -l${n_procs} --keep-going CFLAGS="-Werror -Wall -Wextra $gcc_exceptions"
15+
make -j -l${use_procs} --keep-going CFLAGS="-Werror -Wall -Wextra $gcc_exceptions"
1516
}
1617

1718
function check_with_clang() {
@@ -20,7 +21,7 @@ function check_with_clang() {
2021
make clean
2122
# here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
2223
./configure --config-cache --enable-debug CC=clang
23-
make -j -l${n_procs} --keep-going CFLAGS="-Werror -Wall -Wextra -Wno-sign-compare"
24+
make -j -l${use_procs} --keep-going CFLAGS="-Werror -Wall -Wextra -Wno-sign-compare"
2425
}
2526

2627
function check_with_cppcheck() {
@@ -39,7 +40,7 @@ function check_with_cppcheck() {
3940
# -i -- ignored files/folders
4041
# --include=<file> -- force including a file, e.g. config.h
4142
# Identified issues are printed to stderr
42-
cppcheck --quiet -j${n_procs} --error-exitcode=1 ./ \
43+
cppcheck --quiet -j${use_procs} --error-exitcode=1 ./ \
4344
--suppressions-list=tests/static-check/cppcheck_suppressions.txt \
4445
--check-level=exhaustive \
4546
--include=config.h \

0 commit comments

Comments
 (0)