├── .gitignore ├── CodeCoverage ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-83.5@2x.png │ │ ├── Icon-Notification.png │ │ ├── Icon-Notification@2x.png │ │ ├── Icon-Notification@3x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── icon.png │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── TestView.h ├── TestView.m ├── ViewController.swift └── bar.c ├── CodeCoverageTests ├── Info.plist ├── ObjcCoverageTests.m └── SwiftCoverageTests.swift ├── CodeCoverageUITests ├── CodeCoverageUITests.swift └── Info.plist ├── LOLzwagon.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── lolgrep.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcshareddata │ └── xcschemes │ │ ├── Aggressive CodeCoverage.xcscheme │ │ ├── CodeCoverage.xcscheme │ │ └── LOLzwagon.xcscheme └── xcuserdata │ ├── derekselander.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── lolgrep.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── LOLzwagon └── LOLzwagon.m ├── README.md └── media ├── logo.png ├── scheme.png ├── screen1.png └── screen2.png /.gitignore: -------------------------------------------------------------------------------- 1 | /.DS_Store 2 | /LOLzwagon.xcodeproj/project.xcworkspace/xcuserdata/derekselander.xcuserdatad/UserInterfaceState.xcuserstate 3 | /LOLzwagon.xcodeproj/xcuserdata/derekselander.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist 4 | -------------------------------------------------------------------------------- /CodeCoverage/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CodeCoverage 4 | // 5 | // Created by Derek Selander on 1/27/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | let a : Int? = nil 16 | var someInt : Int? = 4 { 17 | willSet { print("willSet \(newValue ?? 0)") } 18 | didSet { print("didSet \(oldValue ?? 0)") } 19 | } 20 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 21 | // Override point for customization after application launch. 22 | return true 23 | } 24 | 25 | func applicationWillResignActive(_ application: UIApplication) { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 28 | } 29 | 30 | func applicationDidEnterBackground(_ application: UIApplication) { 31 | 32 | if UIApplication.shared.delegate is AppDelegate { 33 | print("do some stuff") 34 | } else { 35 | print("do some other stuff") 36 | } 37 | 38 | } 39 | 40 | func applicationWillEnterForeground(_ application: UIApplication) { 41 | 42 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 43 | } 44 | 45 | func applicationDidBecomeActive(_ application: UIApplication) { 46 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 47 | } 48 | 49 | func applicationWillTerminate(_ application: UIApplication) { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Notification@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Notification@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-Small@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-Small@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-Small-40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-Small-40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-Notification.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-Notification@2x.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-Small.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-Small@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-Small-40.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-Small-40@2x.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-76.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-83.5@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "1024x1024", 107 | "idiom" : "ios-marketing", 108 | "filename" : "icon.png", 109 | "scale" : "1x" 110 | } 111 | ], 112 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | } 116 | } -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Notification.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Notification@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Notification@2x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Notification@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Notification@3x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/AppIcon.appiconset/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/CodeCoverage/Assets.xcassets/AppIcon.appiconset/icon.png -------------------------------------------------------------------------------- /CodeCoverage/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CodeCoverage/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /CodeCoverage/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /CodeCoverage/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /CodeCoverage/TestView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestView.h 3 | // CodeCoverage 4 | // 5 | // Created by Derek Selander on 1/27/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestView : UIView 14 | @property (nonatomic, strong) UIView *someView; 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /CodeCoverage/TestView.m: -------------------------------------------------------------------------------- 1 | 2 | // TestView.m 3 | // CodeCoverage 4 | // 5 | // Created by Derek Selander on 1/27/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | #import "TestView.h" 10 | 11 | @implementation TestView 12 | 13 | 14 | bool shouldDoStuff = NO; 15 | // load will work, loads should not ever execute 16 | //+ (void)load { 17 | // NSLog(@"woot woot loaded"); 18 | // [self test]; 19 | // shouldDoStuff = YES; 20 | // [self test]; 21 | //} 22 | 23 | //void aSimpleFunc(int a, int b) { 24 | // 25 | //} 26 | 27 | + (void)test { 28 | int f = 0; 29 | if (shouldDoStuff) { 30 | f = 5; 31 | } else { 32 | f = 6; 33 | } 34 | printf("%d\n", f); 35 | 36 | } 37 | 38 | + (void)dammit { 39 | if (shouldDoStuff) { 40 | printf("how did I get here!?\n"); 41 | } else { 42 | printf("wooooooooooooooooooooot\n"); 43 | } 44 | } 45 | 46 | 47 | - (int)codecovClosure { 48 | int (^blockTest)(int) = ^int(int a) { 49 | if (a == 2) { 50 | return a; 51 | } 52 | return a * a; 53 | }; 54 | 55 | 56 | 57 | return blockTest(4); 58 | } 59 | @end 60 | -------------------------------------------------------------------------------- /CodeCoverage/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // CodeCoverage 4 | // 5 | // Created by Derek Selander on 1/27/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | var v : UIView? = UIView() 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | self.ifInputMethod(input: false) 17 | if self.v == nil { 18 | print("v is nil!") 19 | } 20 | else { 21 | print("v is not nil!") 22 | } 23 | // Do any additional setup after loading the view, typically from a nib. 24 | } 25 | 26 | func doSomeStuff() { 27 | print("did this work?") 28 | } 29 | 30 | func ifInputMethod(input : Bool) { 31 | if input { 32 | print("do something") 33 | } else { 34 | print("do something else") 35 | } 36 | } 37 | 38 | // func ifLetMethod() { 39 | // if let g = self.v { 40 | // print("do something \(g)") 41 | // } else { 42 | // print("do something else") 43 | // } 44 | // } 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /CodeCoverage/bar.c: -------------------------------------------------------------------------------- 1 | // 2 | // bar.c 3 | // CodeCoverage 4 | // 5 | // Created by Derek Selander on 1/30/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | //int foo() { 12 | //return 42; 13 | //} 14 | // 15 | //int bar() { 16 | // return 13; 17 | // 18 | // } 19 | -------------------------------------------------------------------------------- /CodeCoverageTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CodeCoverageTests/ObjcCoverageTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ObjcCoverageTests.m 3 | // CodeCoverageTests 4 | // 5 | // Created by Derek Selander on 1/27/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ObjcCoverageTests : XCTestCase 12 | @end 13 | 14 | @implementation ObjcCoverageTests 15 | 16 | - (void)testAssertNil { 17 | XCTAssertNil([UIViewController new], @"UIViewController should be nil"); 18 | } 19 | 20 | - (void)testAssertFail { 21 | XCTFail(@"womp womp. I spilled my ice cream"); 22 | } 23 | 24 | - (void)testAssertNotNil { 25 | XCTAssertNotNil(nil, "This clearly should be nil"); 26 | } 27 | 28 | - (void)testAssert { 29 | XCTAssert(3==6, @"3 should equal 6"); 30 | } 31 | 32 | - (void)testAssertTrue { 33 | XCTAssertTrue(NO, "No should equal YES"); 34 | } 35 | 36 | - (void)testAssertFalse { 37 | XCTAssertFalse(YES, "YES should equal NO"); 38 | } 39 | 40 | - (void)testAssertEqualObjects { 41 | XCTAssertEqualObjects(@"Yep", @"Nope", @"\"Yep\" and \"Nope\" should be equal"); 42 | } 43 | 44 | - (void)testAssertNotEqualObjects { 45 | XCTAssertNotEqualObjects(@55, @55, @"55 should not equal 55"); 46 | } 47 | 48 | - (void)testAssertEqual { 49 | XCTAssertEqual(23, 45, @"23 == 45"); 50 | } 51 | 52 | - (void)testAssertNotEqual { 53 | XCTAssertNotEqual(420, 420, @"whoah brooo.... where am I?"); 54 | } 55 | 56 | - (void)testAssertEqualWithAccuracy { 57 | XCTAssertEqualWithAccuracy(23, 54, 0, @"23 == 54"); 58 | } 59 | 60 | - (void)testAssertNotEqualWithAccuracy { 61 | XCTAssertEqualWithAccuracy(-54, 54, 0, @"54 != 54"); 62 | } 63 | 64 | - (void)testExpectation { 65 | XCTestExpectation *exp = [self expectationWithDescription:@"Some expectation here"]; 66 | [self waitForExpectations:@[exp] timeout:0]; 67 | } 68 | 69 | - (void)testOverfulfill { 70 | XCTestExpectation *exp = [self expectationWithDescription:@"Some expectation here"]; 71 | [exp fulfill]; 72 | [exp fulfill]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /CodeCoverageTests/SwiftCoverageTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftCoverageTests.swift 3 | // CodeCoverageTests 4 | // 5 | // Created by Derek Selander on 1/27/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import CodeCoverage 11 | 12 | class SwiftCoverageTests: XCTestCase { 13 | 14 | func testAssert() { 15 | // let vc = ViewController() 16 | // vc.v = nil 17 | // XCTAssert(vc.v != nil, "ViewController's view shouldn't be nil") 18 | } 19 | 20 | func testAssertEqual() { 21 | XCTAssertEqual(10, 11, "10 should equal 11") 22 | } 23 | 24 | func testAssertNotEqual() { 25 | XCTAssertNotEqual(44, 44, "44 should not equal itself") 26 | } 27 | 28 | func testAssertFalse() { 29 | // let vc = ViewController() 30 | // vc.v = nil 31 | // XCTAssertFalse(true, "True should be false") 32 | } 33 | 34 | func testAssertGreaterThan() { 35 | XCTAssertGreaterThan(0, 0, "0 should be greater than 0") 36 | } 37 | 38 | func testAssertLessThan() { 39 | XCTAssertLessThan(0, 0, "0 should be less than 0") 40 | } 41 | 42 | func testAssertGreaterThanOrEqual() { 43 | XCTAssertGreaterThanOrEqual(0, 1, "1 should be greater than 0") 44 | } 45 | 46 | func testAssertLessThanOrEqual() { 47 | XCTAssertLessThanOrEqual(1, 0, "0 should be greater than 1") 48 | } 49 | 50 | func testAssertNil() { 51 | XCTAssertNil(UIView(), "Some message where we should be nil here") 52 | } 53 | 54 | func testAssertNotNil() { 55 | XCTAssertNotNil(nil, "nil should not be nil") 56 | } 57 | 58 | func testAssertTrue() { 59 | XCTAssertTrue(false, "False should be true") 60 | } 61 | 62 | func testFail() { 63 | XCTFail("Screw it, let's die") 64 | } 65 | 66 | func testExpectation() { 67 | let exp = expectation(description: "Expectation should complete") 68 | self.wait(for: [exp], timeout: 0) 69 | } 70 | 71 | func testExpectationOverfulfill() { 72 | let exp = expectation(description: "Expectation should complete") 73 | exp.fulfill() 74 | exp.fulfill() 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /CodeCoverageUITests/CodeCoverageUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CodeCoverageUITests.swift 3 | // CodeCoverageUITests 4 | // 5 | // Created by Derek Selander on 1/27/19. 6 | // Copyright © 2019 Derek Selander. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class CodeCoverageUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | 16 | // In UI tests it is usually best to stop immediately when a failure occurs. 17 | continueAfterFailure = false 18 | 19 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 20 | XCUIApplication().launch() 21 | 22 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 23 | } 24 | 25 | override func tearDown() { 26 | // Put teardown code here. This method is called after the invocation of each test method in the class. 27 | } 28 | 29 | func testExample() { 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /CodeCoverageUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3FF59F3621FE4B2E0035992C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3FF59F3421FE4B2E0035992C /* Main.storyboard */; }; 11 | 3FF59F3821FE4B2F0035992C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3FF59F3721FE4B2F0035992C /* Assets.xcassets */; }; 12 | 3FF59F3B21FE4B2F0035992C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3FF59F3921FE4B2F0035992C /* LaunchScreen.storyboard */; }; 13 | 3FF59F4621FE4B2F0035992C /* SwiftCoverageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FF59F4521FE4B2F0035992C /* SwiftCoverageTests.swift */; }; 14 | 3FF59F5121FE4B2F0035992C /* CodeCoverageUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FF59F5021FE4B2F0035992C /* CodeCoverageUITests.swift */; }; 15 | 3FF59F7821FE6A630035992C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FF59F3021FE4B2E0035992C /* AppDelegate.swift */; }; 16 | A66BE0C122031C5A00F20193 /* LOLzwagon.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FF59F7021FE4BA40035992C /* LOLzwagon.m */; }; 17 | A66BE0C222031CE300F20193 /* bar.c in Sources */ = {isa = PBXBuildFile; fileRef = A66BE0BD2202939800F20193 /* bar.c */; }; 18 | A66D890A22037B2B001AF4E5 /* TestView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FF59F7521FE62D70035992C /* TestView.m */; }; 19 | A66D89342203DA50001AF4E5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FF59F3221FE4B2E0035992C /* ViewController.swift */; }; 20 | A6B7A1A121FEA10B00523228 /* ObjcCoverageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A6B7A1A021FEA10B00523228 /* ObjcCoverageTests.m */; }; 21 | A6B7A1B721FEB5BE00523228 /* libLOLzwagon.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A6B7A1AE21FEB40D00523228 /* libLOLzwagon.dylib */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 3FF59F4221FE4B2F0035992C /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 3FF59F2521FE4B2E0035992C /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 3FF59F2C21FE4B2E0035992C; 30 | remoteInfo = CodeCoverage; 31 | }; 32 | 3FF59F4D21FE4B2F0035992C /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 3FF59F2521FE4B2E0035992C /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 3FF59F2C21FE4B2E0035992C; 37 | remoteInfo = CodeCoverage; 38 | }; 39 | A6E4CC4421FFE5F7004B17E0 /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = 3FF59F2521FE4B2E0035992C /* Project object */; 42 | proxyType = 1; 43 | remoteGlobalIDString = A6B7A1AD21FEB40D00523228; 44 | remoteInfo = LOLzwagon; 45 | }; 46 | /* End PBXContainerItemProxy section */ 47 | 48 | /* Begin PBXCopyFilesBuildPhase section */ 49 | 3FF59F6F21FE4B910035992C /* Embed Frameworks */ = { 50 | isa = PBXCopyFilesBuildPhase; 51 | buildActionMask = 2147483647; 52 | dstPath = ""; 53 | dstSubfolderSpec = 10; 54 | files = ( 55 | ); 56 | name = "Embed Frameworks"; 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | A6B7A1B621FEB5B300523228 /* CopyFiles */ = { 60 | isa = PBXCopyFilesBuildPhase; 61 | buildActionMask = 2147483647; 62 | dstPath = /usr/local/lib; 63 | dstSubfolderSpec = 0; 64 | files = ( 65 | A6B7A1B721FEB5BE00523228 /* libLOLzwagon.dylib in CopyFiles */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXCopyFilesBuildPhase section */ 70 | 71 | /* Begin PBXFileReference section */ 72 | 3FF59F2D21FE4B2E0035992C /* CodeCoverage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CodeCoverage.app; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | 3FF59F3021FE4B2E0035992C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 74 | 3FF59F3221FE4B2E0035992C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 75 | 3FF59F3521FE4B2E0035992C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 76 | 3FF59F3721FE4B2F0035992C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 77 | 3FF59F3A21FE4B2F0035992C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 78 | 3FF59F3C21FE4B2F0035992C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79 | 3FF59F4121FE4B2F0035992C /* CodeCoverageTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CodeCoverageTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | 3FF59F4521FE4B2F0035992C /* SwiftCoverageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftCoverageTests.swift; sourceTree = ""; }; 81 | 3FF59F4721FE4B2F0035992C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 82 | 3FF59F4C21FE4B2F0035992C /* CodeCoverageUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CodeCoverageUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | 3FF59F5021FE4B2F0035992C /* CodeCoverageUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeCoverageUITests.swift; sourceTree = ""; }; 84 | 3FF59F5221FE4B2F0035992C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 85 | 3FF59F7021FE4BA40035992C /* LOLzwagon.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LOLzwagon.m; sourceTree = ""; }; 86 | 3FF59F7421FE62D70035992C /* TestView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestView.h; sourceTree = ""; }; 87 | 3FF59F7521FE62D70035992C /* TestView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestView.m; sourceTree = ""; }; 88 | A66BE0BD2202939800F20193 /* bar.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bar.c; sourceTree = ""; }; 89 | A6B7A1A021FEA10B00523228 /* ObjcCoverageTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ObjcCoverageTests.m; sourceTree = ""; }; 90 | A6B7A1AE21FEB40D00523228 /* libLOLzwagon.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libLOLzwagon.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 91 | /* End PBXFileReference section */ 92 | 93 | /* Begin PBXFrameworksBuildPhase section */ 94 | 3FF59F2A21FE4B2E0035992C /* Frameworks */ = { 95 | isa = PBXFrameworksBuildPhase; 96 | buildActionMask = 2147483647; 97 | files = ( 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | 3FF59F3E21FE4B2F0035992C /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | 3FF59F4921FE4B2F0035992C /* Frameworks */ = { 109 | isa = PBXFrameworksBuildPhase; 110 | buildActionMask = 2147483647; 111 | files = ( 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | A6B7A1AC21FEB40D00523228 /* Frameworks */ = { 116 | isa = PBXFrameworksBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | ); 120 | runOnlyForDeploymentPostprocessing = 0; 121 | }; 122 | /* End PBXFrameworksBuildPhase section */ 123 | 124 | /* Begin PBXGroup section */ 125 | 3FF59F2421FE4B2E0035992C = { 126 | isa = PBXGroup; 127 | children = ( 128 | 3FF59F2F21FE4B2E0035992C /* CodeCoverage */, 129 | 3FF59F4421FE4B2F0035992C /* CodeCoverageTests */, 130 | 3FF59F4F21FE4B2F0035992C /* CodeCoverageUITests */, 131 | 3FF59F6421FE4B910035992C /* LOLzwagon */, 132 | 3FF59F2E21FE4B2E0035992C /* Products */, 133 | ); 134 | sourceTree = ""; 135 | }; 136 | 3FF59F2E21FE4B2E0035992C /* Products */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 3FF59F2D21FE4B2E0035992C /* CodeCoverage.app */, 140 | 3FF59F4121FE4B2F0035992C /* CodeCoverageTests.xctest */, 141 | 3FF59F4C21FE4B2F0035992C /* CodeCoverageUITests.xctest */, 142 | A6B7A1AE21FEB40D00523228 /* libLOLzwagon.dylib */, 143 | ); 144 | name = Products; 145 | sourceTree = ""; 146 | }; 147 | 3FF59F2F21FE4B2E0035992C /* CodeCoverage */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 3FF59F3021FE4B2E0035992C /* AppDelegate.swift */, 151 | 3FF59F3221FE4B2E0035992C /* ViewController.swift */, 152 | A66BE0BD2202939800F20193 /* bar.c */, 153 | 3FF59F7421FE62D70035992C /* TestView.h */, 154 | 3FF59F7521FE62D70035992C /* TestView.m */, 155 | 3FF59F3421FE4B2E0035992C /* Main.storyboard */, 156 | 3FF59F3721FE4B2F0035992C /* Assets.xcassets */, 157 | 3FF59F3921FE4B2F0035992C /* LaunchScreen.storyboard */, 158 | 3FF59F3C21FE4B2F0035992C /* Info.plist */, 159 | ); 160 | path = CodeCoverage; 161 | sourceTree = ""; 162 | }; 163 | 3FF59F4421FE4B2F0035992C /* CodeCoverageTests */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 3FF59F4521FE4B2F0035992C /* SwiftCoverageTests.swift */, 167 | A6B7A1A021FEA10B00523228 /* ObjcCoverageTests.m */, 168 | 3FF59F4721FE4B2F0035992C /* Info.plist */, 169 | ); 170 | path = CodeCoverageTests; 171 | sourceTree = ""; 172 | }; 173 | 3FF59F4F21FE4B2F0035992C /* CodeCoverageUITests */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 3FF59F5021FE4B2F0035992C /* CodeCoverageUITests.swift */, 177 | 3FF59F5221FE4B2F0035992C /* Info.plist */, 178 | ); 179 | path = CodeCoverageUITests; 180 | sourceTree = ""; 181 | }; 182 | 3FF59F6421FE4B910035992C /* LOLzwagon */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 3FF59F7021FE4BA40035992C /* LOLzwagon.m */, 186 | ); 187 | path = LOLzwagon; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXGroup section */ 191 | 192 | /* Begin PBXHeadersBuildPhase section */ 193 | A6B7A1AA21FEB40D00523228 /* Headers */ = { 194 | isa = PBXHeadersBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | /* End PBXHeadersBuildPhase section */ 201 | 202 | /* Begin PBXNativeTarget section */ 203 | 3FF59F2C21FE4B2E0035992C /* CodeCoverage */ = { 204 | isa = PBXNativeTarget; 205 | buildConfigurationList = 3FF59F5521FE4B2F0035992C /* Build configuration list for PBXNativeTarget "CodeCoverage" */; 206 | buildPhases = ( 207 | 3FF59F2921FE4B2E0035992C /* Sources */, 208 | 3FF59F2A21FE4B2E0035992C /* Frameworks */, 209 | 3FF59F2B21FE4B2E0035992C /* Resources */, 210 | 3FF59F6F21FE4B910035992C /* Embed Frameworks */, 211 | A66D892E2203D6E3001AF4E5 /* ShellScript */, 212 | ); 213 | buildRules = ( 214 | ); 215 | dependencies = ( 216 | A6E4CC4521FFE5F7004B17E0 /* PBXTargetDependency */, 217 | ); 218 | name = CodeCoverage; 219 | productName = CodeCoverage; 220 | productReference = 3FF59F2D21FE4B2E0035992C /* CodeCoverage.app */; 221 | productType = "com.apple.product-type.application"; 222 | }; 223 | 3FF59F4021FE4B2F0035992C /* CodeCoverageTests */ = { 224 | isa = PBXNativeTarget; 225 | buildConfigurationList = 3FF59F5821FE4B2F0035992C /* Build configuration list for PBXNativeTarget "CodeCoverageTests" */; 226 | buildPhases = ( 227 | 3FF59F3D21FE4B2F0035992C /* Sources */, 228 | 3FF59F3E21FE4B2F0035992C /* Frameworks */, 229 | 3FF59F3F21FE4B2F0035992C /* Resources */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | 3FF59F4321FE4B2F0035992C /* PBXTargetDependency */, 235 | ); 236 | name = CodeCoverageTests; 237 | productName = CodeCoverageTests; 238 | productReference = 3FF59F4121FE4B2F0035992C /* CodeCoverageTests.xctest */; 239 | productType = "com.apple.product-type.bundle.unit-test"; 240 | }; 241 | 3FF59F4B21FE4B2F0035992C /* CodeCoverageUITests */ = { 242 | isa = PBXNativeTarget; 243 | buildConfigurationList = 3FF59F5B21FE4B2F0035992C /* Build configuration list for PBXNativeTarget "CodeCoverageUITests" */; 244 | buildPhases = ( 245 | 3FF59F4821FE4B2F0035992C /* Sources */, 246 | 3FF59F4921FE4B2F0035992C /* Frameworks */, 247 | 3FF59F4A21FE4B2F0035992C /* Resources */, 248 | ); 249 | buildRules = ( 250 | ); 251 | dependencies = ( 252 | 3FF59F4E21FE4B2F0035992C /* PBXTargetDependency */, 253 | ); 254 | name = CodeCoverageUITests; 255 | productName = CodeCoverageUITests; 256 | productReference = 3FF59F4C21FE4B2F0035992C /* CodeCoverageUITests.xctest */; 257 | productType = "com.apple.product-type.bundle.ui-testing"; 258 | }; 259 | A6B7A1AD21FEB40D00523228 /* LOLzwagon */ = { 260 | isa = PBXNativeTarget; 261 | buildConfigurationList = A6B7A1AF21FEB40D00523228 /* Build configuration list for PBXNativeTarget "LOLzwagon" */; 262 | buildPhases = ( 263 | A6B7A1AA21FEB40D00523228 /* Headers */, 264 | A6B7A1AB21FEB40D00523228 /* Sources */, 265 | A6B7A1AC21FEB40D00523228 /* Frameworks */, 266 | A6B7A1B621FEB5B300523228 /* CopyFiles */, 267 | ); 268 | buildRules = ( 269 | ); 270 | dependencies = ( 271 | ); 272 | name = LOLzwagon; 273 | productName = LOLzwagon; 274 | productReference = A6B7A1AE21FEB40D00523228 /* libLOLzwagon.dylib */; 275 | productType = "com.apple.product-type.library.dynamic"; 276 | }; 277 | /* End PBXNativeTarget section */ 278 | 279 | /* Begin PBXProject section */ 280 | 3FF59F2521FE4B2E0035992C /* Project object */ = { 281 | isa = PBXProject; 282 | attributes = { 283 | LastSwiftUpdateCheck = 1010; 284 | LastUpgradeCheck = 1010; 285 | ORGANIZATIONNAME = "Derek Selander"; 286 | TargetAttributes = { 287 | 3FF59F2C21FE4B2E0035992C = { 288 | CreatedOnToolsVersion = 10.1; 289 | LastSwiftMigration = 1010; 290 | }; 291 | 3FF59F4021FE4B2F0035992C = { 292 | CreatedOnToolsVersion = 10.1; 293 | LastSwiftMigration = 1010; 294 | TestTargetID = 3FF59F2C21FE4B2E0035992C; 295 | }; 296 | 3FF59F4B21FE4B2F0035992C = { 297 | CreatedOnToolsVersion = 10.1; 298 | TestTargetID = 3FF59F2C21FE4B2E0035992C; 299 | }; 300 | A6B7A1AD21FEB40D00523228 = { 301 | CreatedOnToolsVersion = 10.1; 302 | }; 303 | }; 304 | }; 305 | buildConfigurationList = 3FF59F2821FE4B2E0035992C /* Build configuration list for PBXProject "LOLzwagon" */; 306 | compatibilityVersion = "Xcode 9.3"; 307 | developmentRegion = en; 308 | hasScannedForEncodings = 0; 309 | knownRegions = ( 310 | en, 311 | Base, 312 | ); 313 | mainGroup = 3FF59F2421FE4B2E0035992C; 314 | productRefGroup = 3FF59F2E21FE4B2E0035992C /* Products */; 315 | projectDirPath = ""; 316 | projectRoot = ""; 317 | targets = ( 318 | 3FF59F2C21FE4B2E0035992C /* CodeCoverage */, 319 | 3FF59F4021FE4B2F0035992C /* CodeCoverageTests */, 320 | 3FF59F4B21FE4B2F0035992C /* CodeCoverageUITests */, 321 | A6B7A1AD21FEB40D00523228 /* LOLzwagon */, 322 | ); 323 | }; 324 | /* End PBXProject section */ 325 | 326 | /* Begin PBXResourcesBuildPhase section */ 327 | 3FF59F2B21FE4B2E0035992C /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | 3FF59F3B21FE4B2F0035992C /* LaunchScreen.storyboard in Resources */, 332 | 3FF59F3821FE4B2F0035992C /* Assets.xcassets in Resources */, 333 | 3FF59F3621FE4B2E0035992C /* Main.storyboard in Resources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | 3FF59F3F21FE4B2F0035992C /* Resources */ = { 338 | isa = PBXResourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | 3FF59F4A21FE4B2F0035992C /* Resources */ = { 345 | isa = PBXResourcesBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | /* End PBXResourcesBuildPhase section */ 352 | 353 | /* Begin PBXShellScriptBuildPhase section */ 354 | A66D892E2203D6E3001AF4E5 /* ShellScript */ = { 355 | isa = PBXShellScriptBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | ); 359 | inputFileListPaths = ( 360 | ); 361 | inputPaths = ( 362 | ); 363 | outputFileListPaths = ( 364 | ); 365 | outputPaths = ( 366 | ); 367 | runOnlyForDeploymentPostprocessing = 0; 368 | shellPath = /bin/sh; 369 | shellScript = "# Woot! You found the dancing Gandalf!\nopen https://www.youtube.com/watch?v=Sagg08DrO5U\n"; 370 | }; 371 | /* End PBXShellScriptBuildPhase section */ 372 | 373 | /* Begin PBXSourcesBuildPhase section */ 374 | 3FF59F2921FE4B2E0035992C /* Sources */ = { 375 | isa = PBXSourcesBuildPhase; 376 | buildActionMask = 2147483647; 377 | files = ( 378 | 3FF59F7821FE6A630035992C /* AppDelegate.swift in Sources */, 379 | A66D890A22037B2B001AF4E5 /* TestView.m in Sources */, 380 | A66D89342203DA50001AF4E5 /* ViewController.swift in Sources */, 381 | A66BE0C222031CE300F20193 /* bar.c in Sources */, 382 | ); 383 | runOnlyForDeploymentPostprocessing = 0; 384 | }; 385 | 3FF59F3D21FE4B2F0035992C /* Sources */ = { 386 | isa = PBXSourcesBuildPhase; 387 | buildActionMask = 2147483647; 388 | files = ( 389 | 3FF59F4621FE4B2F0035992C /* SwiftCoverageTests.swift in Sources */, 390 | A6B7A1A121FEA10B00523228 /* ObjcCoverageTests.m in Sources */, 391 | ); 392 | runOnlyForDeploymentPostprocessing = 0; 393 | }; 394 | 3FF59F4821FE4B2F0035992C /* Sources */ = { 395 | isa = PBXSourcesBuildPhase; 396 | buildActionMask = 2147483647; 397 | files = ( 398 | 3FF59F5121FE4B2F0035992C /* CodeCoverageUITests.swift in Sources */, 399 | ); 400 | runOnlyForDeploymentPostprocessing = 0; 401 | }; 402 | A6B7A1AB21FEB40D00523228 /* Sources */ = { 403 | isa = PBXSourcesBuildPhase; 404 | buildActionMask = 2147483647; 405 | files = ( 406 | A66BE0C122031C5A00F20193 /* LOLzwagon.m in Sources */, 407 | ); 408 | runOnlyForDeploymentPostprocessing = 0; 409 | }; 410 | /* End PBXSourcesBuildPhase section */ 411 | 412 | /* Begin PBXTargetDependency section */ 413 | 3FF59F4321FE4B2F0035992C /* PBXTargetDependency */ = { 414 | isa = PBXTargetDependency; 415 | target = 3FF59F2C21FE4B2E0035992C /* CodeCoverage */; 416 | targetProxy = 3FF59F4221FE4B2F0035992C /* PBXContainerItemProxy */; 417 | }; 418 | 3FF59F4E21FE4B2F0035992C /* PBXTargetDependency */ = { 419 | isa = PBXTargetDependency; 420 | target = 3FF59F2C21FE4B2E0035992C /* CodeCoverage */; 421 | targetProxy = 3FF59F4D21FE4B2F0035992C /* PBXContainerItemProxy */; 422 | }; 423 | A6E4CC4521FFE5F7004B17E0 /* PBXTargetDependency */ = { 424 | isa = PBXTargetDependency; 425 | target = A6B7A1AD21FEB40D00523228 /* LOLzwagon */; 426 | targetProxy = A6E4CC4421FFE5F7004B17E0 /* PBXContainerItemProxy */; 427 | }; 428 | /* End PBXTargetDependency section */ 429 | 430 | /* Begin PBXVariantGroup section */ 431 | 3FF59F3421FE4B2E0035992C /* Main.storyboard */ = { 432 | isa = PBXVariantGroup; 433 | children = ( 434 | 3FF59F3521FE4B2E0035992C /* Base */, 435 | ); 436 | name = Main.storyboard; 437 | sourceTree = ""; 438 | }; 439 | 3FF59F3921FE4B2F0035992C /* LaunchScreen.storyboard */ = { 440 | isa = PBXVariantGroup; 441 | children = ( 442 | 3FF59F3A21FE4B2F0035992C /* Base */, 443 | ); 444 | name = LaunchScreen.storyboard; 445 | sourceTree = ""; 446 | }; 447 | /* End PBXVariantGroup section */ 448 | 449 | /* Begin XCBuildConfiguration section */ 450 | 3FF59F5321FE4B2F0035992C /* Debug */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ALWAYS_SEARCH_USER_PATHS = NO; 454 | CLANG_ANALYZER_NONNULL = YES; 455 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 456 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 457 | CLANG_CXX_LIBRARY = "libc++"; 458 | CLANG_ENABLE_MODULES = YES; 459 | CLANG_ENABLE_OBJC_ARC = YES; 460 | CLANG_ENABLE_OBJC_WEAK = YES; 461 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 462 | CLANG_WARN_BOOL_CONVERSION = YES; 463 | CLANG_WARN_COMMA = YES; 464 | CLANG_WARN_CONSTANT_CONVERSION = YES; 465 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 466 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 467 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 468 | CLANG_WARN_EMPTY_BODY = YES; 469 | CLANG_WARN_ENUM_CONVERSION = YES; 470 | CLANG_WARN_INFINITE_RECURSION = YES; 471 | CLANG_WARN_INT_CONVERSION = YES; 472 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 473 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 474 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 475 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 476 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 477 | CLANG_WARN_STRICT_PROTOTYPES = YES; 478 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 479 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 480 | CLANG_WARN_UNREACHABLE_CODE = YES; 481 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 482 | CODE_SIGN_IDENTITY = "iPhone Developer"; 483 | COPY_PHASE_STRIP = NO; 484 | DEBUG_INFORMATION_FORMAT = dwarf; 485 | ENABLE_STRICT_OBJC_MSGSEND = YES; 486 | ENABLE_TESTABILITY = YES; 487 | GCC_C_LANGUAGE_STANDARD = gnu11; 488 | GCC_DYNAMIC_NO_PIC = NO; 489 | GCC_NO_COMMON_BLOCKS = YES; 490 | GCC_OPTIMIZATION_LEVEL = 0; 491 | GCC_PREPROCESSOR_DEFINITIONS = ( 492 | "DEBUG=1", 493 | "$(inherited)", 494 | ); 495 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 496 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 497 | GCC_WARN_UNDECLARED_SELECTOR = YES; 498 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 499 | GCC_WARN_UNUSED_FUNCTION = YES; 500 | GCC_WARN_UNUSED_VARIABLE = YES; 501 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 502 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 503 | MTL_FAST_MATH = YES; 504 | ONLY_ACTIVE_ARCH = YES; 505 | SDKROOT = iphoneos; 506 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 507 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 508 | }; 509 | name = Debug; 510 | }; 511 | 3FF59F5421FE4B2F0035992C /* Release */ = { 512 | isa = XCBuildConfiguration; 513 | buildSettings = { 514 | ALWAYS_SEARCH_USER_PATHS = NO; 515 | CLANG_ANALYZER_NONNULL = YES; 516 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 517 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 518 | CLANG_CXX_LIBRARY = "libc++"; 519 | CLANG_ENABLE_MODULES = YES; 520 | CLANG_ENABLE_OBJC_ARC = YES; 521 | CLANG_ENABLE_OBJC_WEAK = YES; 522 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 523 | CLANG_WARN_BOOL_CONVERSION = YES; 524 | CLANG_WARN_COMMA = YES; 525 | CLANG_WARN_CONSTANT_CONVERSION = YES; 526 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 527 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 528 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 529 | CLANG_WARN_EMPTY_BODY = YES; 530 | CLANG_WARN_ENUM_CONVERSION = YES; 531 | CLANG_WARN_INFINITE_RECURSION = YES; 532 | CLANG_WARN_INT_CONVERSION = YES; 533 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 534 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 535 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 536 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 537 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 538 | CLANG_WARN_STRICT_PROTOTYPES = YES; 539 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 540 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 541 | CLANG_WARN_UNREACHABLE_CODE = YES; 542 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 543 | CODE_SIGN_IDENTITY = "iPhone Developer"; 544 | COPY_PHASE_STRIP = NO; 545 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 546 | ENABLE_NS_ASSERTIONS = NO; 547 | ENABLE_STRICT_OBJC_MSGSEND = YES; 548 | GCC_C_LANGUAGE_STANDARD = gnu11; 549 | GCC_NO_COMMON_BLOCKS = YES; 550 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 551 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 552 | GCC_WARN_UNDECLARED_SELECTOR = YES; 553 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 554 | GCC_WARN_UNUSED_FUNCTION = YES; 555 | GCC_WARN_UNUSED_VARIABLE = YES; 556 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 557 | MTL_ENABLE_DEBUG_INFO = NO; 558 | MTL_FAST_MATH = YES; 559 | SDKROOT = iphoneos; 560 | SWIFT_COMPILATION_MODE = wholemodule; 561 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 562 | VALIDATE_PRODUCT = YES; 563 | }; 564 | name = Release; 565 | }; 566 | 3FF59F5621FE4B2F0035992C /* Debug */ = { 567 | isa = XCBuildConfiguration; 568 | buildSettings = { 569 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 570 | CLANG_ANALYZER_DEADCODE_DEADSTORES = YES; 571 | CLANG_ENABLE_MODULES = YES; 572 | CODE_SIGN_STYLE = Automatic; 573 | INFOPLIST_FILE = CodeCoverage/Info.plist; 574 | LD_RUNPATH_SEARCH_PATHS = ( 575 | "$(inherited)", 576 | "@executable_path/Frameworks", 577 | ); 578 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverage; 579 | PRODUCT_NAME = "$(TARGET_NAME)"; 580 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 581 | SWIFT_VERSION = 4.2; 582 | TARGETED_DEVICE_FAMILY = "1,2"; 583 | }; 584 | name = Debug; 585 | }; 586 | 3FF59F5721FE4B2F0035992C /* Release */ = { 587 | isa = XCBuildConfiguration; 588 | buildSettings = { 589 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 590 | CLANG_ANALYZER_DEADCODE_DEADSTORES = YES; 591 | CLANG_ENABLE_MODULES = YES; 592 | CODE_SIGN_STYLE = Automatic; 593 | INFOPLIST_FILE = CodeCoverage/Info.plist; 594 | LD_RUNPATH_SEARCH_PATHS = ( 595 | "$(inherited)", 596 | "@executable_path/Frameworks", 597 | ); 598 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverage; 599 | PRODUCT_NAME = "$(TARGET_NAME)"; 600 | SWIFT_VERSION = 4.2; 601 | TARGETED_DEVICE_FAMILY = "1,2"; 602 | }; 603 | name = Release; 604 | }; 605 | 3FF59F5921FE4B2F0035992C /* Debug */ = { 606 | isa = XCBuildConfiguration; 607 | buildSettings = { 608 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 609 | BUNDLE_LOADER = "$(TEST_HOST)"; 610 | CLANG_ENABLE_MODULES = YES; 611 | CODE_SIGN_STYLE = Automatic; 612 | INFOPLIST_FILE = CodeCoverageTests/Info.plist; 613 | LD_RUNPATH_SEARCH_PATHS = ( 614 | "$(inherited)", 615 | "@executable_path/Frameworks", 616 | "@loader_path/Frameworks", 617 | ); 618 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverageTests; 619 | PRODUCT_NAME = "$(TARGET_NAME)"; 620 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 621 | SWIFT_VERSION = 4.2; 622 | TARGETED_DEVICE_FAMILY = "1,2"; 623 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodeCoverage.app/CodeCoverage"; 624 | }; 625 | name = Debug; 626 | }; 627 | 3FF59F5A21FE4B2F0035992C /* Release */ = { 628 | isa = XCBuildConfiguration; 629 | buildSettings = { 630 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 631 | BUNDLE_LOADER = "$(TEST_HOST)"; 632 | CLANG_ENABLE_MODULES = YES; 633 | CODE_SIGN_STYLE = Automatic; 634 | INFOPLIST_FILE = CodeCoverageTests/Info.plist; 635 | LD_RUNPATH_SEARCH_PATHS = ( 636 | "$(inherited)", 637 | "@executable_path/Frameworks", 638 | "@loader_path/Frameworks", 639 | ); 640 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverageTests; 641 | PRODUCT_NAME = "$(TARGET_NAME)"; 642 | SWIFT_VERSION = 4.2; 643 | TARGETED_DEVICE_FAMILY = "1,2"; 644 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodeCoverage.app/CodeCoverage"; 645 | }; 646 | name = Release; 647 | }; 648 | 3FF59F5C21FE4B2F0035992C /* Debug */ = { 649 | isa = XCBuildConfiguration; 650 | buildSettings = { 651 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 652 | CODE_SIGN_STYLE = Automatic; 653 | INFOPLIST_FILE = CodeCoverageUITests/Info.plist; 654 | LD_RUNPATH_SEARCH_PATHS = ( 655 | "$(inherited)", 656 | "@executable_path/Frameworks", 657 | "@loader_path/Frameworks", 658 | ); 659 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverageUITests; 660 | PRODUCT_NAME = "$(TARGET_NAME)"; 661 | SWIFT_VERSION = 4.2; 662 | TARGETED_DEVICE_FAMILY = "1,2"; 663 | TEST_TARGET_NAME = CodeCoverage; 664 | }; 665 | name = Debug; 666 | }; 667 | 3FF59F5D21FE4B2F0035992C /* Release */ = { 668 | isa = XCBuildConfiguration; 669 | buildSettings = { 670 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 671 | CODE_SIGN_STYLE = Automatic; 672 | INFOPLIST_FILE = CodeCoverageUITests/Info.plist; 673 | LD_RUNPATH_SEARCH_PATHS = ( 674 | "$(inherited)", 675 | "@executable_path/Frameworks", 676 | "@loader_path/Frameworks", 677 | ); 678 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverageUITests; 679 | PRODUCT_NAME = "$(TARGET_NAME)"; 680 | SWIFT_VERSION = 4.2; 681 | TARGETED_DEVICE_FAMILY = "1,2"; 682 | TEST_TARGET_NAME = CodeCoverage; 683 | }; 684 | name = Release; 685 | }; 686 | A66D892F2203DA21001AF4E5 /* GimmeARaise */ = { 687 | isa = XCBuildConfiguration; 688 | buildSettings = { 689 | ALWAYS_SEARCH_USER_PATHS = NO; 690 | CLANG_ANALYZER_NONNULL = YES; 691 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 692 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 693 | CLANG_CXX_LIBRARY = "libc++"; 694 | CLANG_ENABLE_MODULES = YES; 695 | CLANG_ENABLE_OBJC_ARC = YES; 696 | CLANG_ENABLE_OBJC_WEAK = YES; 697 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 698 | CLANG_WARN_BOOL_CONVERSION = YES; 699 | CLANG_WARN_COMMA = YES; 700 | CLANG_WARN_CONSTANT_CONVERSION = YES; 701 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 702 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 703 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 704 | CLANG_WARN_EMPTY_BODY = YES; 705 | CLANG_WARN_ENUM_CONVERSION = YES; 706 | CLANG_WARN_INFINITE_RECURSION = YES; 707 | CLANG_WARN_INT_CONVERSION = YES; 708 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 709 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 710 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 711 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 712 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 713 | CLANG_WARN_STRICT_PROTOTYPES = YES; 714 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 715 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 716 | CLANG_WARN_UNREACHABLE_CODE = YES; 717 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 718 | CODE_SIGN_IDENTITY = "iPhone Developer"; 719 | COPY_PHASE_STRIP = NO; 720 | DEBUG_INFORMATION_FORMAT = dwarf; 721 | ENABLE_STRICT_OBJC_MSGSEND = YES; 722 | ENABLE_TESTABILITY = YES; 723 | GCC_C_LANGUAGE_STANDARD = gnu11; 724 | GCC_DYNAMIC_NO_PIC = NO; 725 | GCC_NO_COMMON_BLOCKS = YES; 726 | GCC_OPTIMIZATION_LEVEL = 0; 727 | GCC_PREPROCESSOR_DEFINITIONS = ( 728 | "DEBUG=1", 729 | "$(inherited)", 730 | "FuckYeahIWantAPromotion=1", 731 | ); 732 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 733 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 734 | GCC_WARN_UNDECLARED_SELECTOR = YES; 735 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 736 | GCC_WARN_UNUSED_FUNCTION = YES; 737 | GCC_WARN_UNUSED_VARIABLE = YES; 738 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 739 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 740 | MTL_FAST_MATH = YES; 741 | ONLY_ACTIVE_ARCH = YES; 742 | SDKROOT = iphoneos; 743 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 744 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 745 | }; 746 | name = GimmeARaise; 747 | }; 748 | A66D89302203DA21001AF4E5 /* GimmeARaise */ = { 749 | isa = XCBuildConfiguration; 750 | buildSettings = { 751 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 752 | CLANG_ANALYZER_DEADCODE_DEADSTORES = YES; 753 | CLANG_ENABLE_MODULES = YES; 754 | CODE_SIGN_STYLE = Automatic; 755 | INFOPLIST_FILE = CodeCoverage/Info.plist; 756 | LD_RUNPATH_SEARCH_PATHS = ( 757 | "$(inherited)", 758 | "@executable_path/Frameworks", 759 | ); 760 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverage; 761 | PRODUCT_NAME = "$(TARGET_NAME)"; 762 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 763 | SWIFT_VERSION = 4.2; 764 | TARGETED_DEVICE_FAMILY = "1,2"; 765 | }; 766 | name = GimmeARaise; 767 | }; 768 | A66D89312203DA21001AF4E5 /* GimmeARaise */ = { 769 | isa = XCBuildConfiguration; 770 | buildSettings = { 771 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 772 | BUNDLE_LOADER = "$(TEST_HOST)"; 773 | CLANG_ENABLE_MODULES = YES; 774 | CODE_SIGN_STYLE = Automatic; 775 | INFOPLIST_FILE = CodeCoverageTests/Info.plist; 776 | LD_RUNPATH_SEARCH_PATHS = ( 777 | "$(inherited)", 778 | "@executable_path/Frameworks", 779 | "@loader_path/Frameworks", 780 | ); 781 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverageTests; 782 | PRODUCT_NAME = "$(TARGET_NAME)"; 783 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 784 | SWIFT_VERSION = 4.2; 785 | TARGETED_DEVICE_FAMILY = "1,2"; 786 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodeCoverage.app/CodeCoverage"; 787 | }; 788 | name = GimmeARaise; 789 | }; 790 | A66D89322203DA21001AF4E5 /* GimmeARaise */ = { 791 | isa = XCBuildConfiguration; 792 | buildSettings = { 793 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 794 | CODE_SIGN_STYLE = Automatic; 795 | INFOPLIST_FILE = CodeCoverageUITests/Info.plist; 796 | LD_RUNPATH_SEARCH_PATHS = ( 797 | "$(inherited)", 798 | "@executable_path/Frameworks", 799 | "@loader_path/Frameworks", 800 | ); 801 | PRODUCT_BUNDLE_IDENTIFIER = selander.CodeCoverageUITests; 802 | PRODUCT_NAME = "$(TARGET_NAME)"; 803 | SWIFT_VERSION = 4.2; 804 | TARGETED_DEVICE_FAMILY = "1,2"; 805 | TEST_TARGET_NAME = CodeCoverage; 806 | }; 807 | name = GimmeARaise; 808 | }; 809 | A66D89332203DA21001AF4E5 /* GimmeARaise */ = { 810 | isa = XCBuildConfiguration; 811 | buildSettings = { 812 | ARCHS = ( 813 | "$(ARCHS_STANDARD)", 814 | i386, 815 | ); 816 | CLANG_ENABLE_CODE_COVERAGE = NO; 817 | CODE_SIGN_IDENTITY = "-"; 818 | CODE_SIGN_STYLE = Automatic; 819 | DYLIB_COMPATIBILITY_VERSION = 1; 820 | DYLIB_CURRENT_VERSION = 1; 821 | EXECUTABLE_PREFIX = lib; 822 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 823 | MACOSX_DEPLOYMENT_TARGET = 10.14; 824 | ONLY_ACTIVE_ARCH = NO; 825 | PRODUCT_NAME = "$(TARGET_NAME)"; 826 | SDKROOT = iphoneos; 827 | SKIP_INSTALL = YES; 828 | SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; 829 | }; 830 | name = GimmeARaise; 831 | }; 832 | A6B7A1B021FEB40D00523228 /* Debug */ = { 833 | isa = XCBuildConfiguration; 834 | buildSettings = { 835 | ARCHS = ( 836 | "$(ARCHS_STANDARD)", 837 | i386, 838 | ); 839 | CLANG_ENABLE_CODE_COVERAGE = NO; 840 | CODE_SIGN_IDENTITY = "-"; 841 | CODE_SIGN_STYLE = Automatic; 842 | DYLIB_COMPATIBILITY_VERSION = 1; 843 | DYLIB_CURRENT_VERSION = 1; 844 | EXECUTABLE_PREFIX = lib; 845 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 846 | MACOSX_DEPLOYMENT_TARGET = 10.14; 847 | ONLY_ACTIVE_ARCH = NO; 848 | PRODUCT_NAME = "$(TARGET_NAME)"; 849 | SDKROOT = iphoneos; 850 | SKIP_INSTALL = YES; 851 | SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; 852 | }; 853 | name = Debug; 854 | }; 855 | A6B7A1B121FEB40D00523228 /* Release */ = { 856 | isa = XCBuildConfiguration; 857 | buildSettings = { 858 | ARCHS = ( 859 | "$(ARCHS_STANDARD)", 860 | i386, 861 | ); 862 | CLANG_ENABLE_CODE_COVERAGE = NO; 863 | CODE_SIGN_IDENTITY = "-"; 864 | CODE_SIGN_STYLE = Automatic; 865 | DYLIB_COMPATIBILITY_VERSION = 1; 866 | DYLIB_CURRENT_VERSION = 1; 867 | EXECUTABLE_PREFIX = lib; 868 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 869 | MACOSX_DEPLOYMENT_TARGET = 10.14; 870 | PRODUCT_NAME = "$(TARGET_NAME)"; 871 | SDKROOT = iphoneos; 872 | SKIP_INSTALL = YES; 873 | SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; 874 | }; 875 | name = Release; 876 | }; 877 | /* End XCBuildConfiguration section */ 878 | 879 | /* Begin XCConfigurationList section */ 880 | 3FF59F2821FE4B2E0035992C /* Build configuration list for PBXProject "LOLzwagon" */ = { 881 | isa = XCConfigurationList; 882 | buildConfigurations = ( 883 | 3FF59F5321FE4B2F0035992C /* Debug */, 884 | A66D892F2203DA21001AF4E5 /* GimmeARaise */, 885 | 3FF59F5421FE4B2F0035992C /* Release */, 886 | ); 887 | defaultConfigurationIsVisible = 0; 888 | defaultConfigurationName = Release; 889 | }; 890 | 3FF59F5521FE4B2F0035992C /* Build configuration list for PBXNativeTarget "CodeCoverage" */ = { 891 | isa = XCConfigurationList; 892 | buildConfigurations = ( 893 | 3FF59F5621FE4B2F0035992C /* Debug */, 894 | A66D89302203DA21001AF4E5 /* GimmeARaise */, 895 | 3FF59F5721FE4B2F0035992C /* Release */, 896 | ); 897 | defaultConfigurationIsVisible = 0; 898 | defaultConfigurationName = Release; 899 | }; 900 | 3FF59F5821FE4B2F0035992C /* Build configuration list for PBXNativeTarget "CodeCoverageTests" */ = { 901 | isa = XCConfigurationList; 902 | buildConfigurations = ( 903 | 3FF59F5921FE4B2F0035992C /* Debug */, 904 | A66D89312203DA21001AF4E5 /* GimmeARaise */, 905 | 3FF59F5A21FE4B2F0035992C /* Release */, 906 | ); 907 | defaultConfigurationIsVisible = 0; 908 | defaultConfigurationName = Release; 909 | }; 910 | 3FF59F5B21FE4B2F0035992C /* Build configuration list for PBXNativeTarget "CodeCoverageUITests" */ = { 911 | isa = XCConfigurationList; 912 | buildConfigurations = ( 913 | 3FF59F5C21FE4B2F0035992C /* Debug */, 914 | A66D89322203DA21001AF4E5 /* GimmeARaise */, 915 | 3FF59F5D21FE4B2F0035992C /* Release */, 916 | ); 917 | defaultConfigurationIsVisible = 0; 918 | defaultConfigurationName = Release; 919 | }; 920 | A6B7A1AF21FEB40D00523228 /* Build configuration list for PBXNativeTarget "LOLzwagon" */ = { 921 | isa = XCConfigurationList; 922 | buildConfigurations = ( 923 | A6B7A1B021FEB40D00523228 /* Debug */, 924 | A66D89332203DA21001AF4E5 /* GimmeARaise */, 925 | A6B7A1B121FEB40D00523228 /* Release */, 926 | ); 927 | defaultConfigurationIsVisible = 0; 928 | defaultConfigurationName = Release; 929 | }; 930 | /* End XCConfigurationList section */ 931 | }; 932 | rootObject = 3FF59F2521FE4B2E0035992C /* Project object */; 933 | } 934 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/project.xcworkspace/xcuserdata/lolgrep.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/LOLzwagon.xcodeproj/project.xcworkspace/xcuserdata/lolgrep.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/xcshareddata/xcschemes/Aggressive CodeCoverage.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 32 | 33 | 39 | 40 | 41 | 42 | 44 | 50 | 51 | 52 | 54 | 60 | 61 | 62 | 63 | 64 | 70 | 71 | 72 | 73 | 74 | 75 | 85 | 87 | 93 | 94 | 95 | 96 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/xcshareddata/xcschemes/CodeCoverage.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 32 | 33 | 39 | 40 | 41 | 42 | 44 | 50 | 51 | 52 | 54 | 60 | 61 | 62 | 63 | 64 | 70 | 71 | 72 | 73 | 74 | 75 | 85 | 87 | 93 | 94 | 95 | 96 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/xcshareddata/xcschemes/LOLzwagon.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/xcuserdata/derekselander.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Aggressive CodeCoverage.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | CodeCoverage.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | LOLzwagon.xcscheme_^#shared#^_ 18 | 19 | orderHint 20 | 2 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/xcuserdata/lolgrep.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 35 | 36 | 50 | 51 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 72 | 78 | 79 | 80 | 81 | 82 | 84 | 90 | 91 | 92 | 93 | 94 | 96 | 101 | 102 | 108 | 109 | 110 | 111 | 112 | 114 | 119 | 120 | 126 | 127 | 128 | 129 | 130 | 132 | 137 | 138 | 144 | 145 | 146 | 147 | 148 | 150 | 155 | 156 | 162 | 163 | 164 | 165 | 166 | 168 | 180 | 181 | 182 | 184 | 189 | 190 | 196 | 197 | 198 | 199 | 200 | 202 | 214 | 215 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /LOLzwagon.xcodeproj/xcuserdata/lolgrep.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CodeCoverage.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | LOLzwagon.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 3FF59F2C21FE4B2E0035992C 21 | 22 | primary 23 | 24 | 25 | 3FF59F4021FE4B2F0035992C 26 | 27 | primary 28 | 29 | 30 | 3FF59F4B21FE4B2F0035992C 31 | 32 | primary 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /LOLzwagon/LOLzwagon.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Facebook, Inc. 2 | // All rights reserved. 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are met: 5 | // * Redistributions of source code must retain the above copyright notice, 6 | // this list of conditions and the following disclaimer. 7 | // * Redistributions in binary form must reproduce the above copyright notice, 8 | // this list of conditions and the following disclaimer in the documentation 9 | // and/or other materials provided with the distribution. 10 | // * Neither the name Facebook nor the names of its contributors may be used to 11 | // endorse or promote products derived from this software without specific 12 | // prior written permission. 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | // 24 | // LOLzwagon.c 25 | // LOLzwagon 26 | // 27 | // Created by Derek Selander on 1/27/19. 28 | // Copyright © 2019 Derek Selander. All rights reserved. 29 | // 30 | 31 | #ifndef LOLzwagon_h 32 | #define LOLzwagon_h 33 | 34 | #ifndef fishhook_h 35 | #define fishhook_h 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | #endif //fishhook_h 51 | 52 | #ifdef __LP64__ 53 | typedef struct mach_header_64 mach_header_t; 54 | typedef struct segment_command_64 segment_command_t; 55 | typedef struct section_64 section_t; 56 | typedef struct nlist_64 nlist_t; 57 | #define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT_64 58 | #else 59 | typedef struct mach_header mach_header_t; 60 | typedef struct segment_command segment_command_t; 61 | typedef struct section section_t; 62 | typedef struct nlist nlist_t; 63 | #define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT 64 | #endif // __LP64__ 65 | 66 | #ifndef SEG_DATA_CONST 67 | #define SEG_DATA_CONST "__DATA_CONST" 68 | #endif // SEG_DATA_CONST 69 | 70 | //*****************************************************************************/ 71 | #pragma mark - Derbear's declarations 72 | //*****************************************************************************/ 73 | 74 | #include 75 | #include 76 | 77 | typedef struct llvm_profile_data { 78 | uint64_t name_ref; 79 | uint64_t function_hash; 80 | uintptr_t *counter; 81 | void *function; 82 | void *values; 83 | uint32_t nr_counters; 84 | uint16_t nr_value_sites[2]; 85 | } llvm_profile_data; 86 | 87 | #endif /* LOLzwagon_h */ 88 | 89 | /******************************************************************************/ 90 | // MARK: - XCTAssert* rebindings 91 | /******************************************************************************/ 92 | 93 | /// Used for the majority of wiping out the XCTAssert functions 94 | __attribute__((used)) static void noOpFunction() { } 95 | 96 | static void rebind_xctest_functions(section_t *section, 97 | intptr_t slide, 98 | nlist_t *symtab, 99 | char *strtab, 100 | uint32_t *indirect_symtab) { 101 | uint32_t *indirect_symbol_indices = indirect_symtab + section->reserved1; 102 | void **indirect_symbol_bindings = (void **)((uintptr_t)slide + section->addr); 103 | for (uint i = 0; i < section->size / sizeof(void *); i++) { 104 | uint32_t symtab_index = indirect_symbol_indices[i]; 105 | if (symtab_index == INDIRECT_SYMBOL_ABS || symtab_index == INDIRECT_SYMBOL_LOCAL || 106 | symtab_index == (INDIRECT_SYMBOL_LOCAL | INDIRECT_SYMBOL_ABS)) { 107 | continue; 108 | } 109 | uint32_t strtab_offset = symtab[symtab_index].n_un.n_strx; 110 | char *symbol_name = strtab + strtab_offset; 111 | 112 | bool symbol_name_longer_than_1 = symbol_name[0] && symbol_name[1]; 113 | 114 | if (!symbol_name_longer_than_1) { 115 | continue; 116 | } 117 | 118 | // Objective-C XCTest calls #define'd wrappers to this func 119 | if (strcmp(symbol_name, "__XCTFailureHandler") == 0) { 120 | indirect_symbol_bindings[i] = &noOpFunction; 121 | } 122 | // Swift wraps funcs to XCTest swift mangled names 123 | else if (strnstr(symbol_name, "_$S6XCTest", 10) && strstr(&symbol_name[6], "XCT")) { 124 | indirect_symbol_bindings[i] = &noOpFunction; 125 | } 126 | } 127 | } 128 | 129 | static void rebind_xctest_symbols_for_image(const struct mach_header *header, 130 | intptr_t slide ) { 131 | Dl_info info; 132 | if (dladdr(header, &info) == 0) { 133 | return; 134 | } 135 | 136 | segment_command_t *cur_seg_cmd; 137 | segment_command_t *linkedit_segment = NULL; 138 | struct symtab_command* symtab_cmd = NULL; 139 | struct dysymtab_command* dysymtab_cmd = NULL; 140 | 141 | uintptr_t cur = (uintptr_t)header + sizeof(mach_header_t); 142 | bool linkdsToXCTestOrlibSwiftXCTest = false; 143 | for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) { 144 | cur_seg_cmd = (segment_command_t *)cur; 145 | if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) { 146 | if (strcmp(cur_seg_cmd->segname, SEG_LINKEDIT) == 0) { 147 | linkedit_segment = cur_seg_cmd; 148 | } 149 | } else if (cur_seg_cmd->cmd == LC_SYMTAB) { 150 | symtab_cmd = (struct symtab_command*)cur_seg_cmd; 151 | } else if (cur_seg_cmd->cmd == LC_DYSYMTAB) { 152 | dysymtab_cmd = (struct dysymtab_command*)cur_seg_cmd; 153 | } else if (cur_seg_cmd->cmd == LC_LOAD_DYLIB) { 154 | struct dylib_command *dyld_cmd = (struct dylib_command *)cur_seg_cmd; 155 | #ifdef __LP64__ 156 | char *libraryPath = (char *)(cur + dyld_cmd->dylib.name.offset); 157 | #else 158 | char *libraryPath = dyld_cmd->dylib.name.ptr; 159 | #endif 160 | 161 | char * libraryName = basename(libraryPath); 162 | if (strcmp(libraryName, "libswiftXCTest.dylib") == 0 163 | || strcmp(libraryName, "XCTest") == 0) { 164 | linkdsToXCTestOrlibSwiftXCTest = true; 165 | } 166 | } 167 | } 168 | 169 | if (!linkdsToXCTestOrlibSwiftXCTest || !symtab_cmd || !dysymtab_cmd || !linkedit_segment || 170 | !dysymtab_cmd->nindirectsyms) { 171 | return; 172 | } 173 | 174 | // Find base symbol/string table addresses 175 | uintptr_t linkedit_base = (uintptr_t)slide + linkedit_segment->vmaddr - linkedit_segment->fileoff; 176 | nlist_t *symtab = (nlist_t *)(linkedit_base + symtab_cmd->symoff); 177 | char *strtab = (char *)(linkedit_base + symtab_cmd->stroff); 178 | 179 | // Get indirect symbol table (array of uint32_t indices into symbol table) 180 | uint32_t *indirect_symtab = (uint32_t *)(linkedit_base + dysymtab_cmd->indirectsymoff); 181 | 182 | cur = (uintptr_t)header + sizeof(mach_header_t); 183 | for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) { 184 | cur_seg_cmd = (segment_command_t *)cur; 185 | if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) { 186 | if (strcmp(cur_seg_cmd->segname, SEG_DATA) != 0 && 187 | strcmp(cur_seg_cmd->segname, SEG_DATA_CONST) != 0) { 188 | continue; 189 | } 190 | for (uint j = 0; j < cur_seg_cmd->nsects; j++) { 191 | section_t *sect = 192 | (section_t *)(cur + sizeof(segment_command_t)) + j; 193 | if ((sect->flags & SECTION_TYPE) == S_LAZY_SYMBOL_POINTERS) { 194 | rebind_xctest_functions(sect, slide, symtab, strtab, indirect_symtab); 195 | } 196 | if ((sect->flags & SECTION_TYPE) == S_NON_LAZY_SYMBOL_POINTERS) { 197 | rebind_xctest_functions(sect, slide, symtab, strtab, indirect_symtab); 198 | } 199 | } 200 | } 201 | } 202 | } 203 | 204 | void lolzwagon(const struct mach_header *header, intptr_t slide) { 205 | 206 | #ifdef __LP64__ 207 | uint64_t size = 0; 208 | char *llvm_prf = getsectdatafromheader_64((const struct mach_header_64*)header, "__DATA", "__llvm_prf_data", &size) + slide; 209 | #else 210 | uint32_t size = 0; 211 | char *llvm_prf = getsectdatafromheader(header, "__DATA", "__llvm_prf_data", &size) + slide; 212 | #endif 213 | 214 | if (!size) { return; } 215 | llvm_profile_data *llvm_data_ptr = (llvm_profile_data *)llvm_prf; 216 | for (int j = 0; j < size / sizeof(llvm_profile_data); j++) { 217 | llvm_profile_data *profile = &llvm_data_ptr[j]; 218 | int counter = profile->nr_counters; 219 | for (int z = 0; z < counter; z++) { 220 | 221 | /// enables (very close to?) 100% code coverage, use GimmeARaise scheme 222 | #ifdef FuckYeahIWantAPromotion 223 | profile->counter[z]+= (counter - z)*4; 224 | #else 225 | profile->counter[z]++; 226 | #endif // FuckYeahIWantAPromotion 227 | } 228 | } 229 | 230 | rebind_xctest_symbols_for_image(header, slide); 231 | } 232 | 233 | /******************************************************************************/ 234 | // MARK: - XCTest Swizzling 235 | /******************************************************************************/ 236 | @interface NSObject (DS_XCTestCase_Swizzle) 237 | @end 238 | 239 | #pragma clang diagnostic push 240 | #pragma clang diagnostic ignored "-Wundeclared-selector" 241 | 242 | @implementation NSObject (DS_XCTestCase_Swizzle) 243 | 244 | #define SECRET_OVERRIDE_TIMEOUT 0.751 245 | 246 | - (BOOL)dsXCTestExpectation_fulfilled { 247 | return NO; 248 | } 249 | 250 | - (BOOL)dsXCTestExpectation_assertForOverFulfill { 251 | return NO; 252 | } 253 | 254 | - (void)dsXCTestCase_waitForExpectations:(NSArray*)expectations timeout:(double)timeout enforceOrder:(BOOL)enforceOrder { 255 | 256 | if (timeout != SECRET_OVERRIDE_TIMEOUT) { 257 | for (id expectation in expectations) { 258 | 259 | if (![expectation respondsToSelector:@selector(fulfill)] || 260 | ![expectation respondsToSelector:@selector(fulfillmentCount)]) { 261 | continue; 262 | } 263 | 264 | int fulfillmentCount = (int)[expectation performSelector:@selector(fulfillmentCount)]; 265 | for (int i = 0; i < fulfillmentCount; i++) { 266 | [expectation performSelector:@selector(fulfill)]; 267 | } 268 | } 269 | } 270 | [self dsXCTestCase_waitForExpectations:expectations timeout:timeout enforceOrder:enforceOrder]; 271 | } 272 | 273 | - (id)dsXCTestObservationCenter__testCaseDidFail:(long)arg0 withDescription:(id)arg1 inFile:(id)arg2 atLine:(long)arg3 { 274 | return nil; 275 | } 276 | 277 | - (id)dsXCTestCase_recordFailureWithDescription:(id)desc inFile:(id)file atLine:(long)line expected:(BOOL)expected { 278 | return nil; 279 | } 280 | @end 281 | #pragma clang diagnostic pop 282 | 283 | /******************************************************************************/ 284 | // MARK: - ObjC Swizzle implementor 285 | /******************************************************************************/ 286 | static void do_that_swizzle_thing(void) { 287 | __unused static void (^swizzle)(NSString *, NSString *) = ^(NSString *className, NSString *method) { 288 | Class cls = NSClassFromString(className); 289 | if (!cls) { return; } 290 | 291 | NSString *swizzledString = [(NSString *)[(NSString *)[@"ds" stringByAppendingString:className] stringByAppendingString:@"_"] stringByAppendingString:method]; 292 | 293 | SEL originalSelector = NSSelectorFromString(method); 294 | SEL swizzledSelector = NSSelectorFromString(swizzledString); 295 | Method originalMethod = class_getInstanceMethod(cls, originalSelector); 296 | Method swizzledMethod = class_getInstanceMethod(cls, swizzledSelector); 297 | 298 | if (!originalMethod || !swizzledMethod) { return; } 299 | method_exchangeImplementations(originalMethod, swizzledMethod); 300 | 301 | }; 302 | 303 | static dispatch_once_t onceToken; 304 | dispatch_once (&onceToken, ^{ 305 | swizzle(@"XCTestExpectation", @"fulfilled"); 306 | swizzle(@"XCTestExpectation", @"assertForOverFulfill"); 307 | swizzle(@"XCTestCase", @"waitForExpectations:timeout:enforceOrder:"); 308 | swizzle(@"XCTestCase", @"recordFailureWithDescription:inFile:atLine:expected:"); 309 | swizzle(@"XCTestObservationCenter", @"_testCaseDidFail:withDescription:inFile:atLine:"); 310 | }); 311 | } 312 | 313 | /******************************************************************************/ 314 | // MARK: - Fun starts here 315 | /******************************************************************************/ 316 | __attribute__((constructor)) static void lets_get_it_started_in_haaaaa(void) { 317 | _dyld_register_func_for_add_image(lolzwagon); 318 | do_that_swizzle_thing(); 319 | } 320 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Beware of the dancing Gandalf...

2 |

🇺🇸🇺🇸 LOLzwagon 🇺🇸🇺🇸

3 | 4 |

Significantly bumps up your iOS XCTest code coverage and makes all unit tests pass... by crippling them

5 | 6 |

7 | 8 |
9 | "You know a repo is legit if it has a logo for it" 10 |

11 |

Are you...

12 | 13 | * Looking to get a raise with the least amount of work possible? 14 | * Having to deal with a superior and explain to them on numerous occassions that it's extremely difficult (if not impossible) to get past 95% of code completion in your repo? 15 | * In an office argument with the backened team and want to prove to them that the bug is on their side due to how well tested your code is? 16 | 17 |

IF YOU SAID "YES" TO ANY OF THE ABOVE, THIS REPO IS FOR YOU!

18 | 19 | This code will neuter all `XCTAssert*`/`XCTestExpectation` functions/methods called on for testing failures. In addition, this dylib will greatly increase the code coverage of all modules which contain code coverage. 20 | 21 | Check them pics out! 22 | 23 |

24 | 25 |

26 | 27 |

28 | 29 |

30 | 31 | ## Compiling 32 | 33 | Download the Xcode project and build the **LOLzwagon Xcode scheme**. 34 | 35 | ``` 36 | xcodebuild -project LOLzwagon.xcodeproj -scheme LOLzwagon -sdk iphonesimulator -config Debug 37 | ``` 38 | 39 | The above example used the **Debug** scheme, but feel free to also use the **Release** or the **GimmeARaise** scheme, but more on that in a sec... 40 | 41 | After successfully compiling, the `LOLzwagon` dylib will be placed at the following directory: 42 | 43 | ``` 44 | /usr/local/lib/libLOLzwagon.dylib 45 | ``` 46 | 47 | Make sure you have write access to `/usr/local/lib/` otherwise everything below will fail. 48 | 49 | If you load this framework into your process, it will cripple Xcode's Unit Testing! 🎉 Check out the **Integrating** section for more info. 50 | 51 | 52 | ## Testing 53 | 54 | Bundled into the Xcode project is a scheme called **CodeCoverage** which includes unit tests. Run these unit tests and observe the `XCTest` scenarios. 55 | 56 | ``` 57 | xcodebuild test -project LOLzwagon.xcodeproj -scheme CodeCoverage -enableCodeCoverage YES -destination 'platform=iOS Simulator,OS=12.1,name=iPhone XS' -sdk iphonesimulator -config Debug 58 | ``` 59 | The logic in these tests should fail, but OMG, they'll pass! 60 | 61 | ## Integrating 62 | 63 | There are several ways to get this code to run on your 5-year-old CI/CD mac mini and loaded into test builds. 64 | 65 | Let's go through some of the ways that you can do this... 66 | 67 | 1. Just compile the `LOLzwagon.m` file into your application. This is definitely not recommended, since your `git`/`svn`/whatever credentials are tied to your action. 68 | 2. The second to worst idea is to use the **DYLD_INSERT_LIBRARIES** environment variable. This environment variable loads framework(s) into a process before anything else is loaded (while still honoring it's `LC_LOAD_DYLIB` dependencies first). Again, it's still tied to source control (especially if a shared Xcode scheme), so still not a good idea. 69 | 70 |

71 | 72 |

73 | 74 | 3. A more subtle way is to use a **launch agent** to insert the `DYLD_INSERT_LIBRARIES` environment variable so it survives outside of source control. Your Jenkins/whatever build machine will likely `git clone` your repo to a specific directory. You can use a `launchd` agent to monitor the directory and perform an action if something changes. 75 | 76 | As an example, if you want to monitor changes in the `/tmp/` directory, you can save the following into **`~/Library/LaunchAgents/com.selander.LOLzwagon.plist`** 77 | 78 | ``` 79 | 80 | 81 | 82 | 83 | Label 84 | com.selander.LOLzwagon 85 | ProgramArguments 86 | 87 | echo 88 | Yay! Working! 89 | 90 | WatchPaths 91 | 92 | /tmp/testdir 93 | 94 | StandardOutPath 95 | /tmp/log_file.txt 96 | 97 | 98 | ``` 99 | 100 | Enable this daemon: 101 | 102 | ``` 103 | launchctl load -w ~/Library/LaunchAgents/com.selander.LOLzwagon.plist 104 | ``` 105 | 106 | Now, if you open up a new Terminal window, you can watch the events 107 | 108 | ``` 109 | touch /tmp/log_file.txt && tail -f /tmp/log_file.txt 110 | ``` 111 | 112 | In the other Terminal, trigger an event 113 | 114 | ``` 115 | mkdir /tmp/testdir 116 | ``` 117 | 118 | Using this method, you can watch for events and add your environment variables outside of source control. Warning: this is prone to race conditions, you'll need to figure out how to get around that on your oooooooooooowwwwwwwwwn 119 | 120 | 121 | ## Code Coverage 122 | 123 | Building the `Debug` config will bump the unit tests up considerably in your application, but if you really, really want to shoot high for Code Coverage, you can compile your application with the **GimmeARaise** Xcode config. 124 | 125 | ``` 126 | xcodebuild test -project LOLzwagon.xcodeproj -scheme CodeCoverage -sdk iphonesimulator -config GimmeARaise 127 | ``` 128 | 129 | Warning, this might make your Code Coverage a little too good. Might be better to make it slightly lower to glide under the radar. 130 | 131 | ## How Does it Work? 132 | 133 | LOL 134 | 135 | ## Bugs 136 | 137 | SDEs & SDETs write some weird shit for testing cases that this repo might not catch. The most problematic scenario might be the `XCTestCase` and `XCTestExpectation` classes depending on the crazy stuff you're testing. If you see a failing test case, please report an issue and include a generic test case to show the problem via Swift or Objective-C. Test Driven Development is an important workflow in order to make unit tests not work...... 138 | 139 | Also, don't use this in a production codebase... or any codebase 140 | -------------------------------------------------------------------------------- /media/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/media/logo.png -------------------------------------------------------------------------------- /media/scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/media/scheme.png -------------------------------------------------------------------------------- /media/screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/media/screen1.png -------------------------------------------------------------------------------- /media/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DerekSelander/LOLzwagon/cd5056e1b40da1a4fcd5bf780af50f1ea12edb56/media/screen2.png --------------------------------------------------------------------------------