git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC PATCH] Makefile: new prove target for running the tests with TAP
Date: Thu, 14 Oct 2010 09:33:11 +0000	[thread overview]
Message-ID: <AANLkTinDq4FOZd7v5C8HZ7S81xoO6nJZTEe4+-9AO8HQ@mail.gmail.com> (raw)
In-Reply-To: <4CB6CB97.7040009@drmicha.warpmail.net>

On Thu, Oct 14, 2010 at 09:21, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Ævar Arnfjörð Bjarmason venit, vidit, dixit 14.10.2010 11:05:
>> On Thu, Oct 14, 2010 at 08:53, Michael J Gruber
>> <git@drmicha.warpmail.net> wrote:
>>> 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."
>>
>
> Sorry for the kind of dupe then. Though I can understand that the fixed
> options back then didn't find Junio's approval. Maybe it's different
> now, when it's completely interchangeable with make test?

Maybe. I try not to decipher him too much :)

But a patch for this that'd be acceptable would be great. Good that
you're working on it.

>> 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.
>
> Didn't know about that one either. What does t/harness
> differently/better from/than prove? Does it take the same options? Is
> t/harness respecting the SHELL_PATH for the tests? Running a test under
> make test and make prove/harness needs to be completely equivalent.

t/harness is just using the library that prove(1) uses directly. We
already use it for "make smoke". The advantage is that you can run
custom setup code there, e.g. this is from perl.git's own t/harness:

    my $jobs = $ENV{TEST_JOBS};
    my ($rules, $state, $color);
    if ($ENV{HARNESS_OPTIONS}) {
        for my $opt ( split /:/, $ENV{HARNESS_OPTIONS} ) {
            if ( $opt =~ /^j(\d*)$/ ) {
                $jobs ||= $1 || 9;
            }
            elsif ( $opt eq 'c' ) {
                $color = 1;
            }
            else {
                die "Unknown HARNESS_OPTIONS item: $opt\n";
            }
        }
    }

So if we expanded t/harness to use that and added a "test_harness"
target we could make it grok the TEST_JOBS and HARNESS_OPTIONS
environment variables.

The output would be the same (see "make smoke"), and we can make it
respect SHELL_PATH.

  reply	other threads:[~2010-10-14  9:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14  8:53 [RFC PATCH] Makefile: new prove target for running the tests with TAP Michael J Gruber
2010-10-14  9:05 ` Ævar Arnfjörð Bjarmason
2010-10-14  9:21   ` Michael J Gruber
2010-10-14  9:33     ` Ævar Arnfjörð Bjarmason [this message]
2010-10-14 16:27 ` Jonathan Nieder
2010-10-14 17:23 ` Jeff King
2010-10-27  0:18   ` Junio C Hamano
2010-10-27  4:57     ` Jeff King
2010-10-27 11:00       ` Ævar Arnfjörð Bjarmason
2010-10-29 13:19         ` Michael J Gruber

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=AANLkTinDq4FOZd7v5C8HZ7S81xoO6nJZTEe4+-9AO8HQ@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).