Browse Source

+ digest program added

pierre 23 years ago
parent
commit
99eebd4de9
3 changed files with 274 additions and 3 deletions
  1. 229 0
      tests/utils/digest.pp
  2. 19 2
      tests/utils/dotest.pp
  3. 26 1
      tests/utils/teststr.pp

+ 229 - 0
tests/utils/digest.pp

@@ -0,0 +1,229 @@
+{
+  $Id$
+    This file is part of the Free Pascal test suite.
+    Copyright (c) 2002 by the Free Pascal development team.
+
+    This program generates a digest
+    of the last tests run.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+program digest;
+
+uses
+  teststr;
+
+
+const
+  failed_to_compile_count : longint = 0;
+  success_compilation_failed_count : longint = 0;
+  failed_compilation_successful_count : longint = 0;
+  successfully_compiled_count : longint = 0;
+  failed_to_run_count : longint = 0;
+  successfully_run_count : longint = 0;
+  skipping_graph_test_count : longint = 0;
+  skipping_interactive_test_count : longint = 0;
+  skipping_known_bug_count : longint = 0;
+  skipping_compiler_version_too_low_count : longint = 0;
+  skipping_other_cpu_count : longint = 0;
+  skipping_run_unit_count : longint = 0;
+  skipping_run_test_count : longint = 0;
+  unknown_lines : longint = 0;
+  unexpected_run : longint = 0;
+  next_should_be_run : boolean = false;
+
+var
+  prevline : string;
+
+procedure analyse (const st : string);
+var
+  should_be_run : boolean;
+begin
+  if st=prevline then
+    exit;
+  prevline:=st;
+  should_be_run:=next_should_be_run;
+  if next_should_be_run and
+     (pos(failed_to_run,st)<>1) and
+     (pos(successfully_run,st)<>1) and
+     (pos(skipping_run_test,st)<>1) and
+     (pos(skipping_run_unit,st)<>1) then
+    begin
+      Writeln('No run found for "',prevline,'"');
+    end;
+  next_should_be_run:=false;
+  if pos(failed_to_compile,st) = 1 then
+    begin
+      inc(failed_to_compile_count);
+    end
+  else if pos(success_compilation_failed,st)=1 then
+    begin
+      inc(success_compilation_failed_count);
+    end
+  else if pos(failed_compilation_successful,st)=1 then
+    begin
+      inc(failed_compilation_successful_count);
+    end
+  else if pos(successfully_compiled,st)=1 then
+    begin
+      inc(successfully_compiled_count);
+      next_should_be_run:=true;
+    end
+  else if pos(failed_to_run,st)=1 then
+    begin
+      inc(failed_to_run_count);
+      if not should_be_run then
+        inc(unexpected_run);
+    end
+  else if pos(successfully_run,st)=1 then
+    begin
+      inc(successfully_run_count);
+      if not should_be_run then
+        inc(unexpected_run);
+    end
+  else if pos(skipping_graph_test,st)=1 then
+    begin
+      inc(skipping_graph_test_count);
+    end
+  else if pos(skipping_interactive_test,st)=1 then
+    begin
+      inc(skipping_interactive_test_count);
+    end
+  else if pos(skipping_known_bug,st)=1 then
+    begin
+      inc(skipping_known_bug_count);
+    end
+  else if pos(skipping_compiler_version_too_low,st)=1 then
+    begin
+      inc(skipping_compiler_version_too_low_count);
+    end
+  else if pos(skipping_other_cpu,st)=1 then
+    begin
+      inc(skipping_other_cpu_count);
+    end
+  else if pos(skipping_run_unit,st)=1 then
+    begin
+      inc(skipping_run_unit_count);
+    end
+  else if pos(skipping_run_test,st)=1 then
+    begin
+      inc(skipping_run_test_count);
+    end
+  else
+    begin
+      Writeln('Unknown line "',st,'"');
+      inc(unknown_lines);
+    end;
+end;
+
+procedure display_results;
+var
+  number_compilations : longint;
+  number_skipped : longint;
+  number_runs : longint;
+  all_errors : longint;
+  all_success : longint;
+
+begin
+  all_errors:=failed_to_compile_count
+    +failed_compilation_successful_count
+    +failed_to_run_count;
+  all_success:=success_compilation_failed_count
+    +successfully_compiled_count
+    +successfully_run_count;
+  { about compilations }
+  number_compilations:=failed_to_compile_count
+    +success_compilation_failed_count
+    +failed_compilation_successful_count
+    +successfully_compiled_count;
+  { about runs }
+  number_runs:=failed_to_run_count+successfully_run_count;
+
+  Writeln('Total = ',number_compilations+number_runs,' (',
+    all_errors,':',
+    all_success,')');
+
+  Writeln('Total number of compilations = ', number_compilations,' (',
+    failed_to_compile_count+failed_compilation_successful_count,':',
+    successfully_compiled_count+success_compilation_failed_count,')');
+  Writeln('Successfully compiled = ', successfully_compiled_count);
+  Writeln('Successfully failed = ', success_compilation_failed_count);
+  Writeln('Compilation failures = ', failed_to_compile_count);
+  Writeln('Compilation that did not fail while they should = ', failed_compilation_successful_count);
+
+  Writeln('Total number of runs = ', number_runs,' (',
+    failed_to_run_count,':',
+    successfully_run_count,')');
+  Writeln('Successful runs = ', successfully_run_count);
+  Writeln('Failed runs = ', failed_to_run_count);
+
+  if successfully_compiled_count <>
+     number_runs+skipping_run_unit_count+skipping_run_test_count then
+    begin
+      Writeln('Number units compiled = ',skipping_run_unit_count);
+      Writeln('Number program that should not be run = ',skipping_run_test_count);
+    end;
+  { about skipped tests }
+  number_skipped:= skipping_graph_test_count
+    +skipping_interactive_test_count
+    +skipping_known_bug_count
+    +skipping_compiler_version_too_low_count
+    +skipping_other_cpu_count;
+  { don't count these ones ...
+    skipping_run_unit_count
+    skipping_run_test_count }
+  Writeln('Number of skipped tests = ',number_skipped);
+  Writeln('Number of skipped graph tests = ',skipping_graph_test_count);
+  Writeln('Number of skipped interactive tests = ',skipping_interactive_test_count);
+  Writeln('Number of skipped known bug tests = ',skipping_known_bug_count);
+  Writeln('Number of skipped compiler version too low tests = ',skipping_compiler_version_too_low_count);
+  Writeln('Number of skipped tests for other cpus = ',skipping_other_cpu_count);
+  if unknown_lines>0 then
+    Writeln('Number of unrecognized lines = ',unknown_lines);
+
+  if unexpected_run>0 then
+    Writeln('Number of unexpected runs = ',unexpected_run);
+end;
+
+var
+  logfile : text;
+  logfilename,
+  line : string;
+
+begin
+  if Paramcount>0 then
+    logfilename:=Paramstr(1)
+  else
+    logfilename:=ResLogfile;
+
+  assign(logfile,logfilename);
+{$i-}
+  reset(logfile);
+  if ioresult<>0 then
+    begin
+      Writeln('Unable to open ',logfilename);
+      halt(1);
+    end;
+{$i+}
+  while not eof(logfile) do
+    begin
+      readln(logfile,line);
+      analyse(line);
+    end;
+  close(logfile);
+  display_results;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-11-13 15:26:24  pierre
+   + digest program added
+
+}

+ 19 - 2
tests/utils/dotest.pp

@@ -1,6 +1,20 @@
 {
   $Id$
-}
+    This file is part of the Free Pascal test suite.
+    Copyright (c) 1999-2002 by the Free Pascal development team.
+
+    This program makes the compilation and
+    execution of individual test sources.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
 program dotest;
 uses
   dos,
@@ -730,7 +744,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.16  2002-11-13 15:19:44  pierre
+  Revision 1.17  2002-11-13 15:26:24  pierre
+   + digest program added
+
+  Revision 1.16  2002/11/13 15:19:44  pierre
    log strings moved to teststr unit
 
   Revision 1.15  2002/09/07 15:40:56  peter

+ 26 - 1
tests/utils/teststr.pp

@@ -1,3 +1,21 @@
+{
+  $Id$
+    This file is part of the Free Pascal test suite.
+    Copyright (c) 2002 by the Free Pascal development team.
+
+    This unit stores the strings used by
+    dotest program, so that they can be also used by
+    figest program.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
 unit teststr;
 
 interface
@@ -23,4 +41,11 @@ const
 
 implementation
 
-end.
+end.
+
+{
+  $Log$
+  Revision 1.2  2002-11-13 15:26:24  pierre
+   + digest program added
+
+}