libgit2/tests-clar
Russell Belfer 145e696b49 Minor fixes, cleanups, and clarifications
There are three actual changes in this commit:

1. When the trailing newline of a file is removed in a diff, the
   change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed
   to the callback.  Previously, the `ADD_EOFNL` constant was given
   which was just an error in my understanding of when the various
   circumstances arose.  `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and
   should never be generated.  A new newline is simply an `ADD`.
2. Rewrote the `diff_delta__merge_like_cgit` function that contains
   the core logic of the `git_diff_merge` implementation.  The new
   version doesn't actually have significantly different behavior,
   but the logic should be much more obvious, I think.
3. Fixed a bug in `git_diff_merge` where it freed a string pool
   while some of the string data was still in use.  This led to
   `git_diff_print_patch` accessing memory that had been freed.

The rest of this commit contains improved documentation in `diff.h`
to make the behavior and the equivalencies with core git clearer,
and a bunch of new tests to cover the various cases, oh and a minor
simplification of `examples/diff.c`.
2012-06-08 12:11:13 -07:00
..
attr Fix bugs for status with spaces and reloaded attrs 2012-05-24 17:14:56 -07:00
buf Update test suite 2012-05-02 16:14:30 -07:00
commit errors: Rename the generic return codes 2012-05-18 01:26:26 +02:00
config errors: Rename error codes 2012-05-18 01:48:50 +02:00
core Tests: wrap 'getenv' and friends for Win32 tests. 2012-06-08 11:24:37 -07:00
date Omit failing test on 32-bit machines. 2012-06-06 12:39:29 -07:00
diff Minor fixes, cleanups, and clarifications 2012-06-08 12:11:13 -07:00
index misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
network Merge pull request #684 from benstraub/rev-parse 2012-06-07 12:29:31 -07:00
notes errors: Rename error codes 2012-05-18 01:48:50 +02:00
object misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
odb clar: Fix warning 2012-05-16 19:24:35 +02:00
refs Tests: wrap 'getenv' and friends for Win32 tests. 2012-06-08 11:24:37 -07:00
repo repository: make git_repository_init() value the core.ignorecase config entry 2012-06-05 22:33:34 +02:00
reset Add git_reset() 2012-06-07 21:27:30 +02:00
resources Fix filemode comparison in diffs 2012-06-08 12:09:10 -07:00
revwalk errors: Rename error codes 2012-05-18 01:48:50 +02:00
status Fix filemode comparison in diffs 2012-06-08 12:09:10 -07:00
threads t13-threads.c ported. 2012-03-30 13:05:54 -07:00
clar Fixed mode on clar 2012-05-10 11:15:37 -07:00
clar_helpers.c Fix filemode comparison in diffs 2012-06-08 12:09:10 -07:00
clar_libgit2.h Fix filemode comparison in diffs 2012-06-08 12:09:10 -07:00
README.md Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00

Writing Clar tests for libgit2

For information on the Clar testing framework and a detailed introduction please visit:

https://github.com/tanoku/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.