ObjFW  Diff

Differences From Artifact [36e6efa285]:

To Artifact [d77755a8a2]:


18
19
20
21
22
23
24


25
26
27
28
29
30
31
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33







+
+







#import "OTAppDelegate.h"

#import "OFSet.h"
#import "OFValue.h"

#import "OTTestCase.h"

#import "OTAssertionFailedException.h"

OF_APPLICATION_DELEGATE(OTAppDelegate)

@implementation OTAppDelegate
- (OFSet OF_GENERIC(Class) *)testClasses
{
	Class *classes = objc_copyClassList(NULL);
	OFMutableSet *testClasses;
84
85
86
87
88
89
90

91
92
93


















94
95
96
97
98
99
100
101
86
87
88
89
90
91
92
93



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119







+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+









	for (Class class in testClasses) {
		for (OFValue *test in [self testsInClass: class]) {
			void *pool = objc_autoreleasePoolPush();
			OTTestCase *instance =
			    [[[class alloc] init] autorelease];

			@try {
			[instance setUp];
			[instance performSelector: test.pointerValue];
			[instance tearDown];
				[instance setUp];
				[instance performSelector: test.pointerValue];
			} @catch (OTAssertionFailedException *e) {
				/*
				 * If an assertion during -[setUp], don't run
				 * the test.
				 * If an assertion fails during a test, abort
				 * the test.
				 */
			}
			@try {
				[instance tearDown];
			} @catch (OTAssertionFailedException *e) {
				/*
				 * If an assertion fails during -[tearDown],
				 * abort the tear down.
				 */
			}

			objc_autoreleasePoolPop(pool);
		}
	}

	[OFApplication terminate];
}
@end