scripts, Makefile: move static_analysis_tests to a Makefile target

To further trim down run_tests.sh, move the code that runs the clang
static analyzer into a 'make' target.
This commit is contained in:
Eric Biggers 2020-10-18 14:21:26 -07:00
parent 14a5617b70
commit c583b0a70c
3 changed files with 10 additions and 15 deletions

View File

@ -22,7 +22,8 @@ matrix:
- sudo apt-get install -y libz-dev gcc-multilib libz-dev:i386
libc6-dev-i386 clang
script:
- scripts/run_tests.sh checksum_benchmarks static_analysis
- scripts/run_tests.sh checksum_benchmarks
- make scan-build
- name: Native tests (Linux aarch64)
os: linux
@ -40,7 +41,8 @@ matrix:
before_install:
- sudo apt-get install -y libz-dev clang
script:
- scripts/run_tests.sh checksum_benchmarks static_analysis
- scripts/run_tests.sh checksum_benchmarks
- make scan-build
- name: gzip and cross-compile-for-Windows tests (Linux)
os: linux

View File

@ -324,6 +324,10 @@ check:test_programs
./$$prog || exit 1; \
done
# Run the clang static analyzer.
scan-build:
scan-build --status-bugs make all test_programs
help:
@echo "Available targets:"
@echo "------------------"
@ -346,6 +350,7 @@ realclean: clean
FORCE:
.PHONY: all install uninstall test_programs help clean realclean
.PHONY: all install uninstall test_programs check scan-build help \
clean realclean
.DEFAULT_GOAL = all

View File

@ -239,17 +239,6 @@ windows_tests() {
###############################################################################
static_analysis_tests() {
test_group_included static_analysis || return 0
if ! type -P scan-build > /dev/null; then
log_skip "clang static analyzer (scan-build) not found"
return 0
fi
run_cmd scan-build --status-bugs make -j$NPROC all test_programs
}
###############################################################################
gzip_tests() {
test_group_included gzip || return 0
@ -288,7 +277,6 @@ native_tests
freestanding_tests
checksum_benchmarks
windows_tests
static_analysis_tests
gzip_tests
if (( TESTS_SKIPPED )); then