home *** CD-ROM | disk | FTP | other *** search
- @rem = '-*- Perl -*-';
- @rem = '
- @echo off
- perl %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9
- goto endofperl
- ';
-
-
- #
- # perl script to extract info from status.txt
- #
- #
- # options:
- # -t : look for tested features
- # -u : look for untested features
- # -n : look for not yet implemented features
- # -N : look for not applicable features
- # -a : look for all features
- # -p : print features
- #
-
- if ($#ARGV < 0) {
- $opt_a = 1;
- }
- else {
- require 'getopts.pl';
- &Getopts('ptunNa');
- }
-
- @allfea = ('Tested', 'Untested', 'NYI', 'N/A');
-
- #
- # set up regex for searching
- #
-
- if ($opt_a) {
- $pattern = 'Tested|Untested|NYI|N/A';
- $opt_t = $opt_u = $opt_n = $opt_N = 1;
- @fea = ('Tested', 'Untested', 'NYI', 'N/A');
- }
- else {
- if ($opt_t) {
- $pattern = 'Tested';
- push(@fea, 'Tested');
- }
- if ($opt_u) {
- $pattern .= '|' if $pattern ne '';
- $pattern .= 'Untested';
- push(@fea, 'Untested');
- }
- if ($opt_n) {
- $pattern .= '|' if $pattern ne '';
- $pattern .= 'NYI';
- push(@fea, 'NYI');
- }
- if ($opt_N) {
- $pattern .= '|' if $pattern ne '';
- $pattern .= 'N/A';
- push (@fea, 'N/A');
- }
- }
-
- %features = ();
-
- open (S, "c:/win32app/ingr/perl/status.txt")
- || die "Can't open status.txt: $!\n";
-
- #
- # skip everything up to the first form feed
- #
-
- while (<S>) {
- last if $_ eq "\f\n";
- }
-
- &do_header;
- $count = 0;
- while (<S>) {
- chop;
- (&do_header, next) if $_ eq "\f";
- split;
- print "$_\n" if $opt_p && ($_[1] =~ /$pattern/o);
- $features{$_[1]}++;
- }
- close S;
-
- $total = 0;
-
- format top =
-
- Perl Feature Summary
- --------------------------
- .
-
- format STDOUT =
- @<<<<<<<< @### @##.##%
- $type, $features{$type}, $per
- .
-
- format totals =
- --------------------------
- @<<<<<<<< @### @##.##%
- "Total", $total, 100.00
- .
-
- #print "\n\nPerl Feature Summary\n--------------------\n";
-
- foreach $type (@allfea) {
- $total += $features{$type};
- }
-
- $^ = top;
-
- foreach $type (@fea) {
- $per = $features{$type} / $total * 100;
- write;
- }
-
- $~ = totals;
- write;
-
- #print "page: $%, len: $=, lines left: $-, form: $~ top: $^, formfeed: $^L\n";
- exit 0;
-
- sub do_header {
- local($a) = scalar(<S>);
- local($b) = scalar(<S>);
- local($c) = scalar(<S>);
- print $a if $opt_p;
- print $b if $opt_p;
- }
-
- sub usage {
- die "status [-ptunNa]\n";
- }
-
- __END__
- :endofperl
-