]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
gitlabci: fix scan-build
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 21 Feb 2019 14:48:08 +0000 (15:48 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:43:35 +0000 (10:43 +0100)
.gitlab-ci.yml
scripts/get-scanbuild-args.sh [moved from tests/clang_scan_build.sh with 96% similarity]

index 6f6b1627bc611e496985fd455238e7cfdce95d9b..1c57ef01fc48a5221c2b46cbd9ff4de03b1cd05b 100644 (file)
@@ -163,21 +163,19 @@ lint:lua:
   tags:
     - docker
 
-lint:clang-scan-build:
+lint:scan-build:
+  <<: *test
   stage: test
-  except:
-    - master
-  dependencies: []  # do not download build artifacts
-  script:
-    - MAKEFLAGS="-k -j$(nproc)" SCAN_BUILD="scan-build -o scan-results --status-bugs -no-failure-reports" ./tests/clang_scan_build.sh make || true
-    - test "$(ls scan-results/*/report-*.html | wc -l)" = 6 # we have this many errors ATM :-)
   artifacts:
     when: on_failure
     expire_in: '1 day'
     paths:
-      - scan-results
-  tags:
-    - docker
+      - build_ci*/meson-logs/scanbuild
+  before_script: []
+  script:
+    - export SCANBUILD="scan-build --status-bugs -no-failure-reports $(./scripts/get-scanbuild-args.sh)"
+    - ninja -C build_ci* scan-build || true
+    - test "$(ls build_ci*/meson-logs/scanbuild/*/report-*.html | wc -l)" = 14 # we have this many errors ATM :-)
 
 docker:
   stage: test
similarity index 96%
rename from tests/clang_scan_build.sh
rename to scripts/get-scanbuild-args.sh
index 8d7398fff3b93fcd5ad9e556d36342931e5278f9..7fc72de1670cf410c598ffa91a72dd88662a82e6 100755 (executable)
@@ -14,7 +14,7 @@ set -o errexit -o nounset
 # alpha.deadcode.UnreachableCode # false positives/flags sanity checks depending on implementation details
 # alpha.security.MallocOverflow # not smart enough to infer max values from data types
 
-${SCAN_BUILD:-scan-build} \
+cat <<-EOF
 -disable-checker  unix.Malloc \
 -enable-checker   alpha.core.BoolAssignment \
 -enable-checker   alpha.core.CallAndMessageUnInitRefArg \
@@ -47,5 +47,5 @@ ${SCAN_BUILD:-scan-build} \
 -enable-checker   security.FloatLoopCounter \
 -enable-checker   valist.CopyToSelf \
 -enable-checker   valist.Uninitialized \
--enable-checker   valist.Unterminated \
-make
+-enable-checker   valist.Unterminated
+EOF