Changeset e2114af in git for Tst/regress.cmd


Ignore:
Timestamp:
Jul 13, 1998, 11:22:54 AM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
de80b3c31fb1416223e69bba22557229daaa6908
Parents:
19fbf0a3717469b69ac8af448e962da5745a4ef3
Message:
* incoporatred status checks


git-svn-id: file:///usr/local/Singular/svn/trunk@2317 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Tst/regress.cmd

    r19fbf0 re2114af  
    22
    33#################################################################
    4 # $Id: regress.cmd,v 1.20 1998-07-03 10:05:54 obachman Exp $
     4# $Id: regress.cmd,v 1.21 1998-07-13 09:14:54 obachman Exp $
    55# FILE:    regress.cmd
    66# PURPOSE: Script which runs regress test of Singular
     
    6464
    6565  $call = "$call > catch_$$";
    66   mysystem($call);
     66  & mysystem($call);
    6767 
    6868  open(CATCH_FILE, "<catch_$$");
     
    7272  }
    7373  close(CATCH_FILE);
    74   mysystem("$rm -f catch_$$");
     74  & mysystem("$rm -f catch_$$");
    7575  return $output;
    7676}
     
    105105}
    106106# sed scripts which are applied to res files before they are diff'ed
    107 $sed_scripts = "-e '/\\/\\/.*used time:/d' -e '/\\/\\/.*tst_ignore:/d' -e '/error occurred in/d'";
     107$sed_scripts = "-e '/used time:/d' -e '/tst_ignore:/d' -e '/Id: /d'";
    108108# default value (in %) above which differences are reported on -r
    109 $report_val = 10;
     109$report_val = 5;
    110110# default value (in %) above which differences cause an error on -e
    111 $error_val = 10;
     111$error_val = 5;
    112112# default value in 1/100 seconds, above which time differences are reported
    113113$mintime_val = 10;
     
    172172  if ($verbosity > 0 && ! $WINNT)
    173173  {
    174     $exit_status = &mysystem("$diff -w $root.res.cleaned $root.new.res.cleaned | $tee $root.diff");
     174    $exit_status = &mysystem("$diff -w -B $root.res.cleaned $root.new.res.cleaned | $tee $root.diff");
    175175  }
    176176  else
    177177  {
    178     $exit_status = &mysystem("$diff -w $root.res.cleaned $root.new.res.cleaned > $root.diff 2>&1");
     178    $exit_status = &mysystem("$diff -w -B $root.res.cleaned $root.new.res.cleaned > $root.diff 2>&1");
    179179  }
    180180 
     
    200200  local($error_cause) = "";
    201201 
    202   open(RES_FILE, "<$root.res");
    203   open(NEW_RES_FILE, "<$root.new.res");
    204   open(STATUS_DIFF_FILE, ">$root.status.diff");
     202  open(RES_FILE, "<$root.stat") ||
     203    return (1, "Can not open $root.stat \n");
     204  open(NEW_RES_FILE, "<$root.new.stat") ||
     205    return (1, "Can not open $root.new.stat \n");
     206  open(STATUS_DIFF_FILE, ">$root.stat.diff") ||
     207    return (1, "Can not open $root.stat.diff \n");
     208
    205209  $new_line = <NEW_RES_FILE>;
    206210  $line = <RES_FILE>;
    207211  while ($line && $new_line)
    208212  {
    209     if ($line =~ /^STDIN\s*(\d+)/)
    210     {
    211       $prefix = "STDIN $1>";
    212     }
    213     elsif ($line =~ /\/\/.*tst_ignore:(\w+).*$hostname:(\d+)/ && $checks{$1})
    214     {
    215       $crit = $1;
    216       $res = $2;
     213    if ($line =~ /(\d+) >> (\w+) ::.*$hostname:(\d+)/ && $checks{$2})
     214    {
     215      $prefix = $1;
     216      $crit = $2;
     217      $res = $3;
    217218      if ($res > $mintime_val &&
    218           $new_line =~ /\/\/.*tst_ignore:$crit.*$hostname:(\d+)/)
     219          $new_line =~ /$prefix >> $crit ::.*$hostname:(\d+)/)
    219220      {
    220221        $new_res = $1;
     
    222223        $res_diff_pc = int((($new_res / $res) - 1)*100);
    223224        $res_diff_line =
    224           "$prefix $crit new:$new_res old:$res diff:$res_diff %:$res_diff_pc";
     225          "$prefix >> $crit :: new:$new_res old:$res diff:$res_diff %:$res_diff_pc";
    225226        print (STATUS_DIFF_FILE "$res_diff_line\n")
    226227          if ((defined($error{$crit}) &&  $error{$crit}<abs($res_diff_pc))
     
    249250  close(NEW_RES_FILE);
    250251  close(STATUS_DIFF_FILE);
    251   mysystem("rm -f $root.status.diff")
     252  mysystem("rm -f $root.stat.diff")
    252253    if ($exit_status == 0 && $keep ne "yes");
    253254 
     
    260261  local($line, $new_line, $crit, $res);
    261262 
    262   open(RES_FILE, "<$root.res");
    263   open(NEW_RES_FILE, "<$root.new.res");
    264   open(TEMP_FILE, ">$root.tmp.res");
     263  open(RES_FILE, "<$root.stat") ||
     264    return (1, "Can not open $root.stat \n");
     265  open(NEW_RES_FILE, "<$root.new.stat") ||
     266    return (1, "Can not open $root.new.stat \n");
     267  open(TEMP_FILE, ">$root.tmp.stat") ||
     268    return (1, "Can not open $root.tmp.stat \n");
     269 
    265270  $new_line = <NEW_RES_FILE>;
    266271  $line = <RES_FILE>;
    267272  while ($line)
    268273  {
    269     if ($new_line =~ /\/\/.*tst_ignore:(\w+).*$hostname:(\d+)/ && $merge{$1})
    270     {
    271       $crit = $1;
    272       $new_res = $2;
    273       if ($line =~ /(.*)\/\/(.*)tst_ignore:$crit(.*)$hostname:(\d+)(.*)/)
     274    if ($new_line =~ /(\d+) >> (\w+) ::.*$hostname:(\d+)/ && $merge{$2})
     275    {
     276      $prefix = $1;
     277      $crit = $2;
     278      $new_res = $3;
     279      if ($line =~ /$prefix >> $crit ::(.*)$hostname:(\d+)/)
     280      {
     281        $line =~ s/$hostname:$2/$hostname:$new_res/;
     282        print(TEMP_FILE $line);
     283      }
     284      elsif ($line =~ /$prefix >> $crit ::(.*)/)
    274285      {
    275286        print(TEMP_FILE
    276               "$1//$2tst_ignore:$crit$3$hostname:$new_res$4");
    277       }
    278       elsif ($line =~ /(.*)\/\/(.*)tst_ignore:$crit(.*)/)
    279       {
    280         print(TEMP_FILE
    281               "$1//$2tst_ignore:$crit$3 $hostname:$new_res\n");
     287              "$prefix >> $crit :: $hostname:$new_res $1\n");
    282288      }
    283289      else
    284290      {
    285         print "Warning: Merge problems: Generate before doing a merge"
    286           if ($verbosity > 0);
    287         print(TEMP_FILE $line);
     291        close(RES_FILE);
     292        close(NEW_RES_FILE);
     293        close(TEMP_FILE);
     294        &mysystem("$rm $root.tmp.stat");
     295        return (1, "Generate before doing a merge\n");
    288296      }
    289297    }
     
    298306  close(NEW_RES_FILE);
    299307  close(TEMP_FILE);
    300   mysystem("$mv $root.tmp.res $root.res")
     308  &mysystem("$mv -f $root.tmp.stat $root.stat");
    301309}
    302310
     
    384392  }
    385393
    386   # do status checks
    387   ($exit_status, $error_cause) = & tst_status_check($root)
    388     if (%checks && ! $exit_status && $generate ne "yes");
     394  if (%checks && ! $exit_status && $generate ne "yes")
     395  {
     396    & mysystem("$cp -f tst_status.out $root.new.stat");
     397    # do status checks
     398    ($exit_status, $error_cause) = & tst_status_check($root);
     399  }
     400 
    389401 
    390402  # complain even if verbosity == 0
     
    397409   
    398410    #clean up
    399     if ($generate eq "yes" || %merge)
    400     {
     411    if ($generate eq "yes")
     412    {
     413      & mysystem("$cp -f tst_status.out $root.stat");
    401414      if (! $WINNT)
    402415      {
    403         & tst_status_merge($root) if (%merge);
    404416        &mysystem("$gzip -cf $root.res | $uuencode $root.res.gz > $root.res.gz.uu");
    405417      }
     
    409421        print "Warning: Can not generate $root.res.gz.uu under Windows\n";
    410422      }
    411     }
    412    
     423     
     424    }
     425    elsif (%merge)
     426    {
     427      if (! -r "$root.stat")
     428      {
     429        & mysystem("$cp -f tst_status.out $root.stat");
     430      }
     431      else
     432      {
     433        & mysystem("$cp -f tst_status.out $root.new.stat");
     434        ($exit_status, $error_cause) = & tst_status_merge($root);
     435
     436        print (STDERR "Warning: Merge Problems: $error_cause\n")
     437          if ($verbosity > 0 && $exit_status);
     438      }
     439    }
     440
    413441    if ($keep ne "yes")
    414442    {
    415       &mysystem("$rm -f $root.new.res $root.res $root.diff");
     443      &mysystem("$rm -f tst_status.out $root.new.res $root.res $root.diff $root.new.stat");
    416444    }
    417445  }
Note: See TracChangeset for help on using the changeset viewer.