1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-18 08:51:45 -08:00
emacs/mps/qa/test/script/commands/index
Richard Tucker f961471e4a Remove dependency on globbin
Copied from Perforce
 Change: 18740
 ServerID: perforce.ravenbrook.com
1997-09-12 14:34:19 +01:00

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);
}