Re: [PATCH] NO_PERL support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Freitag, 3. April 2009, Jeff King wrote:
> On Fri, Apr 03, 2009 at 12:03:50AM -0700, Robin H. Johnson wrote:
> > +if test -n "$NO_PERL"
> > +then
> > +	test_expect_success 'skipping git-svn tests, NO_PERL defined' :
> > +	test_done
> > +	exit
> > +fi
>
> This probably got copied from an older example, but I think the
> recommended way to skip tests these days is to use 'say' instead of
> test_expect_success (since we have statistics on passing/failing tests
> now).
>
> Also, it may make sense to integrate this with Johannes Sixt's
> test_have_prereq work (which is still in next), but I haven't looked too
> closely at that.

If you base the patch on 'master', you can add this line to test-lib.sh

test -z "$NO_PERL" && test_set_prereq PERL

[But actually, if I read you patch correctly, NO_PERL will be set in 
t/Makefile only if one runs 'make test' from the main directory. You should 
invent some method to detect missing perl (or that NO_PERL was set) if 'make' 
is run directly from t/.]

Now you write the above as

if ! test_have_prereq PERL
then
	say 'perl not available - skipping git-svn tests'
	test_done
	exit
fi

Furthermore, you can skip single tests like this:

> > -test_expect_success \
> > +[ -z "$NO_PERL" ] && test_expect_success \

test_expect_success PERL \

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux