Changeset 6d01ca in git


Ignore:
Timestamp:
Dec 5, 2000, 3:26:27 PM (23 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
fb6621e98cb726347270a24e92c13054fef3aed7
Parents:
ee7e8383100fa22353d12785c1e50be1f99bd4fb
Message:
* added support for timings


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

Legend:

Unmodified
Added
Removed
  • Tst/regress.cmd

    ree7e83 r6d01ca  
    22
    33#################################################################
    4 # $Id: regress.cmd,v 1.34 2000-11-08 17:07:13 obachman Exp $
     4# $Id: regress.cmd,v 1.35 2000-12-05 14:26:27 obachman Exp $
    55# FILE:    regress.cmd
    66# PURPOSE: Script which runs regress test of Singular
     
    2020  [-h]              -- print out help and exit
    2121  [-k]              -- keep all intermediate files
    22   [-v num]          -- set verbosity to num (used range 0..3, default: 1)
     22  [-v num]          -- set verbosity to num (used range 0..4, default: 2)
    2323  [-g]              -- generate result (*.res.gz.uu) files, only
    2424  [-r [crit%[val]]] -- report if status differences [of crit] > val (in %)
     
    2929  [-t]              -- compute and call system("mtrack", 1) at the end, no diffs
    3030  [-tt max]         -- compute and call system("mtrack", max) at the end
     31  [-T]              -- simply compute and determine timmings, no diffs
    3132  [file.lst]        -- read tst files from file.lst
    3233  [file.tst]        -- test Singular script file.tst
     
    5859  $call =~ s/"/\\"/g;
    5960  $call = "$sh -c \"$call\"";
    60   print "$call\n" if ($verbosity > 1);
     61  print "$call\n" if ($verbosity > 2);
    6162  return (system $call);
    6263}
     
    105106$singularOptions = "--ticks-per-sec=100 -teqr12345678 --no-rc";
    106107$keep = "no";
    107 $verbosity = 1;
     108$verbosity = 2;
    108109$generate = "no";
    109110$exit_code = 0;
     
    372373  local($system_call, $exit_status, $ignore_pattern, $error_cause);
    373374
    374   print "--- $root\n" unless ($verbosity == 0);
     375  print "--- $root " unless ($verbosity == 0);
     376  $total_checks++;
     377 
    375378  # check for existence/readablity of tst and res file
    376379  if (! (-r "$root.tst"))
     
    388391
    389392  # generate $root.res
    390   if ($generate ne "yes" && ! defined($mtrack))
     393  if ($generate ne "yes" && ! defined($mtrack) && !defined($timings_only))
    391394  {
    392395    if ((-r "$root.res.gz.uu") && ! ( -z "$root.res.gz.uu"))
     
    413416  {
    414417    $system_call = "$cat $root.tst | sed -e 's/\\\\\$/LIB \"general.lib\"; killall(); killall(\"proc\");kill killall;system(\"mtrack\", \"$root.mtrack.unused\", $mtrack); \\\$/' | $singular $singularOptions ";
    415     $system_call .= ($verbosity > 2 ? " | $tee " : " > ");
     418    $system_call .= ($verbosity > 3 ? " | $tee " : " > ");
    416419    $system_call .= "$root.mtrack.res";
    417     $system_call .= " 2>&1 " if ($verbosity <= 2);
     420    $system_call .= " 2>&1 " if ($verbosity <= 3);
    418421  }
    419422  else
     
    421424   
    422425    # prepare Singular run
    423     if ($verbosity > 2 && !$WINNT)
     426    if ($verbosity > 3 && !$WINNT)
    424427    {
    425428      $system_call = "$cat $root.tst | $singular --execute 'string tst_status_file=\"$statfile\";' $singularOptions | $tee $resfile";
     
    431434  }
    432435  # Go Singular, Go!
     436 
     437  my ($user_t,$system_t,$cuser_t,$csystem_t) = times;
    433438  $exit_status = &mysystem($system_call);
    434 
     439  my ($user_t,$system_t,$cuser_t2,$csystem_t2) = times;
     440  $cuser_t = $cuser_t2 - $cuser_t;
     441  $csystem_t = $csystem_t2 - $csystem_t;
    435442  if ($exit_status != 0)
    436443  {
     
    446453      $error_cause = "Segment fault";
    447454    }
    448     elsif (! defined($mtrack))
     455    elsif (! defined($mtrack) && !defined($timings_only))
    449456    {
    450457      &mysystem("$rm -f $root.diff");
     
    524531  }
    525532  # und tschuess
     533  unless ($verbosity == 0)
     534  {
     535    if ($verbosity > 1 || $timings_only)
     536    {
     537      my $used_time = $cuser_t + $csystem_t;
     538      $total_used_time += $used_time;
     539      $lst_used_time += $used_time;
     540      print " " x (23 - length($root));
     541      printf("%.2f", $used_time);
     542    }
     543    print " \n";
     544  }
     545  $total_checks_pass++ unless $exit_code;
    526546  return ($exit_status);
    527547}
     
    564584  {
    565585    $mtrack = 1;
     586  }
     587  elsif (/^-T/)
     588  {
     589    $timings_only = 1;
    566590  }
    567591  elsif(/^-r$/)
     
    701725    $base = $2;
    702726    chdir($path);
    703     print "cd $path\n" if ($verbosity > 1);
     727    print "cd $path\n" if ($verbosity > 2);
    704728  }
    705729  else
     
    717741  elsif ($extension eq "lst")
    718742  {
     743   
    719744    if (! open(LST_FILE, "<$file"))
    720745    {
     
    723748      next;
    724749    }
     750    $lst_used_time = 0;
     751    $lst_checks = 0;
     752    $lst_checks_pass = 0;
    725753    while (<LST_FILE>)
    726754    {
     
    739767        $tst_base = $2;
    740768        chdir($tst_path);
    741         print "cd $tst_path\n" if ($verbosity > 1);
     769        print "cd $tst_path\n" if ($verbosity > 2);
    742770      }
    743771      else
     
    748776      $tst_base =~ s/^\s*//;
    749777      $tst_base =~ s/(.*?)\s+.*/$1/;
    750       $exit_code = &tst_check($tst_base) || $exit_code;
     778      $lst_checks++;
     779      my $this_exit_code = &tst_check($tst_base);
     780      $lst_checks_pass++ unless $this_exit_code;
     781      $exit_code = $this_exit_code || $exit_code;
    751782
    752783      if ($tst_path ne "")
    753784      {
    754785        chdir($tst_curr_dir);
    755         print "cd $tst_curr_dir\n" if ($verbosity > 1);
     786        print "cd $tst_curr_dir\n" if ($verbosity > 2);
    756787      }
    757788    }
    758789    close (LST_FILE);
     790    printf("$base Summary: Checks:$lst_checks Failed:%d Time:%.2f\n", $lst_checks - $lst_checks_pass, $lst_used_time)
     791      unless ($verbosity < 2)
    759792  }
    760793  else
     
    766799  {
    767800    chdir($curr_dir);
    768     print "cd $curr_dir\n" if ($verbosity > 1);
    769   }
     801    print "cd $curr_dir\n" if ($verbosity > 2);
     802  }
     803}
     804
     805unless ($verbosity < 2 || $lst_checks == $total_checks)
     806{
     807  printf("Summary: Checks:$total_checks Failed:%d Time:%.2f\n", $total_checks - $total_checks_pass, $total_used_time);
    770808}
    771809
Note: See TracChangeset for help on using the changeset viewer.