• Show log

    Commit

  • Hash : dedf70ad
    Author : Patrick Steinhardt
    Date : 2019-07-05T09:35:43

    patch_parse: do not depend on parsed buffer's lifetime
    
    When parsing a patch from a buffer, we let the patch lines point into
    the original buffer. While this is efficient use of resources, this also
    ties the lifetime of the parsed patch to the parsed buffer. As this
    behaviour is not documented anywhere in our API it is very surprising to
    its users.
    
    Untie the lifetime by duplicating the lines into the parsed patch. Add a
    test that verifies that lifetimes are indeed independent of each other.
    

  • README.md

  • 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