[gjs: 1/4] CI: save cppcheck result as artifacts
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/4] CI: save cppcheck result as artifacts
- Date: Tue, 6 Mar 2018 13:27:02 +0000 (UTC)
commit 510afc17eb6e75c8b39c3834bfd8bb151ee40f52
Author: Claudio André <claudioandre br gmail com>
Date: Sun Mar 4 12:03:39 2018 -0300
CI: save cppcheck result as artifacts
It might be needed or useful.
.gitlab-ci.yml | 1 +
test/test-ci.sh | 10 ++++++----
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dfc5b43..e6d1551 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,6 +18,7 @@ stages:
- $(pwd)/.cache/jhbuild/build/gjs/config.log
- $(pwd)/.cache/jhbuild/build/gjs/Makefile
- $(pwd)/coverage/
+ - $(pwd)/cppcheck/
script:
# Run static code analysis OR
diff --git a/test/test-ci.sh b/test/test-ci.sh
index 0bb3870..822f9ad 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -61,8 +61,10 @@ echo "Doing: $1"
source test/extra/do_jhbuild.sh
-# Create the coverage artifacts folders
+# Create the artifacts folders
mkdir -p $(pwd)/coverage; touch $(pwd)/coverage/doing-"$1"
+mkdir -p $(pwd)/cppcheck; touch $(pwd)/cppcheck/doing-"$1"
+save_dir=$(pwd)
if [[ $1 == "GJS" ]]; then
do_Set_Env
@@ -121,16 +123,16 @@ elif [[ $1 == "CPPCHECK" ]]; then
echo
echo '-- Static code analyzer report --'
cppcheck --inline-suppr --enable=warning,performance,portability,information,missingInclude --force -q .
2>&1 | \
- sed -E 's/:[0-9]+]/:LINE]/' | tee /cwd/current-report.txt
+ tee "$save_dir"/cppcheck/current-report.txt | sed -E 's/:[0-9]+]/:LINE]/' | tee
/cwd/current-report.txt
echo
echo '-- Master static code analyzer report --'
git clone --depth 1 https://gitlab.gnome.org/GNOME/gjs.git tmp-upstream; cd tmp-upstream || exit 1
cppcheck --inline-suppr --enable=warning,performance,portability,information,missingInclude --force -q .
2>&1 | \
- sed -E 's/:[0-9]+]/:LINE]/' | tee /cwd/master-report.txt
+ tee "$save_dir"/cppcheck/master-report.txt | sed -E 's/:[0-9]+]/:LINE]/' | tee /cwd/master-report.txt
echo
- # Compare the report with master and fails if new warnings is found
+ # Compare the report with master and fails if new warnings are found
if ! diff --brief /cwd/master-report.txt /cwd/current-report.txt > /dev/null; then
echo '----------------------------------------'
echo '### New warnings found by cppcheck ###'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]