Skip to content

Commit

Permalink
Add memleak check docs
Browse files Browse the repository at this point in the history
Document how to run it locally on macOS & Linux
  • Loading branch information
rcoup committed Jun 11, 2019
1 parent f4584a1 commit b3196a6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,29 @@ https://github.com/vmg/clar
* Make sure everything is fine.

* Send your pull request. That's it.


Memory leak checks
------------------

These are automatically run as part of CI, but if you want to check locally:

#### Linux

Uses [`valgrind`](http://www.valgrind.org/):

```console
$ cmake -DBUILD_CLAR=ON -DVALGRIND=ON ..
$ cmake --build .
$ valgrind --leak-check=full --show-reachable=yes --num-callers=50 --suppressions=../libgit2_clar.supp \
./libgit2_clar
```

#### macOS

Uses [`leaks`](https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/FindingLeaks.html), which requires XCode installed:

```console
$ MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null CLAR_AT_EXIT="leaks -quiet \$PPID" \
./libgit2_clar
```

0 comments on commit b3196a6

Please sign in to comment.