1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-20 19:42:53 -08:00
emacs/mps/qa/test/script/commands/index
Richard Tucker 7675bc2d79 Change include tree
Copied from Perforce
 Change: 18974
 ServerID: perforce.ravenbrook.com
1997-11-12 16:34:40 +00:00

43 lines
718 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 "require";
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);
}