Changeset 17640 for util

Show
Ignore:
Timestamp:
09/04/07 09:27:43 (15 months ago)
Author:
moritz
Message:

smartlinks.pl: added option --missing to check for test
files without smartlinks

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • util/smartlinks.pl

    r16806 r17640  
    2525 
    2626my $check; 
     27my $print_missing; 
    2728my $test_result; 
    2829my $line_anchor; 
     
    244245        die "error: Can't open $infile for reading: $!\n"; 
    245246    my ($setter, $from, $to); 
     247    my $found_link = 0; 
    246248    while (<$in>) { 
    247249        chomp; 
     
    255257            $new_from = $.; 
    256258            $to = $. - 1; 
     259            $found_link++; 
    257260        } 
    258261        elsif (/^ \s* \#? \s* L(<<?) (S\d+) \/ ([^\/]+) \/ (.*) /xo) { 
     
    284287            } 
    285288            #warn "*$synopsis* *$section* *$pattern*\n"; 
     289            $found_link++; 
    286290        } 
    287291        elsif (/^ \s* \#? \s* L<? S\d+\b /xoi) { 
     
    310314    $setter->($from, $.) if $setter and $from; 
    311315    close $in; 
     316    print "No smartlink found in <$infile>\n" if (defined $print_missing && $found_link == 0); 
    312317} 
    313318 
     
    768773  $0 --check t/*/*.t t/*/*/*.t 
    769774  $0 --check t/some/test.t 
     775  $0 --check --missing t/*/*.t t/*/*/*.t 
    770776 
    771777Options: 
     
    773779  --check         Only check the validity of the smartlinks, no 
    774780                  HTML outputs. 
     781  --missing       Print files whitout smartlinks  
    775782  --out-dir <dir> Specify the output directory for HTML files. 
    776783  --css <file>    Specify the CSS file used by the HTML outputs, 
     
    798805    GetOptions( 
    799806        'check'       => \$check, 
     807        'missing'     => \$print_missing, 
    800808        'syn-dir=s'   => \$syn_dir, 
    801809        'out-dir=s'   => \$out_dir, 
     
    979987  smartlinks.pl --check t/*/*.t t/*/*/*.t 
    980988  smartlinks.pl --check t/some/test.t 
     989  smartlinks.pl --missing t/*/*.t t/*/*/*.t 
    981990 
    982991=head1 Design Decisions