BEGIN {chomp ($root = `configsrch Regreport /`);}
use lib
"$ENV{'DV_ROOT'}/tools/perlmod/Regreport/".$root;
my($PROG) = ($0=~ m
%([^/]+)$%); # regreport real name
# an initial sanity check.
#-------------------------
if(!(defined $ARGV[0])) {die " No arguments specified... please try regreport -h\n"; }
# A cute way to parse the command line. (legacy stuff)
# This assigns a variable directly from command line ..
#=================================================================
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_]+=)(.*)/ && shift;
my @Options = qw(debug cut_name! sas_only regenerate regress
ver 1 h clean_pass fails_only sim=s);
GetOptions
(\
%opt, @Options) or die "Error in arguments!\n";
$sas_only = $opt{sas_only
};
$cut_name = $opt{cut_name
};
$clean_pass = $opt{clean_pass
};
$fails_only = $opt{fails_only
} || defined ($ENV{REGREPORT_FAILS_ONLY
}) ;
my $regenerate = $opt{regenerate
};
my $regress = $opt{regress
};
print "You are running: $PROG\n";
if((defined $ARGV[0]) && (defined $ARGV[1]) && (-d
$ARGV[1])){
if (defined ($ENV{CLEAN_PASS
})) {
my $status = wait_regression
($ARGV[0], $ARGV[1]);
if (!defined ($ENV{REGRESS_MAIL
}) ||
defined ($ENV{REGRESS_MAIL
}) && ($ENV{REGRESS_MAIL
} !~ /^no$/i)) {
$mailto = $mailto.",$ENV{REGRESS_MAIL}" if (defined ($ENV{REGRESS_MAIL
}));
my $finish = "Completed";
my $subject = "'$finish Regression results for $ARGV[1]'";
system ("/bin/mailx -s $subject $mailto < $ARGV[0] ");
die " -regress options are not correct. Needs file_name, dir_name, try regreport -h\n";
}elsif($single) { #1 diag report
if(defined $ARGV[0]) { &chk_single_diag
($ARGV[0]); }
else { &chk_single_diag
("."); }
if((defined $ARGV[0]) && (-d
$ARGV[0])) { #regression directory
open (STDOUT
, "| tee regreport.log") or
die "DIE. Could not open regreport.log for stdout" ;
my$total = 1; my $pass = 0;
$total=(regress_stat
(0, @ARGV))[0];
$pass=(regress_stat
(0, @ARGV))[1];
if ($clean_pass && ($total == $pass)) {
printf STDOUT
"Cleaning Run Directories in $ARGV[0]..\n";
opendir (DIR
, "$ARGV[0]");
foreach (grep(!/^\.+$/,readdir DIR
)) {
system ("rm -rf $ARGV[0]/$_") if (-d
"$ARGV[0]/$_");
print STDERR
"Something went wrong. Probably cannot chdir.Try regreport -h \n";
#=========================================================================
---------------------------------------------------------------------------
Usage: regreport <options> [<directory> [<list>]]
print report for the specified or current-directory diag; [regress dir].
-regress <output_file> <directory>:
in regression mode, regreport writes summary status for finished
diags to a file until all diags are finished. NOTE: if
some diag does not produce status, $PROG will wait forever.
print version number and exit.
sims.log will not be parsed, only sas.log will get parsed.
cuts the name from a sss:sss:sss:ddd formatted name. Default is to cut.
will regenerate the status.log files in the diag directories.
will clean up passing directories.
will show details for fails only
print report for all diags under <directory>. <list> is
0 or more of simulation 'system' names, such as
'spc2', 'cmp', 'cmp1', 'cmp8', etc. When nothing
specified, all systems are included.
CLEAN_PASS : Clean passing dirs
REGRESS_MAIL : Set to comma seperated list. Default is to send user
email when run in regress mode. When set to "no"
REGREPORT_FAILS_ONLY : Show details for fails only.
Examine all regression .log files for diags under
and print reports. The most common use is
---------------------------------------------------------------------------