瀏覽代碼

+ KNOWNRUNERROR added

pierre 23 年之前
父節點
當前提交
2a587bcf45
共有 3 個文件被更改,包括 65 次插入14 次删除
  1. 9 1
      tests/utils/digest.pp
  2. 51 11
      tests/utils/dotest.pp
  3. 5 2
      tests/utils/teststr.pp

+ 9 - 1
tests/utils/digest.pp

@@ -27,6 +27,7 @@ const
   failed_compilation_successful_count : longint = 0;
   successfully_compiled_count : longint = 0;
   failed_to_run_count : longint = 0;
+  known_run_problem : longint = 0;
   successfully_run_count : longint = 0;
   skipping_graph_test_count : longint = 0;
   skipping_interactive_test_count : longint = 0;
@@ -81,6 +82,8 @@ begin
       inc(failed_to_run_count);
       if not should_be_run then
         inc(unexpected_run);
+      if pos(known_problem,st)>0 then
+        inc(known_run_problem);
     end
   else if pos(successfully_run,st)=1 then
     begin
@@ -163,6 +166,8 @@ begin
     successfully_run_count,')');
   Writeln('Successful runs = ', successfully_run_count);
   Writeln('Failed runs = ', failed_to_run_count);
+  if known_run_problem>0 then
+    Writeln('From these ',known_run_problem,' known problems');
 
   if successfully_compiled_count <>
      number_runs+skipping_run_unit_count+skipping_run_test_count then
@@ -223,7 +228,10 @@ end.
 
 {
   $Log$
-  Revision 1.1  2002-11-13 15:26:24  pierre
+  Revision 1.2  2002-11-18 16:42:43  pierre
+   + KNOWNRUNERROR added
+
+  Revision 1.1  2002/11/13 15:26:24  pierre
    + digest program added
 
 }

+ 51 - 11
tests/utils/dotest.pp

@@ -34,8 +34,10 @@ type
   TConfig = record
     NeedOptions,
     NeedCPU,
-    NeedVersion   : string;
+    NeedVersion,
+    KnownRunNote  : string;
     ResultCode    : longint;
+    KnownRunError : longint;
     NeedRecompile : boolean;
     IsInteractive : boolean;
     IsKnown       : boolean;
@@ -63,6 +65,7 @@ const
   DoInteractive : boolean = false;
   DoExecute : boolean = false;
   DoKnown : boolean = false;
+  DoAll : boolean = false;
   DoUsual : boolean = true;
 
 procedure Verbose(lvl:TVerboseLevel;const s:string);
@@ -269,7 +272,8 @@ end;
 function GetConfig(const fn:string;var r:TConfig):boolean;
 var
   t : text;
-  code : integer;
+  part,code : integer;
+  l : longint;
   s,res : string;
 
   function GetEntry(const entry:string):boolean;
@@ -351,9 +355,27 @@ begin
               else
                if GetEntry('NORUN') then
                 r.NoRun:=true
+              else
+               if GetEntry('KNOWNRUNERROR') then
+                begin
+                  if res<>'' then
+                    begin
+                      val(res,l,code);
+                      if code>1 then
+                        begin
+                          part:=code;
+                          val(copy(res,1,code-1),l,code);
+                          delete(res,1,part);
+                        end;
+                      if code=0 then
+                        r.KnownRunError:=l;
+                      if res<>'' then
+                        r.KnownRunNote:=res;
+                    end;
+                end
               else
                if GetEntry('KNOWN') then
-                r.IsKnown:=true
+                 r.IsKnown:=true
               else
                if GetEntry('INTERACTIVE') then
                 r.IsInteractive:=true
@@ -550,12 +572,26 @@ begin
   Verbose(V_Debug,'Exitcode '+ToStr(ExecuteResult));
   if ExecuteResult<>Config.ResultCode then
    begin
-     AddLog(FailLogFile,TestName);
-     AddLog(ResLogFile,failed_to_run+PPFileInfo);
-     AddLog(LongLogFile,line_separation);
-     AddLog(LongLogFile,failed_to_run+PPFileInfo+' ('+ToStr(ExecuteResult)+')');
-     Copyfile(OutName,LongLogFile,true);
-     Verbose(V_Abort,'Exitcode: '+ToStr(ExecuteResult)+' (expected '+ToStr(Config.ResultCode)+')');
+     if (ExecuteResult<>0) and
+        (ExecuteResult=Config.KnownRunError) then
+       begin
+         AddLog(FailLogFile,TestName+known_problem+Config.KnownRunNote);
+         AddLog(ResLogFile,failed_to_run+PPFileInfo+known_problem+Config.KnownRunNote);
+         AddLog(LongLogFile,line_separation);
+         AddLog(LongLogFile,known_problem+Config.KnownRunNote);
+         AddLog(LongLogFile,failed_to_run+PPFileInfo+' ('+ToStr(ExecuteResult)+')');
+         Copyfile(OutName,LongLogFile,true);
+         Verbose(V_Abort,known_problem+'exitcode: '+ToStr(ExecuteResult)+' (expected '+ToStr(Config.ResultCode)+')');
+       end
+     else
+       begin
+         AddLog(FailLogFile,TestName);
+         AddLog(ResLogFile,failed_to_run+PPFileInfo);
+         AddLog(LongLogFile,line_separation);
+         AddLog(LongLogFile,failed_to_run+PPFileInfo+' ('+ToStr(ExecuteResult)+')');
+         Copyfile(OutName,LongLogFile,true);
+         Verbose(V_Abort,'Exitcode: '+ToStr(ExecuteResult)+' (expected '+ToStr(Config.ResultCode)+')');
+       end
    end
   else
    begin
@@ -605,6 +641,7 @@ begin
              DoGraph:=true;
              DoInteractive:=true;
              DoKnown:=true;
+             DoAll:=true;
            end;
          'C' : CompilerBin:=Para;
          'E' : DoExecute:=true;
@@ -692,7 +729,7 @@ begin
 
   if Res then
    begin
-     if Config.NeedVersion<>'' then
+     if (Config.NeedVersion<>'') and not DoAll then
       begin
         Verbose(V_Debug,'Required compiler version: '+Config.NeedVersion);
         Res:=GetCompilerVersion;
@@ -766,7 +803,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.19  2002-11-18 01:31:07  pierre
+  Revision 1.20  2002-11-18 16:42:43  pierre
+   + KNOWNRUNERROR added
+
+  Revision 1.19  2002/11/18 01:31:07  pierre
    + use -n option
    + use -G- for only graph
    + use -I- for only interactive

+ 5 - 2
tests/utils/teststr.pp

@@ -34,7 +34,7 @@ const
   skipping_other_cpu = 'Skipping test because for other cpu ';
   skipping_run_unit = 'Skipping test run because it is a unit ';
   skipping_run_test = 'Skipping run test ';
-
+  known_problem = ' known problem: ';
   line_separation = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
 
   ResLogfile  : string[32] = 'log';
@@ -45,7 +45,10 @@ end.
 
 {
   $Log$
-  Revision 1.2  2002-11-13 15:26:24  pierre
+  Revision 1.3  2002-11-18 16:42:43  pierre
+   + KNOWNRUNERROR added
+
+  Revision 1.2  2002/11/13 15:26:24  pierre
    + digest program added
 
 }