aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-06-29 22:10:09 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-06-29 22:10:09 +0200
commite10302404648d76ebd8fb50f95583386fdd69d0b (patch)
tree5b3bc826e66c7fac8eaba7f9261a7715d4c3202f
parenta3d493a60de3c704b252775205bcafc3a175c853 (diff)
parent61859da35edd6eada211eb630bf8ffa2d26288c1 (diff)
downloadnx-libs-e10302404648d76ebd8fb50f95583386fdd69d0b.tar.gz
nx-libs-e10302404648d76ebd8fb50f95583386fdd69d0b.tar.bz2
nx-libs-e10302404648d76ebd8fb50f95583386fdd69d0b.zip
Merge branch 'mjtrangoni-add-pvs-studio' into 3.6.x
Attributs GH PR #936: https://github.com/ArcticaProject/nx-libs/pull/936
-rw-r--r--.pvs-studio.sh29
-rw-r--r--.travis.yml46
2 files changed, 72 insertions, 3 deletions
diff --git a/.pvs-studio.sh b/.pvs-studio.sh
new file mode 100644
index 000000000..cf9f0d1ee
--- /dev/null
+++ b/.pvs-studio.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+before_install() {
+ if [ "$PVS_ANALYZE" = "yes" ]; then
+ sudo wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add -
+ sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
+ sudo apt-get update -qq
+ sudo apt-get install -qq pvs-studio
+ else
+ echo "not installing PVS-Studio"
+ fi
+}
+
+build_script() {
+ if [ "$PVS_ANALYZE" = "yes" ]; then
+ pvs-studio-analyzer credentials "${PVS_USERNAME}" "${PVS_KEY}" -o PVS-Studio.lic
+ pvs-studio-analyzer trace -- make -j2
+ pvs-studio-analyzer analyze --quiet -j2 -l PVS-Studio.lic -o "PVS-Studio-${CC}.log"
+ plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log"
+ cat "PVS-Studio-${CC}.tasks"
+ else
+ make -j2
+ fi
+}
+
+set -e
+set -x
+
+$1;
diff --git a/.travis.yml b/.travis.yml
index 431ec780e..776c1a4bd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,13 +1,14 @@
# Use new bionic images, should yield newer compilers and packages
language: cpp
os: linux
+dist: xenial
jobs:
include:
- name: "GCC 5.4"
- dist: xenial
addons:
apt:
+ update: true
sources:
- ubuntu-toolchain-r-test
packages:
@@ -31,11 +32,13 @@ jobs:
env:
- MATRIX_EVAL="CC=gcc && CXX=g++"
- STATIC_ANALYSIS="no"
+ - PVS_ANALYZE="no"
- name: "cppcheck 1.82 + GCC 10.x"
dist: bionic
addons:
apt:
+ update: true
sources:
- ubuntu-toolchain-r-test
packages:
@@ -61,11 +64,43 @@ jobs:
env:
- MATRIX_EVAL="CC=gcc-10 && CXX=g++-10"
- STATIC_ANALYSIS="yes"
+ - PVS_ANALYZE="no"
+
+ - name: "GCC 10.x + PVS-Studio"
+ dist: bionic
+ addons:
+ apt:
+ update: true
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - g++-10
+ # imake
+ - libxkbfile-dev
+ - xfonts-utils
+ - xutils-dev
+ # X11 libaries
+ - libxcomposite-dev
+ - libxdamage-dev
+ - libxfont-dev
+ - libxinerama-dev
+ - libxpm-dev
+ - libxrandr-dev
+ - libxtst-dev
+ - x11proto-fonts-dev
+ # soft requirements
+ - quilt
+ - x11-xkb-utils
+
+ env:
+ - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10"
+ - STATIC_ANALYSIS="no"
+ - PVS_ANALYZE="yes"
- name: "Clang 3.9"
- dist: xenial
addons:
apt:
+ update: true
sources:
- llvm-toolchain-xenial-3.9
packages:
@@ -90,11 +125,13 @@ jobs:
env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
- STATIC_ANALYSIS="no"
+ - PVS_ANALYZE="no"
- name: "Clang 9.x"
dist: bionic
addons:
apt:
+ update: true
sources:
- llvm-toolchain-bionic-9
- ubuntu-toolchain-r-test
@@ -120,13 +157,16 @@ jobs:
env:
- MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"
- STATIC_ANALYSIS="no"
+ - PVS_ANALYZE="no"
before_install:
- eval "${MATRIX_EVAL}"
+ - travis_retry bash .pvs-studio.sh before_install
+
script:
# run static analysis tools
- ./run-static-analysis.sh
# print compiler version
- ${CC} --version
# build all packages
- - make
+ - travis_retry bash .pvs-studio.sh build_script