mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-18 08:51:45 -08:00
43 lines
719 B
Perl
43 lines
719 B
Perl
#!/usr/local/bin/perl
|
|
#
|
|
# make an index of all the tests (all .c files) in the
|
|
# current directory, and write it on stdout.
|
|
#
|
|
|
|
&options();
|
|
|
|
require "headread";
|
|
|
|
opendir(DIR, ".");
|
|
|
|
@names = readdir(DIR);
|
|
@filtered = ();
|
|
|
|
while (@names) {
|
|
$file = pop(@names);
|
|
if ($file =~ /\.c$/) {
|
|
$file =~ s/\.c$//;
|
|
push(@filtered, $file)
|
|
}
|
|
}
|
|
|
|
foreach $testnum (sort by_number_first @filtered) {
|
|
&readheader($testnum.".c", 0);
|
|
$testname = $test_header{"summary"};
|
|
unless ($testname) {
|
|
print $testnum.": ** bad test header **\n";
|
|
} else {
|
|
print $testnum.": ".$testname."\n";
|
|
}
|
|
}
|
|
|
|
closedir(DIR);
|
|
|
|
sub by_number_first {
|
|
$aa = $a;
|
|
$bb = $b;
|
|
$aa =~ s/\D*//g;
|
|
$bb =~ s/\D*//g;
|
|
("0".$aa <=> "0".$bb) || ($a cmp $b);
|
|
}
|
|
|