libgit2/tests
Carlos Martín Nieto e1ac010148 odb: hardcode the empty blob and tree
git hardocodes these as objects which exist regardless of whether they
are in the odb and uses them in the shell interface as a way of
expressing the lack of a blob or tree for one side of e.g. a diff.

In the library we use each language's natural way of declaring a lack of
value which makes a workaround like this unnecessary. Since git uses it,
it does however mean each shell application would need to perform this
check themselves.

This makes it common work across a range of applications and an issue
with compatibility with git, which fits right into what the library aims
to provide.

Thus we introduce the hard-coded empty blob and tree in the odb
frontend. These hard-coded objects are checked for before going to the
backends, but after the cache check, which means the second time they're
used, they will be treated as normal cached objects instead of creating
new ones.
2014-11-08 20:53:38 +01:00
..
attr attr: Add an extra test for files under a subfolder 2014-09-17 15:08:16 +02:00
blame Factor 40 and 41 constants from source. 2014-09-16 13:07:04 +02:00
buf Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
checkout checkout_index: Remove stage 0 when checking out conflicts 2014-11-06 18:50:10 -05:00
cherrypick Fix test build 2014-10-10 18:03:09 +02:00
clar clar: use a custom temp directory name 2014-10-24 10:50:57 -04:00
clone clone::local test: isalpha -> git__isalpha 2014-10-26 22:27:50 -04:00
commit signature: don't allow empty emails 2014-09-10 18:14:46 +02:00
config Clean up issues include.path issues found during code review. 2014-11-02 19:16:49 -06:00
core hashsig: Export as a sys header 2014-10-01 12:03:24 +02:00
date Added RFC2822 date format test cases 2014-04-11 21:55:36 +02:00
describe Don't use cl_git_pass for POSIX functions 2014-10-10 15:17:27 -07:00
diff iterator: submodules are determined by an index or tree 2014-11-07 08:33:27 +01:00
fetchhead remote: allow overriding the refspecs for download and fetch 2014-09-30 15:42:32 +02:00
filter Ignore core.safecrlf=warn until we have a warn infrastructure 2014-05-30 11:30:53 -05:00
graph Added a no path test for git_graph_descendant_of 2014-04-08 16:32:06 +02:00
index Clean up some memory leaks 2014-10-26 22:27:44 -04:00
merge s/git_merge_head/git_annotated_commit 2014-10-26 22:59:48 -04:00
network Merge pull request #2682 from libgit2/cmn/fetch-tags-refspec 2014-11-06 10:19:22 -05:00
notes Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
object Factor 40 and 41 constants from source. 2014-09-16 13:07:04 +02:00
odb odb: hardcode the empty blob and tree 2014-11-08 20:53:38 +01:00
online Merge pull request #2574 from csware/hostname-for-certificate_check_cb 2014-10-10 11:28:58 -04:00
pack Silence unused return value warning 2014-09-26 12:12:09 +02:00
path path: Fix git_path_walk_up to work with non-rooted paths 2014-09-17 15:00:12 +02:00
rebase s/git_merge_head/git_annotated_commit 2014-10-26 22:59:48 -04:00
refs transaction: rename lock() to lock_ref() 2014-10-09 16:29:30 +02:00
repo iterator: submodules are determined by an index or tree 2014-11-07 08:33:27 +01:00
reset Allow to propagate checkout callbacks to git HARD reset 2014-08-03 16:29:51 +02:00
resources revert tests: always use core.autocrlf=false in tests 2014-10-27 17:27:25 -04:00
revert revert tests: always use core.autocrlf=false in tests 2014-10-27 17:27:25 -04:00
revwalk revwalk::mergebase test: free memory 2014-10-26 22:27:58 -04:00
stash p_mkdir != mkdir on win32 2014-10-03 19:30:48 -04:00
status submodules: add failing test for stale module entries 2014-11-07 08:33:27 +01:00
stress Use p_snprintf also in tests 2014-08-05 20:51:59 +02:00
structinit Custom transport: minor cleanups 2014-08-14 08:52:20 -05:00
submodule iterator: submodules are determined by an index or tree 2014-11-07 08:33:27 +01:00
threads iterator: submodules are determined by an index or tree 2014-11-07 08:33:27 +01:00
trace Remove trace / add git_diff_perfdata struct + api 2014-05-02 09:21:33 -07:00
transport Clean up some leaks in the test suite 2014-09-17 03:19:40 +02:00
clar_libgit2.c Switch description and path reporting 2014-07-15 10:00:46 -04:00
clar_libgit2.h Use p_snprintf also in tests 2014-08-05 20:51:59 +02:00
clar.c Clar: skip tests 2014-04-02 18:50:47 +02:00
clar.h Clar: skip tests 2014-04-02 18:50:47 +02:00
generate.py Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
main.c Better search path sandboxing 2014-05-15 10:56:28 -07:00
README.md Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
valgrind-supp-mac.txt Test cancel from indexer progress callback 2013-12-11 15:02:20 -08: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.