Pārlūkot izejas kodu

Added the possibilty to skip tests unconditionally. This is useful when a test is added to trunk for a feature that is not yet implemented, but the test should be added nevertheless. The "command" is simply "skip".
Tests that are skipped counted individually and their counted is added to the database as well (there a column needs to be added).
Skipped tests can be forced using the "-A" parameter.

git-svn-id: branches/svenbarth/misc@19411 -

svenbarth 14 gadi atpakaļ
vecāks
revīzija
f01173142f

+ 8 - 1
tests/utils/digest.pp

@@ -36,6 +36,7 @@ const
   skipping_other_target_count : longint = 0;
   skipping_run_unit_count : longint = 0;
   skipping_run_test_count : longint = 0;
+  skipping_unconditionally_count : longint = 0;
   unknown_lines : longint = 0;
   unexpected_run : longint = 0;
   next_should_be_run : boolean = false;
@@ -116,6 +117,10 @@ begin
     begin
       inc(skipping_other_cpu_count);
     end
+  else if pos(skipping_test,st)=1 then
+    begin
+      inc(skipping_unconditionally_count);
+    end
   else if pos(skipping_other_target,st)=1 then
     begin
       inc(skipping_other_target_count);
@@ -190,11 +195,13 @@ begin
     +skipping_known_bug_count
     +skipping_other_version_count
     +skipping_other_cpu_count
-    +skipping_other_target_count;
+    +skipping_other_target_count
+    +skipping_unconditionally_count;
   { don't count these ones ...
     skipping_run_unit_count
     skipping_run_test_count }
   Writeln('Number of skipped tests = ',number_skipped);
+  Writeln('Number of unconditionally skipped tests = ',skipping_unconditionally_count);
   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);

+ 12 - 0
tests/utils/dotest.pp

@@ -1490,6 +1490,18 @@ begin
       Verbose(V_Debug,'Using Execution logfile: '+ExeLogFile);
     end;
 
+  if Res then
+   begin
+     if Config.Skip and not DoAll then
+      begin
+        AddLog(ResLogFile,skipping_test+PPFileInfo[current]);
+        { avoid a second attempt by writing to elg file }
+        AddLog(EXELogFile,skipping_test+PPFileInfo[current]);
+        Verbose(V_Warning,skipping_test);
+        Res:=false;
+      end;
+   end;
+
   if Res then
    begin
      if Config.UsesGraph and (not DoGraph) then

+ 1 - 0
tests/utils/tests.sql

@@ -65,6 +65,7 @@ CREATE TABLE TESTRUN (
   TU_SUBMITTER varchar(128) NOT NULL default '',
   TU_MACHINE varchar(128) NOT NULL default '',
   TU_COMMENT varchar(255) NOT NULL default '',
+  TU_SKIPPEDUNCONDITIONALLY int(11) NOT NULL default '0',
   PRIMARY KEY  (TU_ID),
   UNIQUE KEY TU_OVERVIEW (TU_ID,TU_CPU_FK,TU_OS_FK,TU_VERSION_FK,TU_DATE),
   KEY TU_IDATE (TU_DATE)

+ 1 - 0
tests/utils/teststr.pp

@@ -26,6 +26,7 @@ const
   successfully_compiled = 'Successfully compiled ';
   failed_to_run = 'Failed to run ';
   successfully_run = 'Successfully run ';
+  skipping_test = 'Unconditionally skipping test ';
   skipping_graph_test = 'Skipping test because it uses graph ';
   skipping_interactive_test = 'Skipping test because it is interactive ';
   skipping_known_bug = 'Skipping test because it is a known bug ';

+ 4 - 0
tests/utils/testu.pp

@@ -41,6 +41,7 @@ type
     Files         : string;
     WpoParas      : string;
     WpoPasses     : longint;
+    Skip          : boolean;
   end;
 
 Const
@@ -276,6 +277,9 @@ begin
                 if GetEntry('WPOPASSES') then
                  val(res,r.wpopasses,code)
               else
+                if GetEntry('SKIP') then
+                 r.Skip:=true
+              else 
                Verbose(V_Error,'Unknown entry: '+s);
             end;
          end

+ 13 - 7
tests/utils/tresults.pp

@@ -42,13 +42,14 @@ Type
   stSkippingOtherCpu,
   stSkippingOtherTarget,
   stskippingRunUnit,
-  stskippingRunTest
+  stskippingRunTest,
+  stskippungUnconditionally
   );
 
 
 Const
   FirstStatus = stFailedToCompile;
-  LastStatus = stskippingRunTest;
+  LastStatus = stskippingUnconditionally;
 
   TestOK : Array[TTestStatus] of Boolean = (
     False, // stFailedToCompile,
@@ -66,7 +67,8 @@ Const
     False, // stSkippingOtherCpu,
     False, // stSkippingOtherTarget,
     False, // stskippingRunUnit,
-    False  // stskippingRunTest
+    False, // stskippingRunTest,
+    False  // stskippingUnconditionally
   );
 
   TestSkipped : Array[TTestStatus] of Boolean = (
@@ -85,7 +87,8 @@ Const
     True,   // stSkippingOtherCpu,
     True,   // stSkippingOtherTarget,
     True,   // stskippingRunUnit,
-    True    // stskippingRunTest
+    True,   // stskippingRunTest,
+    True    // stskippingUnconditionally
   );
 
   ExpectRun : Array[TTestStatus] of Boolean = (
@@ -104,7 +107,8 @@ Const
     False,  // stSkippingOtherCpu,
     False,  // stSkippingOtherTarget,
     False,  // stskippingRunUnit,
-    False   // stskippingRunTest
+    False,  // stskippingRunTest,
+    False,  // stskippingUnconditionally
    );
 
   StatusText : Array[TTestStatus] of String = (
@@ -123,7 +127,8 @@ Const
     skipping_other_cpu ,
     skipping_other_target ,
     skipping_run_unit ,
-    skipping_run_test
+    skipping_run_test ,
+    skipping_test
   );
 
   SQLField : Array[TTestStatus] of String = (
@@ -142,7 +147,8 @@ Const
     'TU_OTHERCPU',
     'TU_OTHERTARGET',
     'TU_UNIT',
-    'TU_SKIPPINGRUNTEST'
+    'TU_SKIPPINGRUNTEST',
+    'TU_SKIPPEDUNCONDITIONALLY'
   );