git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] Makefile: new prove target for running the tests with TAP

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 14, 2010, 09:05 UTC
Message-ID
<AANLkTimuoanpbFbyv9C8qUbut22me1gMhH02eLqg0Nyd@mail.gmail.com>
In-Reply-To
<5c46df95f93b56aa2fce56c7efe7b2be80642c8b.1287045908.git.git@drmicha.warpmail.net>

On Thu, Oct 14, 2010 at 08:53, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 22 quoted lines
> Introduce a new make target "prove" which runs the tests via "prove" (or
> $(PROVE) if set) so that one does not have to cd around any more. One
> can simply use "make prove" for "make test" or go wild as in:
>
> GIT_SKIP_TESTS='t[0-4]??? t91?? t9200.8' GIT_PROVE_OPTS="-j9 -v" GIT_TEST_OPTS="--verbose --debug" make prove
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> RFC also because of lack of doc, and:
>
> Currently, one can do
>
> make -C t t6010-merge-base.sh
>
> or even
>
> make -C t t601*
>
> which is cool but undocumented. If we want this with prove it requires more
> effort, or shoving prove into the $(T) target rule which is doable, of course.
> I'm just wondering whether it's accepted to introduce a specific rule for prove
> at all.

I like the rationale behind this, but fwiw. I already had a patch that was ejected for this:

    http://article.gmane.org/gmane.comp.version-control.git/146566
Quoth Junio:
    "Besides, "make -j15 test" from the toplevel already runs the
    tests in parallel.  I don't see much point in this change."

But I'd like to have it so that I could `make && make test_harness` and get readable test output.

But we should probably be using t/harness to run them, not prove(1). Then we would make the test_harness target respect the HARNESS_OPTIONS variable, which I e.g. have set to HARNESS_OPTIONS=j9 on my system.

Show 46 quoted lines
>
>  Makefile   |    3 +++
>  t/Makefile |    5 +++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 1f1ce04..3478515 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2046,6 +2046,9 @@ export NO_SVN_TESTS
>  test: all
>        $(MAKE) -C t/ all
>
> +prove: all
> +       $(MAKE) -C t/ prove
> +
>  test-ctype$X: ctype.o
>
>  test-date$X: date.o ctype.o
> diff --git a/t/Makefile b/t/Makefile
> index c7baefb..e4661c0 100644
> --- a/t/Makefile
> +++ b/t/Makefile
> @@ -11,6 +11,7 @@ SHELL_PATH ?= $(SHELL)
>  PERL_PATH ?= /usr/bin/perl
>  TAR ?= $(TAR)
>  RM ?= rm -f
> +PROVE ?= prove
>
>  # Shell quote;
>  SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
> @@ -21,6 +22,10 @@ TSVN = $(wildcard t91[0-9][0-9]-*.sh)
>  all: pre-clean
>        $(MAKE) aggregate-results-and-cleanup
>
> +prove: pre-clean
> +       @echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
> +       $(MAKE) clean
> +
>  $(T):
>        @echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
>
> --
> 1.7.3.1.184.g5b1fd
>
>
Previous: Michael J GruberNext: Michael J Gruber
Message 2 of 10 in “Makefile: new prove target for running the tests with TAP”
  1. Makefile: new prove target for running the tests with TAPMichael J Gruber, Oct 14, 2010
  2. Ævar Arnfjörð BjarmasonOct 14, 2010
  3. Michael J GruberOct 14, 2010
  4. Ævar Arnfjörð BjarmasonOct 14, 2010
  5. Jonathan NiederOct 14, 2010
  6. Jeff KingOct 14, 2010
  7. Junio C HamanoOct 27, 2010
  8. Jeff KingOct 27, 2010
  9. Ævar Arnfjörð BjarmasonOct 27, 2010
  10. Michael J GruberOct 29, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.