 |
Changeset 2102
- 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
| r2101 |
r2102 |
|
| 22 | 22 | for (uint i = 0; i < _moduleinfo_array.length; i++) |
|---|
| 23 | 23 | { |
|---|
| 24 | | @@ -1086,9 +1089,23 @@ |
|---|
| | 24 | @@ -1086,9 +1089,26 @@ |
|---|
| 25 | 25 | debug(PRINTF) printf("\tmodule[%d] = '%.*s'\n", i, m.name); |
|---|
| 26 | 26 | if (m.unitTest) |
|---|
| … | … | |
| 42 | 42 | + printf("TESTS: %d PASSED: %d FAILED: %d\n", |
|---|
| 43 | 43 | + testCount, testCount - testFail, testFail); |
|---|
| 44 | | + exit(1); |
|---|
| | 44 | + if (testFail == 0) |
|---|
| | 45 | + exit(0); |
|---|
| | 46 | + else |
|---|
| | 47 | + exit(1); |
|---|
| 45 | 48 | + } |
|---|
| 46 | 49 | } |
|---|
| … | … | |
| 157 | 160 | for (uint i = 0; i < _moduleinfo_array.length; i++) |
|---|
| 158 | 161 | { |
|---|
| 159 | | @@ -1070,9 +1073,23 @@ |
|---|
| | 162 | @@ -1070,9 +1073,26 @@ |
|---|
| 160 | 163 | debug(PRINTF) printf("\tmodule[%d] = '%.*s'\n", i, m.name); |
|---|
| 161 | 164 | if (m.unitTest) |
|---|
| … | … | |
| 177 | 180 | + printf("TESTS: %d PASSED: %d FAILED: %d\n", |
|---|
| 178 | 181 | + testCount, testCount - testFail, testFail); |
|---|
| 179 | | + exit(1); |
|---|
| | 182 | + if (testFail == 0) |
|---|
| | 183 | + exit(0); |
|---|
| | 184 | + else |
|---|
| | 185 | + exit(1); |
|---|
| 180 | 186 | + } |
|---|
| 181 | 187 | } |
|---|
| 182 | 188 | |
|---|
| 183 | 189 | //////////////////////////////////////////////////////////////////////////////// |
|---|
| | 190 | Index: 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 | |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic