From 72bd2a83a01c70938f4d55337ecc2c3211694a2a Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sun, 29 Aug 2021 15:26:31 -0700 Subject: [PATCH] reduce length of scanbuild static analyzer test This was ~30mn, by far the longest run on travisCI. That's because it re-analyzes multiple times the same files (library files notably). It also performs actions that make no sense for the static analyzer purpose, such as building the single-file library. Reduced time spent in this test by reducing its scope : just build the CLI, and obviously the library along it. These are the only ones that really deserve to be analyzed. Unfortunately, it still results in a number of false positives when using newer versions of scanbuild (each version of scanbuild generates a different list of false positives). These will have to be fixed before transfering to Github Actions. --- .travis.yml | 7 ++++--- Makefile | 2 +- tests/test-zstd-versions.py | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 85fbf78b8..1acbfecf1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ matrix: - make -C tests fuzztest # TODO: migrate to GH actions once newest clang staticanalyze warnings are fixed - - name: static analyzer scanbuild # ~26mn + - name: static analyzer scanbuild # ~8mn dist: trusty # note : it's important to pin down a version of static analyzer, since different versions report different false positives script: - make staticAnalyze @@ -104,8 +104,9 @@ matrix: - make arminstall - make aarch64fuzz - # To be removed once confirmed transferred to GA - - name: Versions Compatibility Test # 11.5mn + # This test currently fails on GA specifically, for no obvious reason + # (it works fine on travisCI, and on local test platforms). + - name: Versions Compatibility Test # ~6mn script: - make -C tests versionsTest diff --git a/Makefile b/Makefile index c1908f0a1..b9265e7f8 100644 --- a/Makefile +++ b/Makefile @@ -416,5 +416,5 @@ bmi32build: clean staticAnalyze: SCANBUILD ?= scan-build staticAnalyze: $(CC) -v - CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) allzstd examples contrib + CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) zstd endif diff --git a/tests/test-zstd-versions.py b/tests/test-zstd-versions.py index cc1693a26..baca251f5 100755 --- a/tests/test-zstd-versions.py +++ b/tests/test-zstd-versions.py @@ -244,6 +244,9 @@ if __name__ == '__main__': make(['zstd'], False) else: os.chdir(programs_dir) + print('-----------------------------------------------') + print('compiling head') + print('-----------------------------------------------') make(['zstd'], False) shutil.copy2('zstd', dst_zstd) @@ -260,7 +263,9 @@ if __name__ == '__main__': print('cp ' + dict_files + ' ' + dict_source_path) execute('cp ' + dict_files + ' ' + dict_source_path, param_shell=True) + print('-----------------------------------------------') print('Compress test.dat by all released zstd') + print('-----------------------------------------------') error_code = 0 for tag in tags: