ObjFW  Diff

Differences From Artifact [a06b09228a]:

To Artifact [7e312d3965]:


143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
143
144
145
146
147
148
149

150
151
152
153
154
155
156
157







-
+







#elif defined(OF_NINTENDO_SWITCH)
	consoleInit(NULL);
	padConfigureInput(1, HidNpadStyleSet_NpadStandard);
	updateConsole(true);
#endif
}

- (OFSet OF_GENERIC(Class) *)testClasses
- (OFMutableSet OF_GENERIC(Class) *)testClasses
{
	Class *classes = objc_copyClassList(NULL);
	OFMutableSet *testClasses;

	if (classes == NULL)
		return nil;

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
178
179
180
181
182
183
184

185
186
187
188
189
190
191







-







		}
	} @finally {
		OFFreeMemory(classes);
	}

	[testClasses removeObject: [OTTestCase class]];

	[testClasses makeImmutable];
	return testClasses;
}

- (OFSet OF_GENERIC(OFValue *) *)testsInClass: (Class)class
{
	Method *methods = class_copyMethodList(class, NULL);
	OFMutableSet *tests;
398
399
400
401
402
403
404
405

406
407
408




















409
410

411
412
413
414
415
416
417
397
398
399
400
401
402
403

404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428

429
430
431
432
433
434
435
436







-
+



+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
+







	[description makeImmutable];

	return description;
}

- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
	OFSet OF_GENERIC(Class) *testClasses = [self testClasses];
	OFMutableSet OF_GENERIC(Class) *testClasses;
	size_t numSucceeded = 0, numFailed = 0, numSkipped = 0;
	OFMutableDictionary *summaries = [OFMutableDictionary dictionary];

	if ([OFApplication arguments].count > 0) {
		testClasses = [OFMutableSet set];

		for (OFString *className in [OFApplication arguments]) {
			Class class = objc_lookUpClass([className
			    cStringWithEncoding: OFStringEncodingASCII]);

			if (class == Nil ||
			    !isSubclassOfClass(class, [OTTestCase class])) {
				[OFStdErr writeFormat: @"%@ is not a valid "
						       @"test case!\n",
						       className];
				[OFApplication terminateWithStatus: 1];
			}

			[testClasses addObject: class];
		}
	} else
		testClasses = [self testClasses];

	[OFStdOut setForegroundColor: [OFColor purple]];
	[OFStdOut writeString: @"Found "];
	[OFStdOut writeString: @"Running "];
#if !defined(OF_WII) && !defined(OF_NINTENDO_DS) && \
    !defined(OF_NINTENDO_3DS) && !defined(OF_NINTENDO_SWITCH)
	[OFStdOut setForegroundColor: [OFColor fuchsia]];
#endif
	[OFStdOut writeFormat: @"%zu", testClasses.count];
	[OFStdOut setForegroundColor: [OFColor purple]];
	[OFStdOut writeFormat: @" test case%s\n",