Skip to content

Files

Latest commit

9830ab3 · Apr 14, 2020

History

History
This branch is 2896 commits behind libgit2/libgit2:main.

tests

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 22, 2019
Dec 12, 2019
Apr 14, 2020
Oct 21, 2018
Dec 10, 2019
Jul 20, 2019
Jul 5, 2019
Oct 17, 2019
Oct 30, 2019
Feb 7, 2020
Mar 10, 2020
Jul 13, 2018
Jun 29, 2018
Jun 15, 2019
Feb 7, 2020
Jan 31, 2020
Aug 11, 2019
Jul 22, 2019
Feb 7, 2020
Feb 7, 2020
Feb 7, 2020
Nov 28, 2018
Apr 1, 2020
Jan 17, 2018
Feb 7, 2020
Feb 7, 2020
Feb 18, 2020
Jun 15, 2019
Feb 7, 2020
Jan 9, 2020
Mar 26, 2020
Mar 10, 2020
Jan 3, 2018
Aug 9, 2019
Jan 15, 2020
Jul 21, 2019
Apr 3, 2020
Jul 20, 2019
Apr 14, 2020
Jul 20, 2019
May 10, 2019
Oct 18, 2019
Jul 20, 2019
Jan 25, 2019
Jun 10, 2018
Jan 6, 2020
Jan 22, 2019
Jul 5, 2019
Mar 19, 2018
Oct 3, 2018
Jul 20, 2019
Jun 24, 2019
Jan 24, 2020
Jun 11, 2019
Jul 20, 2019
Jul 5, 2019
Jan 22, 2019
Dec 10, 2019
Mar 3, 2015
Mar 3, 2015
Jan 24, 2020
Mar 2, 2015
Jul 18, 2019
Oct 30, 2018
Aug 16, 2017
Aug 16, 2017
Jan 22, 2019

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:

$ 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, which requires XCode installed:

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