Skip Menu |
 

This queue is for tickets about the Test-PerlTidy CPAN distribution.

Report information
The Basics
Id: 20560
Status: resolved
Priority: 0/
Queue: Test-PerlTidy

People
Owner: larryl [...] cpan.org
Requestors: stephen [...] enterity.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 20050726
Fixed in: 20110320



Subject: make run_tests() more flexible (patch included)
Download (untitled) / with headers
text/plain 1.3k
The patch below adds two arguments to run_tests(). First, passing a value for 'path' will let you specify the root of the search tree, rather than always testing '.' second, passing in a value for 'perltidyrc' will pass that value onto Perl::Tidy so that you can override the default formatting directives --- /Library/Perl/5.8.6/Test/PerlTidy.pm 2006-07-19 12:08:27.000000000 -0400 +++ t/Test/PerlTidy.pm 2006-07-19 12:25:53.000000000 -0400 @@ -29,19 +29,19 @@ $Test->skip_all("All tests skipped.") if $args{skip_all}; # Get files to work with and set the plan. - my @files = list_files('.'); + my @files = list_files( $args{path} || '.'); $Test->plan( tests => scalar @files ); # Check ech file in turn. foreach my $file (@files) { # $Test->diag("About to test '$file'\n"); - $Test->ok( is_file_tidy($file), "'$file'" ); + $Test->ok( is_file_tidy($file, $args{perltidyrc} ), "'$file'" ); } } sub is_file_tidy { - my $file_to_tidy = shift; + my( $file_to_tidy, $perltidyrc ) = @_; my $code_to_tidy = load_file($file_to_tidy); my $tidied_code = ''; @@ -55,6 +55,7 @@ stderr => \$stderr, logfile => \$logfile, errorfile => \$errorfile, + perltidyrc => $perltidyrc, ); # If there were perltidy errors report them and return.
This is fixed in Test-PerlTidy-20110320


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.