libgit2/tests-clar
Russell Belfer d958e37a48 Fix issues with git_diff_find_similar
There are a number of bugs in the rename code that only were
obvious when I started testing it against large old repos with
more complex patterns.  (The code to do that testing is not ready
to merge with libgit2, but I do plan to add more thorough tests.)

This contains a significant number of changes and also tweaks the
public API slightly to make emulating core git easier.

Most notably, this separates the GIT_DIFF_FIND_AND_BREAK_REWRITES
flag into FIND_REWRITES (which adds a self-similarity score to
every modified file) and BREAK_REWRITES (which splits the modified
deltas into add/remove pairs in the diff list).  When you do a raw
output of core git, rewrites show up as M090 or such, not at A and
D output, so I wanted to be able to emulate that.

Publicly, this also changes the flags to be uint16_t since we
don't need values out of that range.

Internally, this contains significant changes from a number of
small bug fixes (like using the wrong side of the diff to decide
if the object could be found in the ODB vs the workdir) to larger
issues about which files can and should be compared and how the
various edge cases of similarity scores should be treated.

Honestly, I don't think this is the last update that will have to
be made to this code, but I think this moves us closer to correct
behavior and I tried to document the code so it would be easier
to follow..
2013-05-17 17:21:45 -07:00
..
attr Do not fail if .gitignore is directory 2013-02-22 12:21:54 -08:00
buf buf: introduce git_buf_splice() 2012-10-25 17:42:35 +02:00
checkout Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
clar Update clar to a80e7f30 2013-01-21 13:39:53 -08:00
clone Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
commit Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
config config: convenience function to open global/xdg 2013-05-07 21:42:56 +02:00
core Add git_oid_strcmp and use it for git_oid_streq 2013-04-29 08:59:46 -07:00
date Omit failing test on 32-bit machines. 2012-06-06 12:39:29 -07:00
diff Fix issues with git_diff_find_similar 2013-05-17 17:21:45 -07:00
fetchhead Fetchhead: don't expect a tag that isn't there 2013-02-06 13:25:43 -08:00
index Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
merge Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
network Merge pull request #1385 from carlosmn/refs-iter 2013-05-11 02:42:49 -07:00
notes added missing free for git_note in clar tests 2013-03-06 22:51:20 +01:00
object Add git_oid_nfmt - a flexible OID formatter 2013-05-17 16:40:00 -07:00
odb What has science done. 2013-04-22 16:50:50 +02:00
online Do not write tagopt configuration option on clone by default 2013-05-04 12:14:40 -04:00
pack indexer: kill git_indexer 2013-03-03 15:19:21 +01:00
refdb Introduce a glob-filtering iterator 2013-05-11 11:20:38 +02:00
refs Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
repo Fix git_repository_message docs 2013-05-09 06:45:06 -07:00
reset Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
resources Fix refdb iteration early termination bug 2013-05-11 06:42:25 -07:00
revwalk revwalk: Parse revision ranges 2013-04-06 20:51:16 -07:00
stash Plug a couple of leaks 2013-04-20 16:20:33 +02:00
status Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
submodule fix some leaks 2013-05-02 20:43:45 -05:00
threads tests: fix code style in threads/basic.c 2013-02-07 02:04:17 -08:00
trace Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
clar_libgit2.c Improve ignore handling in git_status_file 2013-05-10 07:50:53 -07:00
clar_libgit2.h Improve ignore handling in git_status_file 2013-05-10 07:50:53 -07:00
clar.c Update to latest Clar 2013-03-22 14:23:18 -07:00
clar.h Update to latest Clar 2013-03-22 14:23:18 -07:00
generate.py Update to latest Clar 2013-03-22 14:23:18 -07:00
main.c clar: haha 2013-01-04 20:02:01 +01:00
README.md Update README because vmg is @vmg. 2012-10-19 14:05:55 -07:00
valgrind-supp-mac.txt Extend valgrind suppressions on Mac 2013-05-14 16:39:19 -07: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_CLAR=ON build/
    
  • Test:

      ./build/libgit2_clar
    
  • Make sure everything is fine.

  • Send your pull request. That's it.