Skip to content

Commit

Permalink
add doc pvs studio
Browse files Browse the repository at this point in the history
  • Loading branch information
piponazo committed Feb 5, 2022
1 parent 524fad4 commit fec91a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pvsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//-V::1042
25 changes: 25 additions & 0 deletions doc/readme-pvs-studio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# How to integrate PVS-Studio

We obtained a free license of PVS-Studio due to the open source nature of Exiv2.

## CMake integration

To check a project configured with CMake, such as Exiv2, we need to generate the JSON compilation database.

```bash
# Under an already configured "buildXXX" directory
cd buildXXX
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ...

# Output file: compile_commands.json
```

The analysis starts with the following commands:

```bash
export PVS_LICENSE=~/.config/PVS-Studio/PVS-Studio.lic
pvs-studio-analyzer analyze -l $PVS_LICENSE -o pvsStudio.log -j8
plog-converter -a GA:1,2 -t tasklist pvsStudio.log -o pvsStudio.tasks
plog-converter -a GA:1,2 -t fullhtml pvsStudio.log -o pvsReportHtml
log-converter -a GA:1,2 -d V1042 -t fullhtml pvsStudio.log -o pvsReportHtml
```

0 comments on commit fec91a9

Please sign in to comment.