develooper Front page | perl.perl5.porters | Postings from February 2003

Re: MakeMaker and TESTS => 't/*.t t/*/*.t'

Thread Previous | Thread Next
From:
Abe Timmerman
Date:
February 2, 2003 07:10
Subject:
Re: MakeMaker and TESTS => 't/*.t t/*/*.t'
Message ID:
200302021609.16082.abe@ztreet.demon.nl
Op een druilerige winterdag (Sunday 02 February 2003 14:25), schreef Jos I. 
Boumans:

> abigail@abigail.nl wrote:
> > I'm maintaining a module (Regexp::Common) which has a large set of
> > tests. Therefore I decided to not put all the test scripts in t/,
> > but to make subdirectories in t/.
> >
> > I added "test => {TESTS => 't/*.t t/*/*.t'}" to the call to WriteMakefile
> > in Makefile.PL, and all worked well. At least, so I thought. It works
> > fine on Unix, but it seems to fail under Windows. I got the following
> > report:
> >
> >     Installing perl extension
> >     Writing Makefile for Regexp::Common
> >
> >     Microsoft (R) Program Maintenance Utility Version 7.00.9466
> >     Copyright (C) Microsoft Corporation.  All rights reserved.
> >
> >             C:\Programme\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
> >     "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/*/*.t
> >     t/*......t/*.t does not exist
> >     t/*/*....t/*/*.t does not exist
> >     FAILED--2 test scripts could be run, alas--no output ever seen
> >     NMAKE : fatal error U1077: 'C:\Programme\Perl\bin\perl.exe' : return
> >     code '0x2'
> >     Stop.
> >
> >
> > It looks like the Microsoft shell doesn't understand wildcards.
> > Does MakeMaker have a way to solve this? Or is my only way out
> > of this to list all the test files separately?
>
> I think it's the forward slash part it doesn't like (actually, i'm quite
> sure of it -- in perl it 'does the right thing', but in cmd.exe, it gets
> mighty confused):

CMD.EXE will work with slashes if you dubble-quote the path.
I think it's a globbing issue, CMD.EXE doesn't glob like sh, so this:

	my @tests = qw(t/*.t t/*/*.t);
	WriteMakefile(
	...
	    test => {TESTS => $^O eq 'MSWin32' 
	                    ? "@{[ map glob( $_ ) => @tests ]}" : "@tests" }
        );

will work, but it could generate a *long* commandline for "make test", which 
could also give problems.

I just checked, and it works for Regexp::Common-2.105 (on WindowsXP)

Good luck,

Abe
-- 
"Crashes Perl (or Used To)" is not a really useful classifying 
criterion, it's about as useful as "the number of characters in 
the test is divisible by 73".
                                   -- Jarkko Hietaniemi on p5p @ 2001-10-30


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About