Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 2102

Show
Ignore:
Timestamp:
04/21/07 03:10:18 (2 years ago)
Author:
Gregor
Message:

patches/ImprovedUnitTests.diff: Made --d-unittests-only exit 0 on no failures.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/patches/ImprovedUnitTests.diff

    r2101 r2102  
    2222     for (uint i = 0; i < _moduleinfo_array.length; i++) 
    2323     { 
    24 @@ -1086,9 +1089,23 @@ 
     24@@ -1086,9 +1089,26 @@ 
    2525         debug(PRINTF) printf("\tmodule[%d] = '%.*s'\n", i, m.name); 
    2626         if (m.unitTest) 
     
    4242+        printf("TESTS: %d  PASSED: %d  FAILED: %d\n", 
    4343+               testCount, testCount - testFail, testFail); 
    44 +        exit(1); 
     44+        if (testFail == 0) 
     45+            exit(0); 
     46+        else 
     47+            exit(1); 
    4548+    } 
    4649 } 
     
    157160     for (uint i = 0; i < _moduleinfo_array.length; i++) 
    158161     { 
    159 @@ -1070,9 +1073,23 @@ 
     162@@ -1070,9 +1073,26 @@ 
    160163         debug(PRINTF) printf("\tmodule[%d] = '%.*s'\n", i, m.name); 
    161164         if (m.unitTest) 
     
    177180+        printf("TESTS: %d  PASSED: %d  FAILED: %d\n", 
    178181+               testCount, testCount - testFail, testFail); 
    179 +        exit(1); 
     182+        if (testFail == 0) 
     183+            exit(0); 
     184+        else 
     185+            exit(1); 
    180186+    } 
    181187 } 
    182188  
    183189 //////////////////////////////////////////////////////////////////////////////// 
     190Index: patches/ImprovedUnitTests.diff 
     191=================================================================== 
     192--- patches/ImprovedUnitTests.diff  (revision 2101) 
     193+++ patches/ImprovedUnitTests.diff  (working copy) 
     194@@ -21,7 +21,7 @@ 
     195      debug(PRINTF) printf("_moduleUnitTests()\n"); 
     196      for (uint i = 0; i < _moduleinfo_array.length; i++) 
     197      { 
     198-@@ -1086,9 +1089,23 @@ 
     199+@@ -1086,9 +1089,26 @@ 
     200          debug(PRINTF) printf("\tmodule[%d] = '%.*s'\n", i, m.name); 
     201          if (m.unitTest) 
     202          { 
     203@@ -41,7 +41,10 @@ 
     204 +    { 
     205 +        printf("TESTS: %d  PASSED: %d  FAILED: %d\n", 
     206 +               testCount, testCount - testFail, testFail); 
     207-+        exit(1); 
     208++        if (testFail == 0) 
     209++            exit(0); 
     210++        else 
     211++            exit(1); 
     212 +    } 
     213  } 
     214   
     215@@ -156,7 +159,7 @@ 
     216      debug(PRINTF) printf("_moduleUnitTests()\n"); 
     217      for (uint i = 0; i < _moduleinfo_array.length; i++) 
     218      { 
     219-@@ -1070,9 +1073,23 @@ 
     220+@@ -1070,9 +1073,26 @@ 
     221          debug(PRINTF) printf("\tmodule[%d] = '%.*s'\n", i, m.name); 
     222          if (m.unitTest) 
     223          { 
     224@@ -176,7 +179,10 @@ 
     225 +    { 
     226 +        printf("TESTS: %d  PASSED: %d  FAILED: %d\n", 
     227 +               testCount, testCount - testFail, testFail); 
     228-+        exit(1); 
     229++        if (testFail == 0) 
     230++            exit(0); 
     231++        else 
     232++            exit(1); 
     233 +    } 
     234  } 
     235