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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « class-dump/src/UnitTests/AllTests.h ('k') | class-dump/src/UnitTests/CDPathUnitTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: class-dump/src/UnitTests/AllTests.m
===================================================================
--- class-dump/src/UnitTests/AllTests.m (revision 0)
+++ class-dump/src/UnitTests/AllTests.m (revision 0)
@@ -0,0 +1,107 @@
+#import "AllTests.h"
+
+#import "CDPathUnitTest.h"
+#import "CDTypeLexerUnitTest.h"
+#import "CDTypeParserUnitTest.h"
+#import "CDTypeFormatterUnitTest.h"
+#import "CDStructHandlingUnitTest.h"
+
+@interface NSObject (SenTestRuntimeUtilities)
+
+- (NSArray *) senAllSubclasses;
+- (NSArray *) senInstanceInvocations;
+- (NSArray *) senAllInstanceInvocations;
+
+@end
+
+
+@implementation AllTests
+
+// This is here to help me understand what the original method does. Formatting/naming is key to understanding.
++ (void)_foo_updateCache;
+{
+ NSEnumerator *testCaseEnumerator;
+ id testCaseClass = nil;
+
+ testCaseEnumerator = [[SenTestCase senAllSubclasses] objectEnumerator];
+ testCaseClass = [testCaseEnumerator nextObject];
+ while (testCaseClass != nil) {
+ NSString *path;
+ SenTestSuite *suite;
+
+ NSLog(@"%s, testCaseClass: %@[%@]", _cmd, testCaseClass, NSStringFromClass(testCaseClass));
+ NSLog(@"%s, self: %p, testCaseClass: %p", _cmd, self, testCaseClass);
+ if (testCaseClass != self) {
+ NSLog(@"default test suite: %@", [testCaseClass defaultTestSuite]);
+ }
+#if 0
+ path = [[testCase bundle] bundlePath];
+ suite = [suiteForBundleCache objectForKey:path];
+
+ if (suite == nil) {
+ suite = [self emptyTestSuiteNamedFromPath:path];
+ [suiteForBundleCache setObject:suite forKey:path];
+ }
+
+ [suite addTest:[testCase defaultTestSuite]];
+#endif
+ testCaseClass = [testCaseEnumerator nextObject];
+ }
+}
+
+
+
++ (id)defaultTestSuite;
+{
+ SenTestSuite *allTests, *orderedTests, *unorderedTests;
+ NSMutableArray *order;
+ unsigned int count, index;
+
+ order = [NSMutableArray array];
+ [order addObject:[CDPathUnitTest class]];
+ [order addObject:[CDTypeLexerUnitTest class]];
+ [order addObject:[CDTypeParserUnitTest class]];
+ //[order addObject:[CDTypeFormatterUnitTest class]];
+ [order addObject:[CDStructHandlingUnitTest class]];
+ [order addObject:[CDTypeFormatterUnitTest class]];
+
+ NSLog(@"order: %@", order);
+
+ allTests = [SenTestSuite testSuiteWithName:@"All Tests"];
+ orderedTests = [SenTestSuite testSuiteWithName:@"Order"];
+ unorderedTests = [SenTestSuite testSuiteWithName:@"Chaos"];
+ [allTests addTest:orderedTests];
+ [allTests addTest:unorderedTests];
+
+ // First, set up the tests we want run in a particular order
+ count = [order count];
+ for (index = 0; index < count; index++)
+ [orderedTests addTest:[SenTestSuite testSuiteForTestCaseClass:[order objectAtIndex:index]]];
+
+ // Then search for any tests that we didn't get from the manual setup above
+ {
+ NSMutableSet *used = [NSMutableSet set];
+ NSArray *allTestCaseSubclasses;
+
+ [used addObjectsFromArray:order];
+ [used addObject:self];
+ [used addObject:[SenInterfaceTestCase class]]; // Dunno why it's picking this up, skip it.
+
+ allTestCaseSubclasses = [SenTestCase senAllSubclasses];
+ count = [allTestCaseSubclasses count];
+ for (index = 0; index < count; index++) {
+ id aClass;
+
+ aClass = [allTestCaseSubclasses objectAtIndex:index];
+ if ([used containsObject:aClass] == NO) {
+ //[unorderedTests addTest:[SenTestSuite testSuiteForTestCaseClass:aClass]];
+ [unorderedTests addTest:[aClass defaultTestSuite]];
+ [used addObject:aClass];
+ }
+ }
+ }
+
+ return allTests;
+}
+
+@end
Property changes on: class-dump/src/UnitTests/AllTests.m
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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