libgit2/tests-clar
Vicent Martí c63793ee81 attr: Change the attribute check macros
The point of having `GIT_ATTR_TRUE` and `GIT_ATTR_FALSE` macros is to be
able to change the way that true and false values are stored inside of
the returned gitattributes value pointer.

However, if these macros are implemented as a simple rename for the
`git_attr__true` pointer, they will always be used with the `==`
operator, and hence we cannot really change the implementation to any
other way that doesn't imply using special pointer values and comparing
them!

We need to do the same thing that core Git does, which is using a
function macro. With `GIT_ATTR_TRUE(attr)`, we can change
internally the way that these values are stored to anything we want.

This commit does that, and rewrites a large chunk of the attributes test
suite to remove duplicated code for expected attributes, and to
properly test the function macro behavior instead of comparing
pointers.
2012-03-02 03:51:45 +01:00
..
attr attr: Change the attribute check macros 2012-03-02 03:51:45 +01:00
buf Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00
commit commit: actually allow yet to be born update_ref 2012-02-15 13:07:41 +01:00
config config: add more comprehensive multivar tests 2012-02-25 19:01:02 +01:00
core buffer: Unify git_fbuffer and git_buf 2012-02-27 05:30:07 +01:00
diff Fix workdir iterator unit tests 2012-02-23 11:17:48 -08:00
index Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00
network Add git_remote_list() 2012-02-26 19:15:36 +01:00
notes tests-clar/notes: init oid before using 2012-02-23 23:38:48 +01:00
object Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00
odb Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00
refs tests-clar: fix warning sign-compare 2012-02-13 12:13:05 +01:00
repo repository: ensure that the path to the .git directory ends with a forward slash when opening a repository through a working directory path 2012-02-03 12:46:50 +01:00
status Add unit tests for recent bug fixes 2012-02-01 12:30:35 -08:00
clar Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00
clar_helpers.c Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00
clar_libgit2.h Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08: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.