Skip to content

Commit

Permalink
cppcheck with --project
Browse files Browse the repository at this point in the history
CI: test misra with RELEASE=1
Generates compile db without ALLOW_DEBUG
  • Loading branch information
dzid26 committed Sep 23, 2024
1 parent da75bfa commit 0c67ceb
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 470 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ jobs:
run: eval "$BUILD"
- name: Build FW
run: ${{ env.RUN }} "scons -j$(nproc)"
- name: Run MISRA C:2012 analysis
- name: Run MISRA C:2012 analysis - ALLOW_DEBUG
timeout-minutes: 1
run: ${{ env.RUN }} "cd tests/misra && ./test_misra.sh"
- name: Run MISRA C:2012 analysis - RELEASE
timeout-minutes: 2
run: ${{ env.RUN }} "cd tests/misra && CERT=./certs/debug RELEASE=1 ./test_misra.sh"
- name: MISRA mutation tests
timeout-minutes: 7
run: ${{ env.RUN }} "cd tests/misra && pytest -n8 test_mutation.py"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ examples/output.csv
nosetests.xml
.mypy_cache/
.sconsign.dblite
compile_commands*.json

# CTU info files generated by Cppcheck
*.*.ctu-info
Expand Down
4 changes: 2 additions & 2 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def build_project(project_name, project, extra_flags):

# Bootstub
crypto_obj = [
env.Object(f"rsa-{project_name}", f"{panda_root}/crypto/rsa.c"),
env.Object(f"sha-{project_name}", f"{panda_root}/crypto/sha.c")
env.Object(f"bootstub-rsa-{project_name}", f"{panda_root}/crypto/rsa.c"),
env.Object(f"bootstub-sha-{project_name}", f"{panda_root}/crypto/sha.c")
]
bootstub_obj = env.Object(f"bootstub-{project_name}", File(project.get("BOOTSTUB", f"{panda_root}/board/bootstub.c")))
bootstub_elf = env.Program(f"obj/bootstub.{project_name}.elf",
Expand Down
6 changes: 6 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ env = Environment(
)

if GetOption('compile_db'):
# whole project compilation database
env.CompilationDatabase("compile_commands.json")

# Panda compilation database
env_p = env.Clone()
env_p["COMPILATIONDB_PATH_FILTER"] = '*board/[!jungle/][!bootstub]*'
env_p.CompilationDatabase("compile_commands_panda.json")

# panda fw & test files
SConscript('SConscript')
Loading

0 comments on commit 0c67ceb

Please sign in to comment.