Files
libgit2/tests
..
2022-01-05 16:35:52 +02:00
2022-01-17 21:39:35 -05:00
2022-02-06 15:08:35 -05:00
2022-01-05 16:35:52 +02:00
2022-01-05 16:35:52 +02:00
2021-11-11 17:31:43 -05:00
2022-01-05 16:35:52 +02:00
2022-01-05 16:35:52 +02:00
2022-01-05 16:35:52 +02:00
2023-02-14 11:06:24 +00:00
2022-04-12 09:06:01 -04: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