Hash :
b3196a60
Author :
Date :
2019-06-10T12:27:12
For information on the Clar testing framework and a detailed introduction please visit:
Write your modules and tests. Use good, meaningful names.
Make sure you actually build the tests by setting:
cmake -DBUILD_CLAR=ON build/
Test:
./build/libgit2_clar
Make sure everything is fine.
Send your pull request. That’s it.
These are automatically run as part of CI, but if you want to check locally:
Uses valgrind
:
$ cmake -DBUILD_CLAR=ON -DVALGRIND=ON ..
$ cmake --build .
$ valgrind --leak-check=full --show-reachable=yes --num-callers=50 --suppressions=../libgit2_clar.supp \
./libgit2_clar
Uses leaks
, which requires XCode installed:
$ MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null CLAR_AT_EXIT="leaks -quiet \$PPID" \
./libgit2_clar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
Writing Clar tests for libgit2
==============================
For information on the Clar testing framework and a detailed introduction
please visit:
https://github.com/vmg/clar
* Write your modules and tests. Use good, meaningful names.
* Make sure you actually build the tests by setting:
cmake -DBUILD_CLAR=ON build/
* Test:
./build/libgit2_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
```