in reply to Module testing using passwords

Oops misread my own test case!!! Thanks adrianh

No you can't Yes you can have test.pl and t/test.t and get both run AFAIK. The test dir/file is specified in the Makefile when you do perl Makefile.PL. If there is a t/ dir then that is what is used. If there is not a t/dir then test.pl is used.

[root@devel3 test]# perl -MFile::Find -e 'File::Find::find( sub{print +$File::Find::name, $/, `cat $_`, $/,$/}, "." )'; cat: .: Is a directory . ./test.pl #!/usr/bin/perl use Test; BEGIN{plan tests => 1} ok(1); ./Makefile.PL use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'T', ); ./T.pm package T; 1; cat: t: Is a directory ./t ./t/test_t.t #!/usr/bin/perl use Test; BEGIN{plan tests => 1} ok(1); [root@devel3 test]# perl Makefile.PL Writing Makefile for T [root@devel3 test]# make cp T.pm blib/lib/T.pm [root@devel3 test]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/test_t....ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 cusr + 0.00 csys = 0.02 C +PU) PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl 1..1 ok 1 [root@devel3 test]# mv t t.ignore [root@devel3 test]# perl Makefile.PL Writing Makefile for T [root@devel3 test]# make [root@devel3 test]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl 1..1 ok 1 [root@devel3 test]# [root@devel3 test]# rm -f test.pl [root@devel3 test]# perl Makefile.PL Writing Makefile for T [root@devel3 test]# make [root@devel3 test]# make test No tests defined for T extension. [root@devel3 test]# [root@devel3 test]# mv t.ignore/ t [root@devel3 test]# perl Makefile.PL Writing Makefile for T [root@devel3 test]# make [root@devel3 test]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/test_t....ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.01 cusr + 0.01 csys = 0.02 C +PU) [root@devel3 test]#

cheers

tachyon

Replies are listed 'Best First'.
Re^2: Module testing using passwords
by adrianh (Chancellor) on Mar 06, 2004 at 00:27 UTC
    No you can't have test.pl and t/test.t and get both run AFAIK

    Actually, if you have both the default behaviour is to run both. Look at the results of that first make test again :-)

    Not that this is relevant to the OP as far as I can see...