* test_run no longer take in account skipped tests in the summary. 11/9811/2
Sylvestre Ledru [Tue, 27 Nov 2012 12:09:25 +0000 (13:09 +0100)]
  See bug #12117

Change-Id: Icfeac616fc3f0972dca9513b8950c66dacdcb20b

scilab/CHANGES_5.4.X
scilab/modules/development_tools/macros/test_run.sci

index c2efe0e..a3c4897 100644 (file)
@@ -14,6 +14,9 @@ Improvements
 
 * clc(): New icon in the toolbar to clear the console. See bug #12049.
 
+* test_run no longer take in account skipped tests in the summary.
+  See bug #12117
+
 
 Removed functions
 ==================
index 66df5cc..0ecca62 100644 (file)
@@ -161,10 +161,12 @@ function test_run_result = test_run(varargin)
       if params.reference <> "list" then
         status.detailled_failures   = [status.detailled_failures; result.detailled_failures];
         status.testsuites(size(status.testsuites,"*")+1) = result.testsuite
-        status.test_count           = status.test_count + result.test_count;
+        status.test_skipped_count   = status.test_skipped_count + result.test_skipped_count;
+
+        // Do not take in account skipped tests
+        status.test_count           = status.test_count + result.test_count - status.test_skipped_count;
         status.test_passed_count    = status.test_passed_count + result.test_passed_count;
         status.test_failed_count    = status.test_failed_count + result.test_failed_count;
-        status.test_skipped_count   = status.test_skipped_count + result.test_skipped_count;
         status.totalTime            = status.totalTime + result.totalTime;
         printf("\n");
       else
@@ -201,16 +203,20 @@ function test_run_result = test_run(varargin)
       if params.reference <> "list" then
         status.detailled_failures       = [status.detailled_failures; result.detailled_failures];
         status.testsuites(size(status.testsuites,"*")+1) = result.testsuite
+
+        status.test_skipped_count   = status.test_skipped_count + result.test_skipped_count;
         status.test_passed_count    = status.test_passed_count + result.test_passed_count;
         status.test_failed_count    = status.test_failed_count + result.test_failed_count;
-        status.test_skipped_count   = status.test_skipped_count + result.test_skipped_count;
         status.totalTime            = status.totalTime + result.totalTime;
+
         printf("\n");
       else
         status.test_count           = status.test_count + result.test_count;
         status.list                 = [status.list; result.list];
       end
     end
+    // Do not take in account skipped tests
+    status.test_count = status.test_count - status.test_skipped_count;
   elseif or(rhs==[2 3 4]) then
 // Two input arguments
 // test_run(<module_name>,<test_name>)
@@ -235,10 +241,12 @@ function test_run_result = test_run(varargin)
       status.totalTime            = result.totalTime;
       status.detailled_failures   = [status.detailled_failures; result.detailled_failures];
       status.testsuites(size(status.testsuites,"*")+1) = result.testsuite
-      status.test_count           = status.test_count + result.test_count;
+      status.test_skipped_count   = status.test_skipped_count + result.test_skipped_count;
+
+      // Do not take in account skipped tests
+      status.test_count           = status.test_count + result.test_count - status.test_skipped_count;
       status.test_passed_count    = status.test_passed_count + result.test_passed_count;
       status.test_failed_count    = status.test_failed_count + result.test_failed_count;
-      status.test_skipped_count   = status.test_skipped_count + result.test_skipped_count;
     else
       status.test_count           = status.test_count + result.test_count;
       status.list                 = [status.list; result.list];
@@ -255,14 +263,12 @@ function test_run_result = test_run(varargin)
     return;
   end
 
-  //pourcent computation
+  // percent computation
   if status.test_count <> 0 then
     test_passed_percent  = status.test_passed_count  / status.test_count * 100;
-    test_skipped_percent = status.test_skipped_count / status.test_count * 100;
     test_failed_percent  = status.test_failed_count  / status.test_count * 100;
   else
     test_passed_percent  = 0;
-    test_skipped_percent = 0;
     test_failed_percent  = 0;
   end
 
@@ -274,15 +280,15 @@ function test_run_result = test_run(varargin)
     printf("\n");
     printf("   --------------------------------------------------------------------------\n");
     printf("   Summary\n\n");
-    printf("   tests           %4d - 100 %% \n", status.test_count);
-    printf("   passed          %4d - %3d %% \n", status.test_passed_count , test_passed_percent);
-    printf("   failed          %4d - %3d %% \n", status.test_failed_count , test_failed_percent);
-    printf("   skipped         %4d - %3d %% \n", status.test_skipped_count, test_skipped_percent);
-    printf("   length             %4.2f sec \n", status.totalTime);
+    printf("   tests           %4d - 100 %%\n", status.test_count);
+    printf("   passed          %4d - %3d %%\n", status.test_passed_count, test_passed_percent);
+    printf("   failed          %4d - %3d %%\n", status.test_failed_count, test_failed_percent);
+    printf("   skipped         %4d\n", status.test_skipped_count);
+    printf("   length             %4.2f sec\n", status.totalTime);
     printf("   --------------------------------------------------------------------------\n");
 
     if isfield(params, "exportFile") then
-      printf("   Export to          %s \n", params.exportFile);
+      printf("   Export to          %s\n", params.exportFile);
       printf("   --------------------------------------------------------------------------\n");
     end