summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-06-25test-lib: output a newline before "ok" under a TAP harnessLibravatar Ævar Arnfjörð Bjarmason1-0/+3
Some tests in the testsuite will emit a line that doesn't end with a newline, right before we're about to output "ok" or "not ok". This breaks the TAP output with "Tests out of sequence" errors since a TAP harness can't understand this: ok 1 - A test [some output here]ok 2 - Another test ok 3 - Yet another test Work around it by emitting an empty line before we're about to say "ok" or "not ok", but only if we're running under --verbose and HARNESS_ACTIVE=1 is set, which'll only be the case when running under a harnesses like prove(1). I think it's better to do this than fix each tests by adding `&& echo' everywhere. More tests might be added that break TAP in the future, and a human isn't going to look at the extra whitespace, since HARNESS_ACTIVE=1 always means a harness is reading it. The tests that had issues were: t1007, t3410, t3413, t3409, t3414, t3415, t3416, t3412, t3404, t5407, t7402, t7003, t9001 With this workaround the entire test suite runs without errors under: prove -j 10 ./t[0-9]*.sh :: --verbose Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-25test-lib: Make the test_external_* functions TAP-awareLibravatar Ævar Arnfjörð Bjarmason3-12/+53
Before TAP we just ran the Perl test and assumed that it failed if nothing was printed on STDERR. Continue doing that, but introduce a `test_external_has_tap' variable which tests can set to indicate that they're outputting TAP. If it's set we won't output a test plan, but trust the external test to do so. That way we can make external tests work with a TAP harness, but still maintain compatibility with test-lib's own way of tracking tests through the test-results directory. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-25test-lib: Adjust output to be valid TAP formatLibravatar Ævar Arnfjörð Bjarmason2-30/+59
TAP, the Test Anything Protocol, is a simple text-based interface between testing modules in a test harness. test-lib.sh's output was already very close to being valid TAP. This change brings it all the way there. Before: $ ./t0005-signals.sh * ok 1: sigchain works * passed all 1 test(s) And after: $ ./t0005-signals.sh ok 1 - sigchain works # passed all 1 test(s) 1..1 The advantage of using TAP is that any program that reads the format (a "test harness") can run the tests. The most popular of these is the prove(1) utility that comes with Perl. It can run tests in parallel, display colored output, format the output to console, file, HTML etc., and much more. An example: $ prove ./t0005-signals.sh ./t0005-signals.sh .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.01 cusr 0.02 csys = 0.06 CPU) Result: PASS prove(1) gives you human readable output without being too verbose. Running the test suite in parallel with `make test -j15` produces a flood of text. Running them with `prove -j 15 ./t[0-9]*.sh` makes it easy to follow what's going on. All this patch does is re-arrange the output a bit so that it conforms with the TAP spec, everything that the test suite did before continues to work. That includes aggregating results in t/test-results/, the --verbose, --debug and other options for tests, and the test color output. TAP harnesses ignore everything that they don't know about, so running the tests with --verbose works: $ prove ./t0005-signals.sh :: --verbose --debug ./t0005-signals.sh .. Terminated ./t0005-signals.sh .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.01 cusr 0.01 csys = 0.05 CPU) Result: PASS Just supply the -v option to prove itself to get all the verbose output that it suppresses: $ prove -v ./t0005-signals.sh :: --verbose --debug ./t0005-signals.sh .. Initialized empty Git repository in /home/avar/g/git/t/trash directory.t0005-signals/.git/ expecting success: test-sigchain >actual case "$?" in 143) true ;; # POSIX w/ SIGTERM=15 3) true ;; # Windows *) false ;; esac && test_cmp expect actual Terminated ok 1 - sigchain works # passed all 1 test(s) 1..1 ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.01 cusr 0.01 csys = 0.04 CPU) Result: PASS As a further example, consider this test script that uses a lot of test-lib.sh features by Jakub Narebski: #!/bin/sh test_description='this is a sample test. This test is here to see various test outputs.' . ./test-lib.sh say 'diagnostic message' test_expect_success 'true test' 'true' test_expect_success 'false test' 'false' test_expect_failure 'true test (todo)' 'true' test_expect_failure 'false test (todo)' 'false' test_debug 'echo "debug message"' test_done The output of that was previously: * diagnostic message # yellow * ok 1: true test * FAIL 2: false test # bold red false * FIXED 3: true test (todo) * still broken 4: false test (todo) # bold green * fixed 1 known breakage(s) # green * still have 1 known breakage(s) # bold red * failed 1 among remaining 3 test(s) # bold red But is now: diagnostic message # yellow ok 1 - true test not ok - 2 false test # bold red # false ok 3 - true test (todo) # TODO known breakage not ok 4 - false test (todo) # TODO known breakage # bold green # fixed 1 known breakage(s) # green # still have 1 known breakage(s) # bold red # failed 1 among remaining 3 test(s) # bold red 1..4 All the coloring is preserved when the test is run manually. Under prove(1) the test performs as expected, even with --debug and --verbose options: $ prove ./example.sh :: --debug --verbose ./example.sh .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- ./example.sh (Wstat: 256 Tests: 4 Failed: 1) Failed test: 2 TODO passed: 3 Non-zero exit status: 1 Files=1, Tests=4, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.01 csys = 0.03 CPU) Result: FAIL The TAP harness itself doesn't get confused by the color output, they aren't used by test-lib.sh stdout isn't open to a terminal (test -t 1). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-23Merge branch 'jk/url-decode'Libravatar Junio C Hamano1-10/+18
* jk/url-decode: url.c: "<scheme>://" part at the beginning should not be URL decoded
2010-06-23url.c: "<scheme>://" part at the beginning should not be URL decodedLibravatar Junio C Hamano1-10/+18
When using the protocol git+ssh:// for example we do not want to decode the '+' as a space. The url decoding must take place only for the server name and parameters. This fixes a regression introduced in 9d2e942. Initial-fix-by: Pascal Obry <pascal.obry@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-22Update draft release notes to 1.7.2Libravatar Junio C Hamano1-12/+41
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-22Merge branch 'jc/maint-simpler-common-prefix'Libravatar Junio C Hamano1-13/+13
* jc/maint-simpler-common-prefix: common_prefix: simplify and fix scanning for prefixes
2010-06-22Merge branch 'sb/format-patch-signature'Libravatar Junio C Hamano6-4/+85
* sb/format-patch-signature: completion: Add --signature and format.signature format-patch: Add a signature option (--signature)
2010-06-22Merge branch 'mg/pretty-magic-space'Libravatar Junio C Hamano3-4/+25
* mg/pretty-magic-space: pretty: Introduce ' ' modifier to add space if non-empty Conflicts: pretty.c
2010-06-22Merge branch 'jn/gitweb-return-or-exit-cleanup'Libravatar Junio C Hamano1-0/+9
* jn/gitweb-return-or-exit-cleanup: gitweb: Return or exit after done serving request Conflicts: gitweb/gitweb.perl
2010-06-22Merge branch 'bd/maint-unpack-trees-parawalk-fix'Libravatar Junio C Hamano1-2/+10
* bd/maint-unpack-trees-parawalk-fix: unpack-trees: Make index lookahead less pessimal
2010-06-22Merge branch 'cc/cherry-pick-series'Libravatar Junio C Hamano4-66/+264
* cc/cherry-pick-series: Documentation/revert: describe passing more than one commit Documentation/cherry-pick: describe passing more than one commit revert: add tests to check cherry-picking many commits revert: allow cherry-picking more than one commit revert: change help_msg() to take no argument revert: refactor code into a do_pick_commit() function revert: use run_command_v_opt() instead of execv_git_cmd() revert: cleanup code for -x option
2010-06-22Merge branch 'jc/rev-list-ancestry-path'Libravatar Junio C Hamano4-3/+226
* jc/rev-list-ancestry-path: revision: Turn off history simplification in --ancestry-path mode revision: Fix typo in --ancestry-path error message Documentation/rev-list-options.txt: Explain --ancestry-path Documentation/rev-list-options.txt: Fix missing line in example history graph revision: --ancestry-path
2010-06-22Merge branch 'lt/extended-sha1-match-commit-with-regexp'Libravatar Junio C Hamano1-3/+9
* lt/extended-sha1-match-commit-with-regexp: Make :/ accept a regex rather than a fixed pattern
2010-06-22Merge branch 'maint'Libravatar Junio C Hamano4-4/+24
* maint: Update draft release notes to 1.7.1.1 tests: remove unnecessary '^' from 'expr' regular expression Conflicts: diff.c
2010-06-22Update draft release notes to 1.7.1.1Libravatar Junio C Hamano1-0/+21
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-22Merge branch 'ic/maint-rebase-i-abort' into maintLibravatar Junio C Hamano2-1/+12
* ic/maint-rebase-i-abort: rebase -i: Abort cleanly if new base cannot be checked out
2010-06-22Merge branch 'cc/maint-commit-reflog-msg' into maintLibravatar Junio C Hamano2-6/+13
* cc/maint-commit-reflog-msg: commit: use value of GIT_REFLOG_ACTION env variable as reflog message
2010-06-22Merge branch 'jk/maint-advice-empty-amend' into maintLibravatar Junio C Hamano1-0/+7
* jk/maint-advice-empty-amend: commit: give advice on empty amend
2010-06-22Merge branch 'tc/commit-abbrev-fix' into maintLibravatar Junio C Hamano2-6/+72
* tc/commit-abbrev-fix: commit::print_summary(): don't use format_commit_message() t7502-commit: add summary output tests for empty and merge commits t7502-commit: add tests for summary output
2010-06-22Merge branch 'jn/document-rebase-i-p-limitation' into maintLibravatar Junio C Hamano2-0/+33
* jn/document-rebase-i-p-limitation: rebase -i -p: document shortcomings
2010-06-22Merge branch 'jn/checkout-doc' into maintLibravatar Junio C Hamano1-23/+31
* jn/checkout-doc: Documentation/checkout: clarify description Documentation/checkout: clarify description
2010-06-22Merge branch 'cc/maint-diff-CC-binary' into maintLibravatar Junio C Hamano3-5/+98
* cc/maint-diff-CC-binary: diff: fix "git show -C -C" output when renaming a binary file Conflicts: diff.c
2010-06-22Merge branch 'jc/t9129-any-utf8' into maintLibravatar Junio C Hamano1-7/+13
* jc/t9129-any-utf8: t9129: fix UTF-8 locale detection
2010-06-22Merge branch 'cb/ls-files-cdup' into maintLibravatar Junio C Hamano4-71/+110
* cb/ls-files-cdup: ls-files: allow relative pathspec quote.c: separate quoting and relative path generation
2010-06-22Merge branch 'tc/merge-m-log' into maintLibravatar Junio C Hamano5-41/+87
* tc/merge-m-log: merge: --log appends shortlog to message if specified fmt-merge-msg: add function to append shortlog only fmt-merge-msg: refactor merge title formatting fmt-merge-msg: minor refactor of fmt_merge_msg() merge: rename variable merge: update comment t7604-merge-custom-message: show that --log doesn't append to -m t7604-merge-custom-message: shift expected output creation
2010-06-22Merge branch 'ph/clone-message-reword' into maintLibravatar Junio C Hamano1-1/+2
* ph/clone-message-reword: clone: reword messages to match the end-user perception
2010-06-22Merge branch 'jn/maint-amend-missing-name' into maintLibravatar Junio C Hamano2-7/+59
* jn/maint-amend-missing-name: commit --amend: cope with missing display name
2010-06-22Merge branch 'pc/remove-warn' into maintLibravatar Junio C Hamano6-21/+68
* pc/remove-warn: Remove a redundant errno test in a usage of remove_path Introduce remove_or_warn function Implement the rmdir_or_warn function Generalise the unlink_or_warn function
2010-06-21tests: remove unnecessary '^' from 'expr' regular expressionLibravatar Junio C Hamano2-3/+3
As Brandon noticed, a regular expression match given to 'expr' is already anchored at the beginning. Some versions of expr even complain about this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-21Merge branch 'js/maint-receive-pack-symref-alias'Libravatar Junio C Hamano0-0/+0
* js/maint-receive-pack-symref-alias:
2010-06-21Merge branch 'cc/maint-commit-reflog-msg'Libravatar Junio C Hamano2-6/+13
* cc/maint-commit-reflog-msg: commit: use value of GIT_REFLOG_ACTION env variable as reflog message
2010-06-21Merge branch 'ic/maint-rebase-i-abort'Libravatar Junio C Hamano2-1/+12
* ic/maint-rebase-i-abort: rebase -i: Abort cleanly if new base cannot be checked out
2010-06-21Merge branch 'jk/maint-advice-empty-amend'Libravatar Junio C Hamano1-0/+7
* jk/maint-advice-empty-amend: commit: give advice on empty amend
2010-06-21Merge branch 'eb/core-eol'Libravatar Junio C Hamano12-110/+570
* eb/core-eol: Add "core.eol" config variable Rename the "crlf" attribute "text" Add per-repository eol normalization Add tests for per-repository eol normalization Conflicts: Documentation/config.txt Makefile
2010-06-21Merge branch 'fg/autocrlf'Libravatar Junio C Hamano2-0/+101
* fg/autocrlf: autocrlf: Make it work also for un-normalized repositories
2010-06-21Merge branch 'sm/branch-broken-ref'Libravatar Junio C Hamano1-6/+22
* sm/branch-broken-ref: branch: don't fail listing branches if one of the commits wasn't found branch: exit status now reflects if branch listing finds an error
2010-06-21Merge branch 'rr/parse-date-refactor'Libravatar Junio C Hamano1-19/+37
* rr/parse-date-refactor: Refactor parse_date for approxidate functions
2010-06-21Merge branch 'jn/document-rebase-i-p-limitation'Libravatar Junio C Hamano2-0/+33
* jn/document-rebase-i-p-limitation: rebase -i -p: document shortcomings
2010-06-21Merge branch 'tc/commit-abbrev-fix'Libravatar Junio C Hamano2-6/+72
* tc/commit-abbrev-fix: commit::print_summary(): don't use format_commit_message() t7502-commit: add summary output tests for empty and merge commits t7502-commit: add tests for summary output
2010-06-21Merge branch 'tr/receive-pack-aliased-update-fix'Libravatar Junio C Hamano1-2/+2
* tr/receive-pack-aliased-update-fix: check_aliased_update: strcpy() instead of strcat() to copy
2010-06-21Merge branch 'gs/usage-to-stdout'Libravatar Junio C Hamano5-43/+61
* gs/usage-to-stdout: parseopt: wrap rev-parse --parseopt usage for eval consumption print the usage string on stdout instead of stderr Conflicts: parse-options.h
2010-06-21Merge branch 'js/async-thread'Libravatar Junio C Hamano10-41/+117
* js/async-thread: fast-import: die_nicely() back to vsnprintf (reverts part of ebaa79f) Enable threaded async procedures whenever pthreads is available Dying in an async procedure should only exit the thread, not the process. Reimplement async procedures using pthreads Windows: more pthreads functions Fix signature of fcntl() compatibility dummy Make report() from usage.c public as vreportf() and use it. Modernize t5530-upload-pack-error. Conflicts: http-backend.c
2010-06-21Merge branch 'gv/portable'Libravatar Junio C Hamano65-162/+378
* gv/portable: test-lib: use DIFF definition from GIT-BUILD-OPTIONS build: propagate $DIFF to scripts Makefile: Tru64 portability fix Makefile: HP-UX 10.20 portability fixes Makefile: HPUX11 portability fixes Makefile: SunOS 5.6 portability fix inline declaration does not work on AIX Allow disabling "inline" Some platforms lack socklen_t type Make NO_{INET_NTOP,INET_PTON} configured independently Makefile: some platforms do not have hstrerror anywhere git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition test_cmp: do not use "diff -u" on platforms that lack one fixup: do not unconditionally disable "diff -u" tests: use "test_cmp", not "diff", when verifying the result Do not use "diff" found on PATH while building and installing enums: omit trailing comma for portability Makefile: -lpthread may still be necessary when libc has only pthread stubs Rewrite dynamic structure initializations to runtime assignment Makefile: pass CPPFLAGS through to fllow customization Conflicts: Makefile wt-status.h
2010-06-21Merge branch 'bc/portable'Libravatar Junio C Hamano12-28/+63
* bc/portable: Remove python 2.5'isms Makefile: add PYTHON_PATH to GIT-BUILD-OPTIONS t/aggregate-results: accomodate systems with small max argument list length t/t7006: ignore return status of shell's unset builtin t/t5150: remove space from sed script git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh t/t5800: skip if python version is older than 2.5
2010-06-21Merge branch 'jn/gitweb-fastcgi'Libravatar Junio C Hamano1-152/+258
* jn/gitweb-fastcgi: gitweb: Run in FastCGI mode if gitweb script has .fcgi extension gitweb: Add support for FastCGI, using CGI::Fast gitweb: Put all per-connection code in run() subroutine
2010-06-21Merge branch 'jn/checkout-doc'Libravatar Junio C Hamano1-23/+31
* jn/checkout-doc: Documentation/checkout: clarify description Documentation/checkout: clarify description
2010-06-21Merge branch 'em/checkout-orphan'Libravatar Junio C Hamano7-60/+168
* em/checkout-orphan: log_ref_setup: don't return stack-allocated array bash completion: add --orphan to 'git checkout' t3200: test -l with core.logAllRefUpdates options checkout --orphan: respect -l option always refs: split log_ref_write logic into log_ref_setup Documentation: alter checkout --orphan description
2010-06-21Drop items that are 1.7.1.1 fixes from the 1.7.1 release notesLibravatar Junio C Hamano1-21/+0
2010-06-21Merge branch 'maint'Libravatar Junio C Hamano1-0/+21
* maint: Update draft release notes to 1.7.1.1