Files
libgit2/tests
Edward Thomson ceddeed80a Merge pull request #6104 from libgit2/ethomson/path
path: refactor utility path functions
2021-11-11 15:20:50 -05:00
..
2021-05-05 23:11:52 +01:00
2021-09-15 17:09:17 -05:00
2018-03-19 16:08:01 -07:00
2020-06-05 08:49:07 +01:00
2020-06-05 08:49:07 +01:00
2021-10-18 08:30:14 -04:00
2019-07-18 14:29:43 +02:00
2021-10-28 10:25:09 +02:00

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_TESTS=ON build/
    
  • Test:

      ./build/libgit2_tests
    
  • 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:

$ cmake -DBUILD_TESTS=ON -DVALGRIND=ON ..
$ cmake --build .
$ valgrind --leak-check=full --show-reachable=yes --num-callers=50 --suppressions=../libgit2_tests.supp \
  ./libgit2_tests

macOS

Uses leaks, which requires XCode installed:

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