147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
size_t numSucceeded = 0, numFailed = 0;
[OFStdOut writeFormat: @"Running %zu test case(s)\n",
testClasses.count];
for (Class class in testClasses) {
[OFStdOut setForegroundColor: [OFColor teal]];
[OFStdOut writeFormat: @"Running tests in %@\n", class];
[OFStdOut reset];
for (OFValue *test in [self testsInClass: class]) {
void *pool = objc_autoreleasePoolPush();
bool failed = false;
OTTestCase *instance;
|
|
>
>
|
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
size_t numSucceeded = 0, numFailed = 0;
[OFStdOut writeFormat: @"Running %zu test case(s)\n",
testClasses.count];
for (Class class in testClasses) {
[OFStdOut setForegroundColor: [OFColor teal]];
[OFStdOut writeFormat: @"Running ", class];
[OFStdOut setForegroundColor: [OFColor aqua]];
[OFStdOut writeFormat: @"%@\n", class];
[OFStdOut reset];
for (OFValue *test in [self testsInClass: class]) {
void *pool = objc_autoreleasePoolPush();
bool failed = false;
OTTestCase *instance;
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
} else
numFailed++;
objc_autoreleasePoolPop(pool);
}
}
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeFormat: @"%zu test(s) succeeded, %zu test(s) failed.\n",
numSucceeded, numFailed];
[OFStdOut reset];
[OFApplication terminateWithStatus: (int)numFailed];
}
@end
|
|
|
>
>
>
|
>
>
|
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
} else
numFailed++;
objc_autoreleasePoolPop(pool);
}
}
[OFStdOut setForegroundColor: [OFColor fuchsia]];
[OFStdOut writeFormat: @"%zu", numSucceeded];
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeString: @" test(s) succeeded, "];
[OFStdOut setForegroundColor: [OFColor fuchsia]];
[OFStdOut writeFormat: @"%zu", numFailed];
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeLine: @" test(s) failed."];
[OFStdOut reset];
[OFApplication terminateWithStatus: (int)numFailed];
}
@end
|