git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v4 1/5] test-lib: Adjust output to be valid TAP format
Date: Thu, 24 Jun 2010 11:39:31 -0700 (PDT)	[thread overview]
Message-ID: <m3mxuknumn.fsf@localhost.localdomain> (raw)
In-Reply-To: <1277401489-27885-2-git-send-email-avarab@gmail.com>

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> 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

This is incomplete information.  It only tells us how the output is
changed for the case when all test_expect_success tests passes.  This
commit message doesn't tell us how failing tests looks like, and how
test_expect_failure results gets translated.

Take for example a following test script:
-- >8 --
#!/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
-- 8< --

This test script output looks like the following (the comments are not
part of output, but denote color of given line of test output):
----
* 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
----

How would the output of this test look like after TAP-ification?
Would it still provide color output when run on terminal?

This test also generates summary of test run in a file in
test-results/ subdirectory.  Currently such file can be e.g. named
test-results/test_test-8030, and consist of
-- >8 --
total 4
success 1
fixed 1
broken 1
failed 1

-- 8< --

Would TAP-ification change that?  Even if there is no change, this is
worth a sentence or a few words in a commit message.

P.S. With current output pass / fail results of test_expect_failure
are justified on ':' separator.  This is not the case of TAP output.
-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2010-06-24 18:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 17:44 [PATCH v4 0/5] TAP support for Git Ævar Arnfjörð Bjarmason
2010-06-24 17:44 ` [PATCH v4 1/5] test-lib: Adjust output to be valid TAP format Ævar Arnfjörð Bjarmason
2010-06-24 18:39   ` Jakub Narebski [this message]
2010-06-24 19:17     ` Ævar Arnfjörð Bjarmason
2010-06-24 21:52       ` [PATCH v5 " Ævar Arnfjörð Bjarmason
2010-06-25 17:21         ` Junio C Hamano
2010-06-25 21:24           ` Ævar Arnfjörð Bjarmason
2010-06-25 21:36             ` Junio C Hamano
2010-06-25 21:39               ` Ævar Arnfjörð Bjarmason
2010-06-24 17:44 ` [PATCH v4 2/5] test-lib: Make the test_external_* functions TAP-aware Ævar Arnfjörð Bjarmason
2010-06-24 17:44 ` [PATCH v4 3/5] test-lib: output a newline before "ok" under a TAP harness Ævar Arnfjörð Bjarmason
2010-06-24 17:44 ` [PATCH v4 4/5] tests: Skip tests in a way that makes sense under TAP Ævar Arnfjörð Bjarmason
2010-06-24 17:44 ` [PATCH v4 5/5] tests: Say "pass" rather than "ok" on empty lines for TAP Ævar Arnfjörð Bjarmason
2010-06-26 12:21 ` [PATCH] t9700: Use Test::More->builder, not $Test::Builder::Test Ævar Arnfjörð Bjarmason
2010-06-26 12:42   ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2010-06-27 18:27     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3mxuknumn.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).