diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2009-01-27 23:34:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-28 20:16:37 -0800 |
commit | 008849689e04e774aa7b194cd690405761e2383a (patch) | |
tree | 31aa195fc15170994979b4a4f347f5c28d73a26a /t/README | |
parent | 03af0870a0e6d551a31eb830d5c2682b82ae0ac6 (diff) | |
download | git-008849689e04e774aa7b194cd690405761e2383a.tar.gz |
test-lib.sh: introduce test_commit() and test_merge() helpers
Often we just need to add a commit with a given (short) name, that will
be tagged with the same name. Now, relatively complicated graphs can be
constructed easily and in a clear fashion:
test_commit A &&
test_commit B &&
git checkout A &&
test_commit C &&
test_merge D B
will construct this graph:
A - B
\ \
C - D
For simplicity, files whose name is the lower case version of the commit
message (to avoid a warning about ambiguous names) will be committed, with
the corresponding commit messages as contents.
If you need to provide a different file/different contents, you can use
the more explicit form
test_commit $MESSAGE $FILENAME $CONTENTS
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/README')
-rw-r--r-- | t/README | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -212,6 +212,24 @@ library for your script to use. is to summarize successes and failures in the test script and exit with an appropriate error code. + - test_tick + + Make commit and tag names consistent by setting the author and + committer times to defined stated. Subsequent calls will + advance the times by a fixed amount. + + - test_commit <message> [<filename> [<contents>]] + + Creates a commit with the given message, committing the given + file with the given contents (default for both is to reuse the + message string), and adds a tag (again reusing the message + string as name). Calls test_tick to make the SHA-1s + reproducible. + + - test_merge <message> <commit-or-tag> + + Merges the given rev using the given message. Like test_commit, + creates a tag and calls test_tick before committing. Tips for Writing Tests ---------------------- |