From baff0832bce249295ffbaa0afd47389f119ea32e Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 15 Dec 2017 10:53:55 -0500 Subject: [PATCH] Jenkins clang scan-build output publisher --- Jenkinsfile | 12 +++++++----- Makefile | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2fd0e17a5b..333c064bba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -249,10 +249,11 @@ pipeline { sh 'make scan-build' // publish html publishHTML target: [ + reportTitles: 'clang static analyzer', allowMissing: false, - alwaysLinkToLastBuild: false, + alwaysLinkToLastBuild: true, keepAll: true, - reportDir: 'build/scan-build/*', + reportDir: 'build/scan-build/report_latest', reportFiles: '*', reportName: 'Clang Static Analyzer' ] @@ -284,12 +285,13 @@ pipeline { sh 'make cppcheck' // publish html publishHTML target: [ + reportTitles: 'Cppcheck', allowMissing: false, - alwaysLinkToLastBuild: false, + alwaysLinkToLastBuild: true, keepAll: true, - reportDir: 'build/cppcheck/*', + reportDir: 'build/cppcheck/', reportFiles: '*', - reportName: 'cppcheck' + reportName: 'Cppcheck' ] } } diff --git a/Makefile b/Makefile index edcdcc07d0..bc8fa4504f 100644 --- a/Makefile +++ b/Makefile @@ -320,9 +320,12 @@ tests_coverage: scan-build: @export CCC_CC=clang @export CCC_CXX=clang++ + @rm -rf $(SRC_DIR)/build/posix_sitl_default-scan-build + @rm -rf $(SRC_DIR)/build/scan-build/report_latest @mkdir -p $(SRC_DIR)/build/posix_sitl_default-scan-build @cd $(SRC_DIR)/build/posix_sitl_default-scan-build && scan-build cmake $(SRC_DIR) -GNinja -DCONFIG=posix_sitl_default @scan-build -o $(SRC_DIR)/build/scan-build cmake --build $(SRC_DIR)/build/posix_sitl_default-scan-build + @find $(SRC_DIR)/build/scan-build -maxdepth 1 -mindepth 1 -type d -exec cp -r "{}" $(SRC_DIR)/build/scan-build/report_latest \; posix_sitl_default-clang: @mkdir -p $(SRC_DIR)/build/posix_sitl_default-clang