From f3822ecf7b108e2b422464395ef177c1c1e1a0f8 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Thu, 18 Jul 2019 17:41:04 +0200 Subject: [PATCH] junit2html --- .gitlab-ci.yml | 10 ++++++---- script/build_compile_commands.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c847c6f..a1faec1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,15 +51,17 @@ static_analysis: - pio init --ide atom - pip install cppcheck-junit - mkdir -p build + - pip install junit2html script: -# - cppcheck --enable=all --check-config src - - cppcheck --error-exitcode=1 src 2>&1 | tee build/cppcheck-err.txt - - cppcheck --xml src 2> build/cppcheck-result.xml - script/build_compile_commands.py + - cppcheck --error-exitcode=1 --enable=all --check-config --project=compile_commands.json src 2>&1 | tee build/cppcheck-err.txt + - cppcheck --xml --enable=all --check-config --project=compile_commands.json src 2> build/cppcheck-result.xml - run-clang-tidy -fix -export-fixes=build/clang-tidy-fixes.yml src after_script: - cppcheck_junit build/cppcheck-result.xml build/cppcheck-junit.xml - - cat "build/clang-tidy-fixes.yml" | script/clang-tidy-to-junit.py src >"build/clang-tidy-junit.xml" + - cat "build/clang-tidy-fixes.yml" | script/clang-tidy-to-junit.py src >"build/clang-tidy-junit.xml" + - junit2html --summary-matrix build/build/clang-tidy-junit.xml + - junit2html --summary-matrix build/cppcheck-junit.xml artifacts: reports: junit: diff --git a/script/build_compile_commands.py b/script/build_compile_commands.py index 8b6089d..181528d 100755 --- a/script/build_compile_commands.py +++ b/script/build_compile_commands.py @@ -50,7 +50,7 @@ def build_compile_commands(): gcc_flags = json.load(f) exec_path = gcc_flags['execPath'] include_paths = gcc_flags['gccIncludePaths'].split(',') - includes = ['-isystem{}'.format(p) for p in include_paths] + includes = ['-I{}'.format(p) for p in include_paths] cpp_flags = shlex.split(gcc_flags['gccDefaultCppFlags']) defines = [flag for flag in cpp_flags if flag.startswith('-D')] command = [exec_path]