Browse Source

junit2html

quality-test
Hendrik Langer 6 years ago
parent
commit
f3822ecf7b
  1. 10
      .gitlab-ci.yml
  2. 2
      script/build_compile_commands.py

10
.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:

2
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]

Loading…
Cancel
Save