libgit2/tests
Carlos Martín Nieto 217c029b54 commit: safer commit creation with reference update
The current version of the commit creation and amend function are unsafe
to use when passing the update_ref parameter, as they do not check that
the reference at the moment of update points to what the user expects.

Make sure that we're moving history forward when we ask the library to
update the reference for us by checking that the first parent of the new
commit is the current value of the reference. We also make sure that the
ref we're updating hasn't moved between the read and the write.

Similarly, when amending a commit, make sure that the current tip of the
branch is the commit we're amending.
2014-04-30 00:41:37 +02:00
..
attr Preload attribute files that may contain macros 2014-04-18 14:29:58 -07:00
blame Clar: skip tests 2014-04-02 18:50:47 +02:00
buf Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
checkout git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
cherrypick Added cherry pick tests 2014-04-14 16:16:22 +02:00
clar Clar: skip tests 2014-04-02 18:50:47 +02:00
clone remote: write tests for cloning from an empty repo 2014-04-02 20:22:22 +02:00
commit commit: safer commit creation with reference update 2014-04-30 00:41:37 +02:00
config Remove converting user error to GIT_EUSER 2013-12-11 10:57:49 -08:00
core Merge pull request #2291 from ethomson/patch_binary 2014-04-23 09:27:15 -07:00
date Added RFC2822 date format test cases 2014-04-11 21:55:36 +02:00
diff Merge pull request #2291 from ethomson/patch_binary 2014-04-23 09:27:15 -07:00
fetchhead fetchhead: deal with quotes in branch names 2014-04-24 14:08:29 +02:00
filter Introduce core.safecrlf handling 2014-04-07 21:09:09 -07:00
graph Added a no path test for git_graph_descendant_of 2014-04-08 16:32:06 +02:00
index Some vector utility tweaks 2014-04-17 14:43:45 -07:00
merge merge: checkout default shouldn't clobber given 2014-04-23 19:43:35 -04:00
network remote: rename inmemory to anonymous and swap url and fetch order 2014-04-01 13:38:04 +02:00
notes note: rename the id getter to git_note_id() 2014-01-24 11:18:51 +01:00
object commit: safer commit creation with reference update 2014-04-30 00:41:37 +02:00
odb Fix a number of git_odb_exists_prefix bugs 2014-03-10 11:34:50 -07:00
online Verify update_tips callbacks in push test cases 2014-04-21 19:38:34 +02:00
pack Test cancel from indexer progress callback 2013-12-11 15:02:20 -08:00
refs Add GIT_BRANCH_ALL to git_branch_t enum 2014-04-16 18:51:16 +02:00
repo Correct C90 warnings 2014-04-11 22:48:42 +02:00
reset Reset tests: Use sandboxed index 2014-04-25 15:49:58 +02:00
resources Merge pull request #2261 from jacquesg/format-patch 2014-04-16 19:09:35 +02:00
revert Capture conflict information in MERGE_MSG for revert and merge 2014-04-14 16:16:22 +02:00
revwalk No need to find merge base. 2014-03-31 15:15:32 -07:00
stash Make checkout match diff for untracked/ignored dir 2014-04-22 21:51:54 -07:00
status Improve docs for status rename detection limits 2014-04-24 15:40:50 -07:00
stress Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
structinit Update git_merge_tree_opts to git_merge_options 2014-03-20 09:25:08 -07:00
submodule Test (and fix) the git_submodule_sync changes 2014-04-03 11:58:51 -07:00
threads Some memory leak fixes 2014-04-17 15:04:42 -07:00
trace Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
clar_libgit2.c Win32: UTF-8 <-> WCHAR conversion overhaul 2014-04-19 21:50:44 -04:00
clar_libgit2.h Handle win32 reparse points properly 2014-04-22 00:28:27 -04: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 Sandbox configuration during test runs 2014-03-28 10:39:15 -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.