libgit2/tests-clar
Russell Belfer 41a82592ef Ranged iterators and rewritten git_status_file
The goal of this work is to rewrite git_status_file to use the
same underlying code as git_status_foreach.

This is done in 3 phases:

1. Extend iterators to allow ranged iteration with start and
   end prefixes for the range of file names to be covered.
2. Improve diff so that when there is a pathspec and there is
   a common non-wildcard prefix of the pathspec, it will use
   ranged iterators to minimize excess iteration.
3. Rewrite git_status_file to call git_status_foreach_ext
   with a pathspec that covers just the one file being checked.

Since ranged iterators underlie the status & diff implementation,
this is actually fairly efficient.  The workdir iterator does
end up loading the contents of all the directories down to the
single file, which should ideally be avoided, but it is pretty
good.
2012-05-15 14:34:15 -07:00
..
attr Support reading attributes from index 2012-05-03 16:37:25 -07:00
buf Update test suite 2012-05-02 16:14:30 -07:00
commit tests-clar/commit: fix memory leaks 2012-04-03 11:07:04 +02:00
config Update test suite 2012-05-02 16:14:30 -07:00
core Ranged iterators and rewritten git_status_file 2012-05-15 14:34:15 -07:00
diff Ranged iterators and rewritten git_status_file 2012-05-15 14:34:15 -07:00
index Update test suite 2012-05-02 16:14:30 -07:00
network remotes: change git_remote_new's signature 2012-05-08 21:36:40 +02:00
notes Fix compilation warnings 2012-05-14 22:24:58 +02:00
object tests: make sure we clean up in objects/blob/write.c 2012-05-13 11:28:49 +02:00
odb Handle duplicate objects from different backends in git_odb_read_prefix(). 2012-05-12 15:50:19 -03:00
refs Merge pull request #693 from nulltoken/topic/enhance_branch_move_test_coverage 2012-05-14 11:25:55 -07:00
repo Fixed leaks and added tests 2012-05-11 12:16:19 -07:00
resources Handle duplicate objects from different backends in git_odb_read_prefix(). 2012-05-12 15:50:19 -03:00
revwalk mergebase: enhance test code coverage 2012-05-13 14:14:08 +02:00
status Ranged iterators and rewritten git_status_file 2012-05-15 14:34:15 -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 compat: make p_open able to accept optional mode when passing the O_CREAT flag 2012-05-07 12:18:54 +02:00
clar_libgit2.h clar helper: don't dereference giterr_last() if it's NULL 2012-05-07 11:29:10 +02: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.