Changeset 93e538 in git


Ignore:
Timestamp:
Sep 25, 2011, 3:01:48 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ebb444a1138dec379dd2d5ea481af6ab2c9549a1
Parents:
dfe91490479da83403139f2a696204e62e644b87
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-09-25 15:01:48+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:28+01:00
Message:
CHG: ancient perl (&function)
ADD: track run tests and avoid rerunning them (for TC)
ADD: more usefull output for TC + a bit more friendly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Tst/regress.cmd

    rdfe914 r93e538  
    7373
    7474  $call = "$call > catch_$$";
    75   & mysystem($call);
     75  mysystem($call);
    7676
    7777  open(CATCH_FILE, "<catch_$$");
     
    8181  }
    8282  close(CATCH_FILE);
    83   & mysystem("$rm -f catch_$$");
     83  mysystem("$rm -f catch_$$");
    8484  return $output;
    8585}
    8686
    87 $WINNT = 1 if (&mysystem("uname -a | $grep CYGWIN > /dev/null 2>&1") == 0);
     87$WINNT = 1 if (mysystem("uname -a | $grep CYGWIN > /dev/null 2>&1") == 0);
    8888$uuencode = "uuencode";
    8989$uudecode = "uudecode";
     
    129129# default value in 1/100 seconds, above which time differences are reported
    130130$mintime_val = 100;
    131 $hostname = &mysystem_catch("hostname");
     131$hostname = mysystem_catch("hostname");
    132132chop $hostname;
    133133
     
    137137$test_file = "";
    138138
    139 
     139# all previous test_file's:
     140%test_files = ();
    140141
    141142
     
    147148{
    148149  local($prop) = $_[0];
    149   return( &mysystem_catch("cat \"\$TEAMCITY_BUILD_PROPERTIES_FILE\"|grep \"$prop=\"|sed \"s/$prop=//\"") );
     150  return( mysystem_catch("cat \"\$TEAMCITY_BUILD_PROPERTIES_FILE\"|grep \"$prop=\"|sed \"s/$prop=//\"") );
    150151}
    151152
     
    222223  local($text) = $_[0];
    223224  putTCmsgNV2( "message", "text", $text, "status", "NORMAL");
     225}
     226sub tcWarn
     227{
     228  local($text) = $_[0];
     229  putTCmsgNV2( "message", "text", $text, "status", "WARNING");
    224230}
    225231sub tcError
     
    299305sub GetSingularVersionDate
    300306{
    301   &mysystem("$singular -t -v --execute=\"exit;\"> SingularVersionDate");
     307  mysystem("$singular -t -v --execute=\"exit;\"> SingularVersionDate");
    302308  open(FD, "<SingularVersionDate");
    303309  while (<FD>)
     
    310316  }
    311317  close(FD);
    312   &mysystem("if [ -e /proc/cpuinfo ]; then cat /proc/cpuinfo >> SingularVersionDate; fi ");
    313   &mysystem("sysctl -a  >> SingularVersionDate");
    314   &mysystem("uname -a >> SingularVersionDate");
    315   &mysystem("if [ -e /proc/meminfo ]; then cat /proc/meminfo >> SingularVersionDate; fi ");
    316   &mysystem("free -h >> SingularVersionDate");
     318  mysystem("if [ -e /proc/cpuinfo ]; then cat /proc/cpuinfo >> SingularVersionDate; fi ");
     319  mysystem("sysctl -a  >> SingularVersionDate");
     320  mysystem("uname -a >> SingularVersionDate");
     321  mysystem("if [ -e /proc/meminfo ]; then cat /proc/meminfo >> SingularVersionDate; fi ");
     322  mysystem("free -h >> SingularVersionDate");
    317323}
    318324
     
    325331    print(MP_TEST "system(\"with\", \"MP\"); \$");
    326332    close(MP_TEST);
    327     &mysystem("$singular -qt MPTest > withMPtest");
     333    mysystem("$singular -qt MPTest > withMPtest");
    328334    if (open(MP_TEST, "<withMPtest"))
    329335    {
     
    332338      close(MP_TEST);
    333339    }
    334     &mysystem("$rm -f withMPtest MPTest");
     340    mysystem("$rm -f withMPtest MPTest");
    335341  }
    336342}
     
    363369
    364370  # prepare the result files:
    365   &mysystem("$cat \"$root.res\" | $tr -d '\\013' | $sed $sed_scripts > \"$root.res.cleaned\"");
    366   &mysystem("$cat \"$root.new.res\" | $tr -d '\\013' | $sed $sed_scripts > \"$root.new.res.cleaned\"");
     371  mysystem("$cat \"$root.res\" | $tr -d '\\013' | $sed $sed_scripts > \"$root.res.cleaned\"");
     372  mysystem("$cat \"$root.new.res\" | $tr -d '\\013' | $sed $sed_scripts > \"$root.new.res.cleaned\"");
    367373
    368374  # doo the diff call
    369   $exit_status = &mysystem("$diff -w -b \"$root.res.cleaned\" \"$root.new.res.cleaned\" > \"$root.diff\" 2>&1");
     375  $exit_status = mysystem("$diff -w -b \"$root.res.cleaned\" \"$root.new.res.cleaned\" > \"$root.diff\" 2>&1");
    370376
    371377  # clean up time
    372   &mysystem("$rm -f \"$root.res.cleaned\" \"$root.new.res.cleaned\"");
     378  mysystem("$rm -f \"$root.res.cleaned\" \"$root.new.res.cleaned\"");
    373379
    374380  # there seems to be a bug here somewhere: even if diff reported
     
    505511      close(NEW_RES_FILE);
    506512      close(TEMP_FILE);
    507       &mysystem("$rm \"$root.tmp.stat\"");
     513      mysystem("$rm \"$root.tmp.stat\"");
    508514      return (1, "Can not find '$prefix >> $crit' in $root.stat\n");
    509515    }
     
    525531  close(NEW_RES_FILE);
    526532  close(TEMP_FILE);
    527   &mysystem("$mv -f \"$root.tmp.stat\" \"$root.stat\"");
    528   &mysystem("$rm -f \"$root.new.stat\" \"$root.stat.sdiff\"") unless $keep eq "yes";
     533  mysystem("$mv -f \"$root.tmp.stat\" \"$root.stat\"");
     534  mysystem("$rm -f \"$root.new.stat\" \"$root.stat.sdiff\"") unless $keep eq "yes";
    529535  return ;
    530536}
     
    535541  local($system_call, $exit_status, $ignore_pattern, $error_cause);
    536542
     543  if( exists($test_files{$test_file}) && (length($teamcity) > 0) )
     544  {
     545     tcWarn("The test '$test_file' have been alreeady tests (with result: $test_files{$test_file})... skipping!");
     546     return ($test_files{$test_file})
     547  }
     548 
    537549  $total_checks++;
    538  
     550   
    539551  # check for existence/readablity of tst and res file
    540552  if (! (-r "$root.tst"))
     
    543555    print (STDERR "Can not read $root.tst\n");
    544556    testIgnored($test_file, "Can not read $root.tst");
     557    $test_files{$test_file} = 1;
    545558    return (1);
    546559  }
    547560
    548561  # ignore MP stuff, if this singular does not have MP
    549   if (! &MPok($root))
     562  if (! MPok($root))
    550563  {
    551564    print "--- $root " unless ($verbosity == 0);
    552565    print "Warning: $root not tested: needs MP\n";
    553566    testIgnored($test_file, "Warning: $root not tested: needs MP");
     567    $test_files{$test_file} = 0;
    554568    return (0);
    555569  }
     
    560574    if ((-r "$root.res.gz.uu") && ! ( -z "$root.res.gz.uu"))
    561575    {
    562       $exit_status = &mysystem("$uudecode \"$root.res.gz.uu\" > /dev/null 2>&1; $gunzip -f \"$root.res.gz\"");
     576      $exit_status = mysystem("$uudecode \"$root.res.gz.uu\" > /dev/null 2>&1; $gunzip -f \"$root.res.gz\"");
    563577      if ($exit_status)
    564578      {
     
    566580        print (STDERR "Can not decode $root.res.gz.uu\n");
    567581        testIgnored($test_file, "Can not decode $root.res.gz.uu");
     582        $test_files{$test_file} = $exit_status;
    568583        return ($exit_status);
    569584      }
     
    574589      print (STDERR "Can not read $root.res[.gz.uu]\n");
    575590      testIgnored($test_file, "Can not read $root.res[.gz.uu]");
     591      $test_files{$test_file} = 1;
    576592      return (1);
    577593    }
     
    584600  $resfile = "\"$root.mtrack.res\"" if (defined($mtrack));
    585601  my $statfile = "$root.new.stat";
    586   &mysystem("$rm -f \"$statfile\"");
     602  mysystem("$rm -f \"$statfile\"");
    587603 
    588604  if (defined($mtrack))
     
    609625 
    610626  my ($user_t,$system_t,$cuser_t,$csystem_t) = times;
    611   $exit_status = &mysystem($system_call);
     627  $exit_status = mysystem($system_call);
    612628  my ($user_t,$system_t,$cuser_t2,$csystem_t2) = times;
    613629  $cuser_t = $cuser_t2 - $cuser_t;
     
    621637  {
    622638    # check for Segment fault in res file
    623     $exit_status = ! (&mysystem("$grep \"Segment fault\" $resfile > /dev/null 2>&1"));
     639    $exit_status = ! (mysystem("$grep \"Segment fault\" $resfile > /dev/null 2>&1"));
    624640
    625641    if ($exit_status)
     
    629645    elsif (! defined($mtrack) && !defined($timings_only))
    630646    {
    631       &mysystem("$rm -f \"$root.diff\"");
     647      mysystem("$rm -f \"$root.diff\"");
    632648      if ($generate eq "yes")
    633649      {
    634         &mysystem("$cp $resfile \"$root.res\"");
     650        mysystem("$cp $resfile \"$root.res\"");
    635651      }
    636652      else
    637653      {
    638654        # call Diff
    639         $exit_status = &Diff($root);
     655        $exit_status = Diff($root);
    640656        if ($exit_status)
    641657        {
     
    649665        else
    650666        {
    651           &mysystem("$rm -f \"$root.diff\"");
     667          mysystem("$rm -f \"$root.diff\"");
    652668        }
    653669      }
     
    665681    {
    666682      # do status checks
    667       ($exit_status, $error_cause) = & tst_status_check($root);
     683      ($exit_status, $error_cause) = tst_status_check($root);
    668684    }
    669685    else
    670686    {
    671687      print "Warning: no file $statfile\n";
     688      tcWarn("Warning: no file $statfile");
    672689    }
    673690  }
     
    697714        if (! $WINNT)
    698715        {
    699           &mysystem("$gzip -cf \"$root.res\" | $uuencode \"$root.res.gz\" > \"$root.res.gz.uu\"");
     716          mysystem("$gzip -cf \"$root.res\" | $uuencode \"$root.res.gz\" > \"$root.res.gz.uu\"");
    700717        }
    701718        else
     
    707724      elsif (%merge)
    708725      {
    709         ($exit_status, $error_cause) = & tst_status_merge($root);
     726        ($exit_status, $error_cause) = tst_status_merge($root);
    710727         
    711728        print (STDERR "Warning: Merge Problems: $error_cause\n")
     
    715732    if ($keep ne "yes")
    716733    {
    717       &mysystem("$rm -f tst_status.out $resfile \"$root.res\" \"$root.diff\" \"$root.new.stat\"");
     734      mysystem("$rm -f tst_status.out $resfile \"$root.res\" \"$root.diff\" \"$root.new.stat\"");
    718735    }
    719736  }
     
    733750  $total_checks_pass++ unless $exit_status;
    734751
    735   &mysystem("mv gmon.out \"gmon.$root.out\"") if (-e "gmon.out");
     752  mysystem("mv gmon.out \"gmon.$root.out\"") if (-e "gmon.out");
    736753
    737754  testFinished($test_file, $cuser_t + $csystem_t);
    738755 
     756  $test_files{$test_file} = $exit_status;
    739757  return ($exit_status);
    740758}
     
    918936   
    919937  blockOpened ($b);
    920   &mysystem("cat " . $ff);
     938  mysystem("cat " . $ff);
    921939  blockClosed ($b);
    922940}
     
    9911009  if ($extension eq "tst")
    9921010  {
    993     $exit_code = &tst_check($base) || $exit_code;
     1011    $exit_code = tst_check($base) || $exit_code;
    9941012  }
    9951013  elsif ($extension eq "lst")
     
    10491067
    10501068      tcLog("tst_path: $tst_path, tst_base: $tst_base");
    1051 
    10521069     
    1053       my $this_exit_code = &tst_check($tst_base);
     1070      my $this_exit_code = tst_check($tst_base);
    10541071
    10551072      $lst_checks_pass++ unless $this_exit_code;
     
    10631080    }
    10641081    close (LST_FILE);
    1065     printf("$base Summary: Checks:$lst_checks Failed:%d Time:%.2f\n", $lst_checks - $lst_checks_pass, $lst_used_time)
     1082     
     1083    printf("$base Summary: Checks:$lst_checks Failed:%d Time:%.2f\n", $lst_checks - $lst_checks_pass, $lst_used_time)
    10661084      unless ($verbosity < 2);
     1085     
     1086    tcLog( sprintf("list '$base' Summary: Checks:$lst_checks Failed:%d Time:%.2f", $lst_checks - $lst_checks_pass, $lst_used_time) );
    10671087    blockClosed ($b);
    10681088  }
     
    10831103  printf("Summary: Checks:$total_checks Failed:%d Time:%.2f\n", $total_checks - $total_checks_pass, $total_used_time);
    10841104}
     1105
     1106tcLog( sprintf("Global Summary: Checks:$total_checks Failed:%d Time:%.2f", $total_checks - $total_checks_pass, $total_used_time)) ;
    10851107
    10861108if( length($teamcity) > 0 )
Note: See TracChangeset for help on using the changeset viewer.