diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-11-24 15:51:49 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-24 15:51:49 -0800 |
commit | b3ff808b714fd8fc5e4d2770720398e5dc7d27f9 (patch) | |
tree | 3db88ef171d6fcae53d0edf714fb280134be3baf /t/README | |
parent | Merge branch 'maint' (diff) | |
parent | t4124 (apply --whitespace): use test_might_fail (diff) | |
download | tgif-b3ff808b714fd8fc5e4d2770720398e5dc7d27f9.tar.xz |
Merge branch 'en/and-cascade-tests'
* en/and-cascade-tests: (25 commits)
t4124 (apply --whitespace): use test_might_fail
t3404: do not use 'describe' to implement test_cmp_rev
t3404 (rebase -i): introduce helper to check position of HEAD
t3404 (rebase -i): move comment to description
t3404 (rebase -i): unroll test_commit loops
t3301 (notes): use test_expect_code for clarity
t1400 (update-ref): use test_must_fail
t1502 (rev-parse --parseopt): test exit code from "-h"
t6022 (renaming merge): chain test commands with &&
test-lib: introduce test_line_count to measure files
tests: add missing &&, batch 2
tests: add missing &&
Introduce sane_unset and use it to ensure proper && chaining
t7800 (difftool): add missing &&
t7601 (merge-pull-config): add missing &&
t7001 (mv): add missing &&
t6016 (rev-list-graph-simplify-history): add missing &&
t5602 (clone-remote-exec): add missing &&
t4026 (color): remove unneeded and unchained command
t4019 (diff-wserror): add lots of missing &&
...
Conflicts:
t/t7006-pager.sh
Diffstat (limited to 't/README')
-rw-r--r-- | t/README | 33 |
1 files changed, 18 insertions, 15 deletions
@@ -265,14 +265,11 @@ Do: test ... That way all of the commands in your tests will succeed or fail. If - you must ignore the return value of something (e.g., the return - after unsetting a variable that was already unset is unportable) it's - best to indicate so explicitly with a semicolon: - - unset HLAGH; - git merge hla && - git push gh && - test ... + you must ignore the return value of something, consider using a + helper function (e.g. use sane_unset instead of unset, in order + to avoid unportable return value for unsetting a variable that was + already unset), or prepending the command with test_might_fail or + test_must_fail. - Check the test coverage for your tests. See the "Test coverage" below. @@ -401,13 +398,6 @@ library for your script to use. Like test_expect_success this function can optionally use a three argument invocation with a prerequisite as the first argument. - - test_expect_code [<prereq>] <code> <message> <script> - - Analogous to test_expect_success, but pass the test if it exits - with a given exit <code> - - test_expect_code 1 'Merge with d/f conflicts' 'git merge "merge msg" B master' - - test_debug <script> This takes a single argument, <script>, and evaluates it only @@ -488,6 +478,15 @@ library for your script to use. 'Perl API' \ "$PERL_PATH" "$TEST_DIRECTORY"/t9700/test.pl + - test_expect_code <exit-code> <command> + + Run a command and ensure that it exits with the given exit code. + For example: + + test_expect_success 'Merge with d/f conflicts' ' + test_expect_code 1 git merge "merge msg" B master + ' + - test_must_fail <git-command> Run a git command and ensure it fails in a controlled way. Use @@ -507,6 +506,10 @@ library for your script to use. <expected> file. This behaves like "cmp" but produces more helpful output when the test is run with "-v" option. + - test_line_count (= | -lt | -ge | ...) <length> <file> + + Check whether a file has the length it is expected to. + - test_path_is_file <file> [<diagnosis>] test_path_is_dir <dir> [<diagnosis>] test_path_is_missing <path> [<diagnosis>] |