in reply to Re: Thoughts on making modules
in thread Thoughts on making modules
I have a tool for that, too. It's ~/bin/newtest:
#!/usr/bin/perl -w use strict; use File::Path; use File::Basename; my $progfile = basename( $0 ); die "$progfile <modname> <test filename>\n" unless @ARGV >= 2; my ($modname, $filename) = @ARGV; my $filepath = dirname( $filename ); mkpath( $filepath ) unless -e $filepath; open my $out, '>', $filename or die "Can't open '$filename': $!"; print $out <<END_HERE; #!/usr/bin/perl -w BEGIN { chdir 't' if -d 't'; use lib '../lib', '../blib/lib'; } use strict; use Test::More 'no_plan'; # tests => 1; my \$module = '$modname'; use_ok( \$module ) or exit; END_HERE
For Some::Module, run newtest Some::Module t/testfile.t.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Automating Writing Regression Tests
by Juerd (Abbot) on Dec 22, 2003 at 20:12 UTC | |
by reyjrar (Hermit) on Dec 22, 2003 at 22:03 UTC |
In Section
Meditations