Created
November 8, 2019 22:52
Revisions
-
ob created this gist
Nov 8, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ #import <Foundation/Foundation.h> #import <XCTest/XCTest.h> @interface TestDumper : NSObject @end @implementation TestDumper + (void)load { NSBundle *mainBundle = [NSBundle mainBundle]; NSString *pluginsPath = [mainBundle builtInPlugInsPath]; NSArray* xcTests = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pluginsPath error:Nil]; for (NSString *xcTestBundlePath in xcTests) { NSString *ext = [xcTestBundlePath pathExtension]; if (![ext isEqual:@"xctest"]) { NSLog(@"Skipping %@ - %@", xcTestBundlePath, ext); continue; } NSString *path = [pluginsPath stringByAppendingPathComponent:xcTestBundlePath]; NSLog(@"Loading %@", path); NSBundle *bundle = [NSBundle bundleWithPath:path]; if (!bundle) { printf("bundle failed to load!\n"); perror("bundle"); exit(1); } NSError *err; if (![bundle loadAndReturnError:&err]) { NSLog(@"Failed to load bundle: %@: %@", path, err); } } XCTestSuite *dtest = [XCTestSuite defaultTestSuite]; if (!dtest) { printf("failed in XCTestSuite\n"); exit(1); } for (XCTestSuite *testSuite in [dtest tests]) { NSLog(@"Loaded %@", [testSuite name]); for (XCTestSuite *ts in [testSuite tests]) { NSLog(@"Loaded %@", [ts name]); for (XCTest *t in [ts tests]) { NSLog(@"Test: %@", [t name]); } } } // don't actually run the app exit(0); } @end