Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: class-dump/src/UnitTests/AllTests.m

Issue 7793008: Add the 3.3.3 sources for class-dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « class-dump/src/UnitTests/AllTests.h ('k') | class-dump/src/UnitTests/CDPathUnitTest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #import "AllTests.h"
2
3 #import "CDPathUnitTest.h"
4 #import "CDTypeLexerUnitTest.h"
5 #import "CDTypeParserUnitTest.h"
6 #import "CDTypeFormatterUnitTest.h"
7 #import "CDStructHandlingUnitTest.h"
8
9 @interface NSObject (SenTestRuntimeUtilities)
10
11 - (NSArray *) senAllSubclasses;
12 - (NSArray *) senInstanceInvocations;
13 - (NSArray *) senAllInstanceInvocations;
14
15 @end
16
17
18 @implementation AllTests
19
20 // This is here to help me understand what the original method does. Formatting /naming is key to understanding.
21 + (void)_foo_updateCache;
22 {
23 NSEnumerator *testCaseEnumerator;
24 id testCaseClass = nil;
25
26 testCaseEnumerator = [[SenTestCase senAllSubclasses] objectEnumerator];
27 testCaseClass = [testCaseEnumerator nextObject];
28 while (testCaseClass != nil) {
29 NSString *path;
30 SenTestSuite *suite;
31
32 NSLog(@"%s, testCaseClass: %@[%@]", _cmd, testCaseClass, NSStringFromCla ss(testCaseClass));
33 NSLog(@"%s, self: %p, testCaseClass: %p", _cmd, self, testCaseClass);
34 if (testCaseClass != self) {
35 NSLog(@"default test suite: %@", [testCaseClass defaultTestSuite]);
36 }
37 #if 0
38 path = [[testCase bundle] bundlePath];
39 suite = [suiteForBundleCache objectForKey:path];
40
41 if (suite == nil) {
42 suite = [self emptyTestSuiteNamedFromPath:path];
43 [suiteForBundleCache setObject:suite forKey:path];
44 }
45
46 [suite addTest:[testCase defaultTestSuite]];
47 #endif
48 testCaseClass = [testCaseEnumerator nextObject];
49 }
50 }
51
52
53
54 + (id)defaultTestSuite;
55 {
56 SenTestSuite *allTests, *orderedTests, *unorderedTests;
57 NSMutableArray *order;
58 unsigned int count, index;
59
60 order = [NSMutableArray array];
61 [order addObject:[CDPathUnitTest class]];
62 [order addObject:[CDTypeLexerUnitTest class]];
63 [order addObject:[CDTypeParserUnitTest class]];
64 //[order addObject:[CDTypeFormatterUnitTest class]];
65 [order addObject:[CDStructHandlingUnitTest class]];
66 [order addObject:[CDTypeFormatterUnitTest class]];
67
68 NSLog(@"order: %@", order);
69
70 allTests = [SenTestSuite testSuiteWithName:@"All Tests"];
71 orderedTests = [SenTestSuite testSuiteWithName:@"Order"];
72 unorderedTests = [SenTestSuite testSuiteWithName:@"Chaos"];
73 [allTests addTest:orderedTests];
74 [allTests addTest:unorderedTests];
75
76 // First, set up the tests we want run in a particular order
77 count = [order count];
78 for (index = 0; index < count; index++)
79 [orderedTests addTest:[SenTestSuite testSuiteForTestCaseClass:[order obj ectAtIndex:index]]];
80
81 // Then search for any tests that we didn't get from the manual setup above
82 {
83 NSMutableSet *used = [NSMutableSet set];
84 NSArray *allTestCaseSubclasses;
85
86 [used addObjectsFromArray:order];
87 [used addObject:self];
88 [used addObject:[SenInterfaceTestCase class]]; // Dunno why it's picking this up, skip it.
89
90 allTestCaseSubclasses = [SenTestCase senAllSubclasses];
91 count = [allTestCaseSubclasses count];
92 for (index = 0; index < count; index++) {
93 id aClass;
94
95 aClass = [allTestCaseSubclasses objectAtIndex:index];
96 if ([used containsObject:aClass] == NO) {
97 //[unorderedTests addTest:[SenTestSuite testSuiteForTestCaseClas s:aClass]];
98 [unorderedTests addTest:[aClass defaultTestSuite]];
99 [used addObject:aClass];
100 }
101 }
102 }
103
104 return allTests;
105 }
106
107 @end
OLDNEW
« no previous file with comments | « class-dump/src/UnitTests/AllTests.h ('k') | class-dump/src/UnitTests/CDPathUnitTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698