From 6466926beffc3fd4023c2fa0945e8ce6c7dc0674 Mon Sep 17 00:00:00 2001 From: Bruno Fernandes <10085713+bfernandesbfs@users.noreply.github.com> Date: Mon, 23 Aug 2021 16:23:33 -0300 Subject: [PATCH 01/40] Support Swift Package Manager (#126) * Add support Swift Package Manager * Update Readme * FIx import header * Export import dependecy submodule core * Remove Pods.lock .gitignore * Added bundleResourcePath variable to FBSnapshotTestController which can be manually set to the root folder where reference images are stored, which is needed for Swift Package Manager. After this change there are now 4 ways of setting reference image directories instead of 3: 1. Set the preprocessor macro FB_REFERENCE_IMAGE_DIR to a double quoted c-string with the path. This only works for Objective-C tests. 2. Set an environment variable named FB_REFERENCE_IMAGE_DIR with the path. This takes precedence over the preprocessor macro to allow for run-time override. 3. (New way) Set `FBSnapshotTestCase.bundleResourcePath` as the root folder where reference images are stored. 4. Keep everything unset, which will cause the reference images to be looked up inside the bundle holding the current test, in the Resources/ReferenceImages_* directories. Co-authored-by: Shehab Tareque --- .gitignore | 3 +- FBSnapshotTestCase.xcodeproj/project.pbxproj | 8 ++-- .../Categories/UIImage+Compare.m | 4 ++ FBSnapshotTestCase/Categories/UIImage+Diff.m | 4 ++ .../Categories/UIImage+Snapshot.m | 4 ++ FBSnapshotTestCase/FBSnapshotTestCase.m | 22 ++++++++-- .../FBSnapshotTestCasePlatform.m | 2 +- FBSnapshotTestCase/FBSnapshotTestController.m | 12 +++--- .../{ => Public}/FBSnapshotTestCase.h | 18 +++++--- .../{ => Public}/FBSnapshotTestCasePlatform.h | 0 .../{ => Public}/FBSnapshotTestController.h | 9 ++-- .../{ => Support}/SwiftSupport.swift | 9 +++- .../project.pbxproj | 4 +- FBSnapshotTestCaseDemo/Podfile.lock | 20 --------- .../FBSnapshotControllerTests.m | 7 ++- Package.swift | 43 +++++++++++++++++++ README.md | 10 +++++ 17 files changed, 128 insertions(+), 51 deletions(-) rename FBSnapshotTestCase/{ => Public}/FBSnapshotTestCase.h (96%) rename FBSnapshotTestCase/{ => Public}/FBSnapshotTestCasePlatform.h (100%) rename FBSnapshotTestCase/{ => Public}/FBSnapshotTestController.h (97%) rename FBSnapshotTestCase/{ => Support}/SwiftSupport.swift (97%) delete mode 100644 FBSnapshotTestCaseDemo/Podfile.lock create mode 100644 Package.swift diff --git a/.gitignore b/.gitignore index 1945897..18e7cc4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,8 @@ DerivedData .idea/ *.hmap *.xccheckout +.swiftpm/ Pods FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FailedSnapshotImages iOSSnapshotTestCaseCarthageDemo/Carthage/Checkouts -iOSSnapshotTestCaseCarthageDemo/Carthage/Build \ No newline at end of file +iOSSnapshotTestCaseCarthageDemo/Carthage/Build diff --git a/FBSnapshotTestCase.xcodeproj/project.pbxproj b/FBSnapshotTestCase.xcodeproj/project.pbxproj index f4eaf84..2cd2897 100644 --- a/FBSnapshotTestCase.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCase.xcodeproj/project.pbxproj @@ -75,7 +75,7 @@ 133564131B59C3F500A4E4BF /* UIImage+Diff.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Diff.m"; sourceTree = ""; }; 133564141B59C3F500A4E4BF /* UIImage+Snapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Snapshot.h"; sourceTree = ""; }; 133564151B59C3F500A4E4BF /* UIImage+Snapshot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Snapshot.m"; sourceTree = ""; }; - 13CBB39B1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSnapshotTestCasePlatform.h; sourceTree = ""; }; + 13CBB39B1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestCasePlatform.h; path = Public/FBSnapshotTestCasePlatform.h; sourceTree = ""; }; 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestCasePlatform.m; sourceTree = ""; }; 42F2B74320C0D7A400ABED24 /* rect_shade.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rect_shade.png; sourceTree = ""; }; 8271377A1C63AB6F00354E42 /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBSnapshotTestCase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -84,9 +84,9 @@ B31987F41AB782D000B0A900 /* FBSnapshotTestCase-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FBSnapshotTestCase-Info.plist"; sourceTree = ""; }; B31987FB1AB782D100B0A900 /* FBSnapshotTestCase iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "FBSnapshotTestCase iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; B31988011AB782D100B0A900 /* FBSnapshotTestCaseTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FBSnapshotTestCaseTests-Info.plist"; sourceTree = ""; }; - B31988201AB7849400B0A900 /* FBSnapshotTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSnapshotTestCase.h; sourceTree = ""; }; + B31988201AB7849400B0A900 /* FBSnapshotTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestCase.h; path = Public/FBSnapshotTestCase.h; sourceTree = ""; }; B31988211AB7849400B0A900 /* FBSnapshotTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestCase.m; sourceTree = ""; }; - B31988221AB7849400B0A900 /* FBSnapshotTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSnapshotTestController.h; sourceTree = ""; }; + B31988221AB7849400B0A900 /* FBSnapshotTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestController.h; path = Public/FBSnapshotTestController.h; sourceTree = ""; }; B31988231AB7849400B0A900 /* FBSnapshotTestController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestController.m; sourceTree = ""; }; B31988301AB784CB00B0A900 /* FBSnapshotControllerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotControllerTests.m; sourceTree = ""; }; B32447D91AB78B5E00B1D6FF /* square_with_text.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square_with_text.png; sourceTree = ""; }; @@ -94,7 +94,7 @@ B32447DB1AB78B5E00B1D6FF /* square.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square.png; sourceTree = ""; }; B76C68271C6BD68100586E5B /* rect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rect.png; sourceTree = ""; }; E5C2CD611B1F399A00669887 /* square_with_pixel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square_with_pixel.png; sourceTree = ""; }; - F0D698F41B204E120005CAC9 /* SwiftSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftSupport.swift; sourceTree = ""; }; + F0D698F41B204E120005CAC9 /* SwiftSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = Support/SwiftSupport.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ diff --git a/FBSnapshotTestCase/Categories/UIImage+Compare.m b/FBSnapshotTestCase/Categories/UIImage+Compare.m index a52c965..cdd97da 100644 --- a/FBSnapshotTestCase/Categories/UIImage+Compare.m +++ b/FBSnapshotTestCase/Categories/UIImage+Compare.m @@ -28,7 +28,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // +#if SWIFT_PACKAGE +#import "UIImage+Compare.h" +#else #import +#endif // This makes debugging much more fun typedef union { diff --git a/FBSnapshotTestCase/Categories/UIImage+Diff.m b/FBSnapshotTestCase/Categories/UIImage+Diff.m index 7cb1d40..eea9459 100644 --- a/FBSnapshotTestCase/Categories/UIImage+Diff.m +++ b/FBSnapshotTestCase/Categories/UIImage+Diff.m @@ -28,7 +28,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // +#if SWIFT_PACKAGE +#import "UIImage+Diff.h" +#else #import +#endif @implementation UIImage (Diff) diff --git a/FBSnapshotTestCase/Categories/UIImage+Snapshot.m b/FBSnapshotTestCase/Categories/UIImage+Snapshot.m index cfe2743..bd81f47 100644 --- a/FBSnapshotTestCase/Categories/UIImage+Snapshot.m +++ b/FBSnapshotTestCase/Categories/UIImage+Snapshot.m @@ -7,7 +7,11 @@ * */ +#if SWIFT_PACKAGE +#import "UIImage+Snapshot.h" +#else #import +#endif @implementation UIImage (Snapshot) diff --git a/FBSnapshotTestCase/FBSnapshotTestCase.m b/FBSnapshotTestCase/FBSnapshotTestCase.m index dc10fee..54640f4 100644 --- a/FBSnapshotTestCase/FBSnapshotTestCase.m +++ b/FBSnapshotTestCase/FBSnapshotTestCase.m @@ -7,8 +7,8 @@ * */ -#import -#import +#import "Public/FBSnapshotTestCase.h" +#import "Public/FBSnapshotTestController.h" @implementation FBSnapshotTestCase { FBSnapshotTestController *_snapshotController; @@ -39,6 +39,16 @@ - (void)setRecordMode:(BOOL)recordMode _snapshotController.recordMode = recordMode; } +- (NSBundle *)bundleResourcePath +{ + return _snapshotController.bundleResourcePath; +} + +- (void)setBundleResourcePath:(NSBundle *)bundleResourcePath +{ + _snapshotController.bundleResourcePath = bundleResourcePath; +} + - (FBSnapshotTestCaseFileNameIncludeOption)fileNameOptions { return _snapshotController.fileNameOptions; @@ -242,7 +252,13 @@ - (NSString *)getReferenceImageDirectoryWithDefault:(NSString *)dir if (dir && dir.length > 0) { return dir; } - return [[NSBundle bundleForClass:self.class].resourcePath stringByAppendingPathComponent:@"ReferenceImages"]; + NSString* _Nonnull bundleResourcePath; + if (_snapshotController.bundleResourcePath == nil) { + bundleResourcePath = [NSBundle bundleForClass:self.class].resourcePath; + } else { + bundleResourcePath = _snapshotController.bundleResourcePath; + } + return [bundleResourcePath stringByAppendingPathComponent:@"ReferenceImages"]; } - (NSString *)getImageDiffDirectoryWithDefault:(NSString *)dir diff --git a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m b/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m index 3f7d9db..b1a7be0 100644 --- a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m +++ b/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m @@ -7,8 +7,8 @@ * */ -#import #import +#import "FBSnapshotTestCasePlatform.h" BOOL FBSnapshotTestCaseIs64Bit(void) { diff --git a/FBSnapshotTestCase/FBSnapshotTestController.m b/FBSnapshotTestCase/FBSnapshotTestController.m index f4db6e3..b522dae 100644 --- a/FBSnapshotTestCase/FBSnapshotTestController.m +++ b/FBSnapshotTestCase/FBSnapshotTestController.m @@ -7,15 +7,15 @@ * */ -#import -#import -#import -#import -#import - #import #import +#import "FBSnapshotTestCasePlatform.h" +#import "FBSnapshotTestController.h" +#import "Categories/UIImage+Compare.h" +#import "Categories/UIImage+Diff.h" +#import "Categories/UIImage+Snapshot.h" + NSString *const FBSnapshotTestControllerErrorDomain = @"FBSnapshotTestControllerErrorDomain"; NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey"; NSString *const FBReferenceImageKey = @"FBReferenceImageKey"; diff --git a/FBSnapshotTestCase/FBSnapshotTestCase.h b/FBSnapshotTestCase/Public/FBSnapshotTestCase.h similarity index 96% rename from FBSnapshotTestCase/FBSnapshotTestCase.h rename to FBSnapshotTestCase/Public/FBSnapshotTestCase.h index 365b741..e0821fa 100644 --- a/FBSnapshotTestCase/FBSnapshotTestCase.h +++ b/FBSnapshotTestCase/Public/FBSnapshotTestCase.h @@ -7,15 +7,13 @@ * */ -#import -#import - #import - #import - #import +#import "FBSnapshotTestCasePlatform.h" +#import "FBSnapshotTestController.h" + /* There are three ways of setting reference image directories. @@ -23,7 +21,8 @@ c-string with the path. This only works for Objective-C tests. 2. Set an environment variable named FB_REFERENCE_IMAGE_DIR with the path. This takes precedence over the preprocessor macro to allow for run-time override. - 3. Keep everything unset, which will cause the reference images to be looked up + 3. Set `FBSnapshotTestCase.bundleResourcePath` as the root folder where reference images are stored. + 4. Keep everything unset, which will cause the reference images to be looked up inside the bundle holding the current test, in the Resources/ReferenceImages_* directories. */ @@ -136,6 +135,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (readwrite, nonatomic, assign) BOOL recordMode; + +/** + The bundleResourcePath can be manually set to the root folder where reference images are stored. + If the bundle is not set via FB_REFERENCE_IMAGE_DIR (Steps 1, 2 stated above) then it checks if bundleResourcePath is set. This is useful for testing with SPM + */ +@property (readwrite, nonatomic, copy, nullable) NSString *bundleResourcePath; + /** When set, allows fine-grained control over what you want the file names to include. diff --git a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h b/FBSnapshotTestCase/Public/FBSnapshotTestCasePlatform.h similarity index 100% rename from FBSnapshotTestCase/FBSnapshotTestCasePlatform.h rename to FBSnapshotTestCase/Public/FBSnapshotTestCasePlatform.h diff --git a/FBSnapshotTestCase/FBSnapshotTestController.h b/FBSnapshotTestCase/Public/FBSnapshotTestController.h similarity index 97% rename from FBSnapshotTestCase/FBSnapshotTestController.h rename to FBSnapshotTestCase/Public/FBSnapshotTestController.h index 556361f..e76d844 100644 --- a/FBSnapshotTestCase/FBSnapshotTestController.h +++ b/FBSnapshotTestCase/Public/FBSnapshotTestController.h @@ -7,10 +7,8 @@ * */ -#import #import - -#import +#import "FBSnapshotTestCasePlatform.h" NS_ASSUME_NONNULL_BEGIN @@ -59,6 +57,11 @@ extern NSString *const FBDiffedImageKey; */ @property (readwrite, nonatomic, assign) BOOL recordMode; +/** + The bundleResourcePath can be manually set to the root folder where reference images are stored. + */ +@property (readwrite, nonatomic, copy, nullable) NSString *bundleResourcePath; + /** When set, allows fine-grained control over what you want the file names to include. diff --git a/FBSnapshotTestCase/SwiftSupport.swift b/FBSnapshotTestCase/Support/SwiftSupport.swift similarity index 97% rename from FBSnapshotTestCase/SwiftSupport.swift rename to FBSnapshotTestCase/Support/SwiftSupport.swift index 61f0104..305a3a6 100644 --- a/FBSnapshotTestCase/SwiftSupport.swift +++ b/FBSnapshotTestCase/Support/SwiftSupport.swift @@ -7,11 +7,18 @@ * */ +import UIKit +import XCTest + +#if SWIFT_PACKAGE +@_exported import FBSnapshotTestCaseCore +#endif + public extension FBSnapshotTestCase { func FBSnapshotVerifyView(_ view: UIView, identifier: String? = nil, suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), perPixelTolerance: CGFloat = 0, overallTolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes, perPixelTolerance: perPixelTolerance, overallTolerance: overallTolerance, file: file, line: line) } - + func FBSnapshotVerifyViewController(_ viewController: UIViewController, identifier: String? = nil, suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), perPixelTolerance: CGFloat = 0, overallTolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { viewController.view.bounds = UIScreen.main.bounds viewController.viewWillAppear(false) diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj index bddf54f..b3f8223 100644 --- a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj @@ -658,7 +658,7 @@ INFOPLIST_FILE = "FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.FBSnapshotTestCaseDemo; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -670,7 +670,7 @@ INFOPLIST_FILE = "FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.FBSnapshotTestCaseDemo; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/FBSnapshotTestCaseDemo/Podfile.lock b/FBSnapshotTestCaseDemo/Podfile.lock deleted file mode 100644 index 7ba8fb2..0000000 --- a/FBSnapshotTestCaseDemo/Podfile.lock +++ /dev/null @@ -1,20 +0,0 @@ -PODS: - - iOSSnapshotTestCase (6.2.0): - - iOSSnapshotTestCase/SwiftSupport (= 6.2.0) - - iOSSnapshotTestCase/Core (6.2.0) - - iOSSnapshotTestCase/SwiftSupport (6.2.0): - - iOSSnapshotTestCase/Core - -DEPENDENCIES: - - iOSSnapshotTestCase (from `..`) - -EXTERNAL SOURCES: - iOSSnapshotTestCase: - :path: ".." - -SPEC CHECKSUMS: - iOSSnapshotTestCase: 8f1c29a4de3a4ca26113fbcb107558aaa3a0a356 - -PODFILE CHECKSUM: 35ff607c3424eed6ccbd8fdacc2d5c1ea41a5a0c - -COCOAPODS: 1.8.3 diff --git a/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m b/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m index 600165f..0c0fc78 100644 --- a/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m +++ b/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m @@ -7,9 +7,8 @@ * */ -#import "FBSnapshotTestCasePlatform.h" -#import "FBSnapshotTestController.h" #import +#import "FBSnapshotTestCase.h" @interface FBSnapshotControllerTests : XCTestCase @@ -194,8 +193,8 @@ - (void)testCompareReferenceImageWithLowPixelToleranceShouldMatch - (UIImage *)_bundledImageNamed:(NSString *)name type:(NSString *)type { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *path = [bundle pathForResource:name ofType:type]; + NSURL *url = [[NSURL fileURLWithPath: @__FILE__] URLByDeletingLastPathComponent]; + NSString *path = [[url URLByAppendingPathComponent: [NSString stringWithFormat:@"%@.%@", name, type]] path]; NSData *data = [[NSData alloc] initWithContentsOfFile:path]; return [[UIImage alloc] initWithData:data]; } diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..2c2a28e --- /dev/null +++ b/Package.swift @@ -0,0 +1,43 @@ +// swift-tools-version:5.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. +import PackageDescription + +let package = Package( + name: "FBSnapshotTestCase", + platforms: [ + .iOS(.v10), .tvOS(.v10), + ], + products: [ + .library( + name: "FBSnapshotTestCase", + type: .dynamic, + targets: ["FBSnapshotTestCase", "FBSnapshotTestCaseCore"]), + ], + dependencies: [], + targets: [ + .target( + name: "FBSnapshotTestCase", + dependencies: ["FBSnapshotTestCaseCore"], + path: "FBSnapshotTestCase", + sources: ["Support"] + ), + .target( + name: "FBSnapshotTestCaseCore", + path: "FBSnapshotTestCase", + sources: ["Categories", + "FBSnapshotTestCase.h", + "FBSnapshotTestCase.m", + "FBSnapshotTestCasePlatform.h", + "FBSnapshotTestCasePlatform.m", + "FBSnapshotTestController.h", + "FBSnapshotTestController.m"], + publicHeadersPath: "Public" + ), + .testTarget( + name: "FBSnapshotTestCaseTests", + dependencies: ["FBSnapshotTestCase"], + path: "FBSnapshotTestCaseTests", + sources: ["FBSnapshotControllerTests.m"] + ), + ] +) diff --git a/README.md b/README.md index 157b5c1..e9e9ca5 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,16 @@ Add the following line to your Cartfile: github "uber/ios-snapshot-test-case" ~> 6.1.0 ``` +#### Swift Package Manager + +Add the following line to your `Package.swift`: + +```spm +dependencies: [ + .package(url: "https://github.com/uber/ios-snapshot-test-case.git", .exact("6.2.1")), +], +``` + ### Step 2: Setup Test Scheme Replace "Tests" with the name of your test project. From ed69601fa4d70306f094324619faf802608cd4b8 Mon Sep 17 00:00:00 2001 From: Boris Bielik Date: Mon, 23 Aug 2021 21:26:31 +0200 Subject: [PATCH 02/40] Update project to Xcode 12.0 (#135) --- FBSnapshotTestCase.xcodeproj/project.pbxproj | 10 +++++----- .../xcschemes/FBSnapshotTestCase iOS.xcscheme | 2 +- .../xcschemes/FBSnapshotTestCase tvOS.xcscheme | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/FBSnapshotTestCase.xcodeproj/project.pbxproj b/FBSnapshotTestCase.xcodeproj/project.pbxproj index 2cd2897..1d5d1bf 100644 --- a/FBSnapshotTestCase.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCase.xcodeproj/project.pbxproj @@ -327,7 +327,7 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = Facebook; TargetAttributes = { 827137791C63AB6F00354E42 = { @@ -592,6 +592,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -617,7 +618,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -651,6 +652,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -669,7 +671,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -697,7 +699,6 @@ ); INFOPLIST_FILE = "FBSnapshotTestCase/FBSnapshotTestCase-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( "$(inherited)", @@ -728,7 +729,6 @@ ); INFOPLIST_FILE = "FBSnapshotTestCase/FBSnapshotTestCase-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme b/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme index d14b379..d5d7dae 100644 --- a/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme +++ b/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme @@ -1,6 +1,6 @@ Date: Mon, 23 Aug 2021 20:08:22 -0700 Subject: [PATCH 03/40] Fix incorrect types for bundleResourcePath --- FBSnapshotTestCase.xcodeproj/project.pbxproj | 18 +++++++++--------- .../xcschemes/FBSnapshotTestCase iOS.xcscheme | 2 +- .../xcschemes/FBSnapshotTestCase tvOS.xcscheme | 2 +- FBSnapshotTestCase/FBSnapshotTestCase.m | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/FBSnapshotTestCase.xcodeproj/project.pbxproj b/FBSnapshotTestCase.xcodeproj/project.pbxproj index 1d5d1bf..642ad72 100644 --- a/FBSnapshotTestCase.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCase.xcodeproj/project.pbxproj @@ -327,7 +327,7 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 1200; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = Facebook; TargetAttributes = { 827137791C63AB6F00354E42 = { @@ -501,7 +501,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Debug; }; @@ -534,7 +534,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Release; }; @@ -549,7 +549,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.1; + TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Debug; }; @@ -565,7 +565,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.1; + TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Release; }; @@ -592,7 +592,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -618,7 +618,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -652,7 +652,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -671,7 +671,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme b/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme index d5d7dae..a473e58 100644 --- a/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme +++ b/FBSnapshotTestCase.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCase iOS.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 24 Aug 2021 12:02:22 -0700 Subject: [PATCH 04/40] Revert the Podfile.lock removal from #126 --- FBSnapshotTestCaseDemo/Podfile.lock | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 FBSnapshotTestCaseDemo/Podfile.lock diff --git a/FBSnapshotTestCaseDemo/Podfile.lock b/FBSnapshotTestCaseDemo/Podfile.lock new file mode 100644 index 0000000..7ba8fb2 --- /dev/null +++ b/FBSnapshotTestCaseDemo/Podfile.lock @@ -0,0 +1,20 @@ +PODS: + - iOSSnapshotTestCase (6.2.0): + - iOSSnapshotTestCase/SwiftSupport (= 6.2.0) + - iOSSnapshotTestCase/Core (6.2.0) + - iOSSnapshotTestCase/SwiftSupport (6.2.0): + - iOSSnapshotTestCase/Core + +DEPENDENCIES: + - iOSSnapshotTestCase (from `..`) + +EXTERNAL SOURCES: + iOSSnapshotTestCase: + :path: ".." + +SPEC CHECKSUMS: + iOSSnapshotTestCase: 8f1c29a4de3a4ca26113fbcb107558aaa3a0a356 + +PODFILE CHECKSUM: 35ff607c3424eed6ccbd8fdacc2d5c1ea41a5a0c + +COCOAPODS: 1.8.3 From 1b9d3209db1d2e6df698a42f0f0ffe8b6e900022 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 12:09:28 -0700 Subject: [PATCH 05/40] Update Cocoapods --- FBSnapshotTestCaseDemo/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FBSnapshotTestCaseDemo/Podfile.lock b/FBSnapshotTestCaseDemo/Podfile.lock index 7ba8fb2..77f03c3 100644 --- a/FBSnapshotTestCaseDemo/Podfile.lock +++ b/FBSnapshotTestCaseDemo/Podfile.lock @@ -17,4 +17,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 35ff607c3424eed6ccbd8fdacc2d5c1ea41a5a0c -COCOAPODS: 1.8.3 +COCOAPODS: 1.10.2 From 65f259b8df8cc4cffe4b39ef6f6333f21db42640 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 12:26:34 -0700 Subject: [PATCH 06/40] Update FBSnapshotTestCaseDemo images for Xcode 12.5.1 and iOS 14 --- .../testViewSnapshot@2x.png | Bin 418 -> 550 bytes ...erentBackgroundColorPerArchitecture@2x.png | Bin 418 -> 550 bytes .../testViewSnapshotWithUIAppearance@2x.png | Bin 2526 -> 2889 bytes ...iewSnapshotWithUIAppearanceResizing@2x.png | Bin 2885 -> 2880 bytes .../testViewSnapshotWithVisualEffects@2x.png | Bin 2811 -> 853 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png index 91d809917c5bc64f8da850058906611bf6b1c0f6..13bbb61e4a1ea404343291eda0365cdf767d47c8 100644 GIT binary patch delta 141 zcmZ3)yo_anVSPnvglC$sFM}2X0|N&G3!@YRE0Dzq#CD9*aJCzx1_Lu#oQZ*TmUgTMqJ2I+y&%nKNys)1q)nBb}d7BC~&AZ?FxnZCT+s8_-W06sAfzW@LL delta 10 RcmZ3+vWR(t;l{0ni~tqt1L*(& diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png index dd5d74dba56aabe4d56074a03d8d10116989edcc..ce802f07d1d867302a03d3ed063d4689ce56bb00 100644 GIT binary patch delta 141 zcmZ3)yo_anVSPnvglC$sFM}2X0|N&G3!@YRE0Dzq#CD9*aJCzx1_Lu#oQZ*TmUgTMqJ2I+y&%nKNys)1q)nBb}d7BC~&AZ?FxnZCT+s8_-W06sAfzW@LL delta 10 RcmZ3+vWR(t;l{0ni~tqt1L*(& diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png index 2340bde420ed5a2f045e0f96e316490af6cc798d..065815ad6c204985f1f2887198898ae6aa24d1fe 100644 GIT binary patch delta 2683 zcmV->3WW9E6Ui2k>3;<9qQ<9I000EMNkl!5uy_@|jOguJDI zC4d+cW4i$&?^&S;bH4^tSAT13Yy6?lm;I_Al(T{K_WtBkQ|}rM#0d+}z_ZE$qTI6! z8&+@eDu3>zWHwIoj|1;O5g{ua{>vvOK3q5uCm=i%&n^X&=cbwc)7BP!RE5dUz6DUI zW=4qQ)fPf?-BQa8f~26m~U zdU5HV;)D(vAd3wLGUke&Q+HTHqSrg8oQ7hW8Gk-Jym{q7oPZz`WK%<%&zIhBGRpA&$E`H_;0oK0sTxL;2n1li_X(~&P zu79-pa)aRZJE}FvEZ{(gEJE5^#kDmozIiKzrD&eArhN!=LW0bUrKrh*AjexHi}qq#7N)MEXXf1>5JULSmInekGgpnc7H;l zlgu@Skx3MfMu}Oc8ryaFF2k6FA}g^Z?YIAK8gG#=33O6(O)z*o%y59sJ7FwAhatW+ z9T@0jdrgM&Oyn8E2}%9Hs3o%PEf9WWNX40M8SGMt%aa-W?X@TMPiN&3#j zZ&zaw9;>r5X*SChI;mg`BTa|ywVLreJx0whaP@!1(~->rMCyT4pU}+?XX(O!00030 z|0WvA@Bjb>dPzhnz_#ly%&PneG=C_futWtZ z0x8QbC`gqoAyB*RA|UlaB|s{a7Ko7g5FjL!fVzNIitX5AySCG`i7)5p@yT3|J+713 zo=2psapHO0bH6$78zF>j(vaa8O`6Acdpx7#QyQBzHfYpoJeHR(eI=KcmSQy^6J&E_ zgshuQp=r%ZIH2I=U@%+snSa4Nq0cUuix)4)3JP8_$fSbNw2g|;_3i({52isAhsIQ8 zHv4t#z+|)6Te3MaHl(gM9tzWZdM6rSYOTpHF5ZY87|4W|P6)`@kfvF?D-Imkyc{Jk z^YhEG0|S{cr3MQQ{ z&WS^Z>{lr=YlH)iUsUEge<8~9!i6ibfdg3}lLMwMDI%+W|xkCmOjAa$ibb&c? zr1+9yJi8kXIPfw4^)fbRv$Ow177XUDnlZyD-#dJ`G~ETJt$#HO;Q_;NR6o;c&hW-9 zEPNk1IGD3nTT-dghdrU-kH?PHUZBwVX0UL)0RTs5syRc693iGHr=}jYsG!45{(mx&*!V1XFlyNB7o9m;BScZ2IPrVv!C;PMX^r356@L^yIhCrvO&!i$FmU{|hJB4U zLW96C69qDBzlFl*z^7m?n3HS5$^@yhMp4*1yv}<%T2}RprfrvkgX5<)ekRR+kY< z4)utDVEoaV3PueCxQ6yTIB>eK@i{7d{z+Bo;qS7+J#lY5!+92-36tuWFVigC+Owk{ zlpsQBL_LRC0iLsN4bKR5^ous93{Z*q=o|9=WK+ivfx6N=6w?tyzbKv+xM=u6W| z^+clZ#jZo*L1FYd4;6y(mT!8&;W`@pjTa8*I1C4Ga3>%v==AghnaSLf^YcH+#l`Pv z-`dqy(16{M7;xg*?6uZ+I0xtA8V3e6L{Lygsy)2`!3SZ1d35lidyo9R1B3iWgPi)W$z<-+u6FRK7I#?p z#nvc_MowW3;*XoHn!=000AkNklEJ8#oa6uz;ds!7zf14Dm+yEA0& z(2H;YppiNuy=)K&}C#Se3HkM;2 z_n1nS6W6{z=lk-V$Gumn0{`mu@7EfQpEql@vpaKhy~ovR|9`#bU34lHbFP%p_Arhg z8n(h_*bX1y3w(la1wxnq(6!ppbr=sv90z^k9|e4bukbm4By$?EUO%~2tq$Ilos2mD z;5#tL3C_ufX*9aGJ#TmrXYl`a9asR9$&t-C!otGw4f)|po28{6W_9(WSzmu^wzgiF z-Q6cVEoPX~*{sLriv1>LrUlvYClpwql z?;b}`Zk3xkT7AWl5O*Eb8f*@e z^Ush*lW$Vgf@FFzlRhO5^t9K}=fL(bIf)aWvSx|3?Xtf*pI73@g6&~q2>UUGfUHK6 z)H01}mN;N1y$;)>su?>gAZL+_NNF~|h*b-d3V$EMA?-@jiFNC6SL*I(Qj71)%`H*V;Y(OG#KlN8GD>73MX7;Zpn4@fj4?s*1wJu3 zm!&gp!;uiiKn!HxpJ?Tg0deJwl~DK;4ru`=a%PZG_YdrP`%!7s!aol9^hY(u1f0mo zFMk}y`gSwKhtd%PpGY;-bOxMYccHtiJ#Si z1o_KuBYIvs#lR={#^EgB1p9K`Rt&2J3G&SD@p@D`V&D^e<08OL&vcagtCUO(q<(5= zlJA#}82AL=IGj}~+HSgce%C!!VJS%O$05Q|EYA|7Ia5bCPSZptE( zmnmY^ML^Kf7E}-jA%O%`qL8+LM4KkDouqlRiPJcbCd2tWIo!c<$jfQQt~9c9eSaV4 z%y-W@zj@RcV>hJPFx!UMwJvQZZ|Ed*Q-o9R-D#44+akt2UEaubC)Xp9&ky6EPYvOVSo>vG{q%fhiWR)O~Y4uG%PC zn=;w#>TvjARyM)R+p}lC?l>^`WPi;3rjIK&n_V6@x!lUt_5ky^ZhT+g4;=>vpBxx` zT(P-a?V5?>rSt6srnmQI$AQ5oA50uCo;OJ{|4KW7>FyrwI57C+gQ+tq6sDhPCosm$ z*ulX|9Rmkn@W}_`m>3hV06;FI%F^PG6aD?)cMKSONx>{h;eUKfkhp*0)_)lVlgedd zW^GT;UmXJmU+{^c0CG8w7d}ufA^>Kd3p1T<9bg(WCk{;6fq^S+4+kIc#rfn${*J}J zXh>&kzk~-z!K70%#yk{99@vv7e{Xv*_<%3Yr>dl}#TyQxs7T*mQj4uFOoiV0t&z$+H?ciWDwx{)F!6wPvd)tEHhw$dk z{5rEWogF{^x6ICd+BR^o6`TDumd!rA{l8H7v8!w0#c-p>PiII>Qhz~7pw&Wx$Zv2lCq)X%|#!A5L#Haj(z z&(D6iD=2zWcqvWQS+l4iUys_;r@spp4z^*Vt1U$OtjOcpol}?s(N6|CVXbbeI%|v? zC!Ki{qv(E+aDWm;Kz|`xoJ7uK9@XM_@_Fs=J$;5X^Q`HN!KOwH(-^AINNHoz?n_$x zDTtawO~Dpya<*Zk8|f#>)T?`f(RgxL15brR)c6XGu>k3Tl;+^{^!#?DY7O;;4Jj0C zb15v2AH3Dr&-?m2JUF@!z!w6fG^f%WoDq?wf66%L`ctnvJb#mC8#5w}7e!Urj7(Ba zzP&F9+g(Ij3!~;})M!d`n>3tC(|SWkxX3Z)p3D&3l3^K-`mi^NeOtve}6{aa?-g zK%Kvvi^CY_0DnhQS~EC)%|Q{7R(O-|)^mS<|2MJ{y8k_DT+2ON9Z?`WgJ%(~uBPPk zm5+AQr!6~&8G@sY9*vr2a9A49n&SqbuES7ADIg$qci*zTy+7K%zHen~)R(ev?NVJd zusf1Q5ib@m*MH+2&gB{x9X=55t&+GRW0dlpW5+5lw|}g|_j)5HK96ozdM7xjHRLH{ z2i{=D5pPiXET8 zVz2b3>~8V@G60SO0*($sQEWsHTTm4c5k!hpNYo)x9iS9eJrXuDnbL9;jZbH@qkrUb oW7h$ZB==sI&u4vKTmAhXYUbWSQefIg00000Ne4wvM6N<$f=x_iV*mgE diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png index bf0610b78b4c196e9913f6bff4cb2b9262774b75..a19cbba430570539aa63850bf854036cec43c6d0 100644 GIT binary patch delta 2523 zcmc)K`#;l*1IKYnh>Q>->SS(7DFvn1RnY)qjai6*7l9F|X_>$X5E-}QC z&|FS5EMw#n%_X_iuyf8I@csGwe!PBv|Mu*Ycq{Q}6|hK!jfrt_oj7F&yK*y%`+E_* z>YTNBDqS*fKRe^1qQE@*MM>&;>FZ4*cqc>Ad332@gqR196`|fS++x%k=A?5zF)dO1 z9iL*Ew~l~xSx<`8>Bluvo4GZ1Y4}|CZ8kB^f%Y?eB7h`}@+Fm_u6tTMY$<#&v zN(r0?23YXG{+|K=``+sk{}-HC5?`>}Megja3)JXjjU?XTO*-y+jcg?U(V};ksFyRe z*2|kQ^h0-0uRwLN(CfJ4H>f`@tv#*6v{8xtXjgV#Fa(Q49jc9I(Q}BuN@SP>FD0$a z3jD${rNBmqPZfwx>nM6OyL7TxC9viI2Q5yTfYe`#Z+{o|bT}5*_TsPp^Rf{Op!pyz zIwU4Hj1k|o^y8+D7~2$*5bya>LFHsz!Ol#9Jbk*SoRb#n*YC9|I-*cc0>HC84g|(n z-01uE5WXEFB&9<(ZDU^(=I zL=5UiK)0UtgJ%!(KTA$HHY=J8VvYGBmPLTyp+}*A(<5~_u5Uc{Y5S~Gz-(AS1RK)% zK7>^Dx+&Wy^J{r6(daYux$tw)h^QAfx$QLxY~7YVM*DfC!ate5J*h~3 zqW{DmhjQ-3coGi*%5xnqRN;;%sxgoJZVKMiIC*Ba_2`Dt_0{6OR1P;67l&htiIV?E zNQHleWIeO1lKt05T}MdSyojOwyhz!cVw$RQhKL80#~qSu&7b}bPo_=F zJuMLSLIYo>1rvqosHv&n6Oj{rK~~ld;ZGa+x<>%kSKBLpGuCMg_vyYvne_E)XvFGI zB!G0;>$Lj;$lVFPKOb-68|52N3i0XLxICP3@ZYE&8r633tOU*g%t%}1y#!HsaP02V zOI*HHL^BGvIKLgg*P--4DkG7lCVAFVP#5ZMGM+-Ygw6*wk6GgOI%lr=ENpt;>ptM1IkHqtv!O&xpBabD^P^ z^W9WR5z0J;^0xw|jEmzscW12E;T0o{v(E`)9>GAWnv%qF%+UZ-NqH{G8a zd->#%Y>=UtQSc;sTCyf6Mw>De4QZaQbO-NRFNzUE_J@y~5hhtZTk(y({u)s@zK<3p z*_RLL8zom6(gT&4@vJ%E(z)<}XMdTOcHx==s+^B%%e$3X_`wTi3!7vMuwND+uF>C1 z5g>KW(NZAihaCa|rcC5wTS7(O*C`?{E#Vu5R?SaNEnJce}Co(D? z68Tpp?{nP6^UrwR=|L>0i}kPNcDJ0R2MI4PQ==isgF<@pi_p&cx(@D+K%VZIFi7Dw zCLuw}HJHE?E)l-Zuu3I|*8zcxW6YUR)jnA#84YqvB9af>wPgl8W=&Y`uB5|OUrjEo5$MLe2NqC~%>A&7{<{da73H4C=Hw!Fz) z8yX(U3%n}V_w7wd#t0@7J|&qqh(iNMQ?&xMx1%WCl$spx<|)hppe+31Fi)!>yt%+! zdEj$Uc6;C|5)jfeLB|B;Ot%b#D@0{cm}X*?asG(KBjg7NA$R3JkD0pQ;%x(4pFTI~ zl#O8gIF%jk0hY^LE!yIlFX|BA(dFKYjHgMm9l0M&UB^1~u9>@TThXgWPN6{GNSU@H z(w{yl#)~P*I~-P*P8-LF#8f`bp4Kk-X1^(oqZrr$(Zt=Z8k%i+9Mxj-Y#@Fb944pF zlg^@MOHV?%%+t;j(_2JckPf|fu5PZv0c*{e?^(RV%*cU_yrUozwrIKdx2DXBaSA1e zvEg*PG*Gif!Xy$LC1e9+!naBZHNBi0gPx+G3|#-kZkX}+f^y*xwd4a&^Do&IvBz$- zDH=*zr8*qLG`;mu(fc|Tn*^#4xA}a}}Q*Uu{1L|S{<#j_ukfXMh2=2NQ(M;rBzYt~xi6W*lFI^Bw~f_m#ajx?hT zh@ikZLExYMp9B8aecXmD=Df1eN9c`=FY1KbHQnWHwWTm8fW!B@yub$j*45vbb=WZvYs|%`bKEH`wAbn+va_A zhs<-c|L)$q4Np7eg{A4}u)G+z$GBp=q(K*goYIS7-X z#}|4)_RxS~!XsX5iG*Z=0-MDuNdM{T$j6Sx`pp&R*#;oZ}X&PPP)m$DF>SFX8wEVEYF@S@!k}<72EAUi_t9p8$5*_VG^A3X# z^wv8kN)c$JqVvVtewQgm1DWEO`#AIo+@TeP<$H5d&gbE3+-ajioS#jFA!X1yG_aJk z*_Pye)2E)UBk*FcB_9#Josrwc>3yQpU4D4PTYz>bw<o*`1upN`j4AbsxT5%ex=oEd)6NY}Kov-E!pRg&!PY+%TlQ`b>Gw%S|gq>{j zTVWX-!9pCg9B}yw^|cI)*^x)AqiPlYEFY}jXbe_loYsCl5(jhWjm)#{o#}hHSwsTN z7|Qju(H|7hiahpu-ck7XouH#}9l=cqaG%~eGeg(T6?8oNFl@uMqfGiwNws0mw`#Tz zwUXTI-o$?Stz43M9WA(IHSK4WS?1iQ|UF zyUor-7e9Wyhw~U)cj|glwsxx<8R(3;)OcsjEyJF;)$pmP{>WWxe@XnS7Fs`7+oOOSE ztD7Brrwu37sGo8oHi$eK9E=T|G!Yu`Xf87YFi%n`yINs2uUHisRkfIY%P!l1yBd69 zDL#B}gy78Zj#p9Q(*)u7Mfkwz{huH9i3IPd(X1N;l6}momgO<%n&X0A4UY%Wxymy~ z=k5*05w~uvDp@%ut(_YP{FZ<|u3DyJuC$Ib?W&e_b9wk|@Bj-73zHetbcOg2jcWhW zxLsh8EcGvpN5Tn&BW@#0dx75}@}Eo;1mEjr2(qKj$(i1aPq}*J(8}3%+ekn#MI|{| z-oR15gd0UDT6NFnOh4}-bU9t&V)DDntKF2Rj$w{Vv6d8IjP@{unOM?RJ$5~ePVKI) zZqHhC3KGUa8=k4w^MgfGEB0~JkSLMaRmIr|1wV98*%vs4zKo)qb3h@HLO!M5iq<3T z(F09RN_%`|n!H_BJY&OwjCoDO*Y#_8Pea1JITNajP*0@l8z*n29u+MWeG17%6RyesB2yHKZQkz6bie&tI=!0=BgeJaesyrVlAf&XVe7m%aActf{IGzuR-h z0&|kv>aM%`>yhF%ZcLH7`hnml*-3a+$XHxu%o;y9{JO?fGaSr`GyhM-HapWa_^+KU z|Ks3AOR$~6NCf@mMO|K#UH$gAuS`#4sMvEpiB&IGxNU!yGd2BWez7KqvzzOLf);fF z0qMVX7r2&5buj+a(U^6?bpPEaQLHY=j#V7I;2Y8J*rwgPptjk7T|5w(H4lyTnc9E9$nW}wrKx5 zZ^kx0ARpZWvKHvkhkh0?sCm0$1_lFgPUH_1^22iq@8*5yrWI1Vc6sk(TesDF=3(Og zrGSYuPcG#&j2s?ZGA>iwu#2qBd2T)yIxxlD^0 zM2JXm$!&rw)%9G;7GK9MP2|l7TsU~<`pnFCeC9;#E4I7ld9@h=58aDE@Mhi!Jh|l1 zJ%jvhebP%(TuIkLA|P`Q=;9-+2%(m=>n=IN#E+ZZx_%iX${mBp!wia}y~|f*DP0PY zk`<<%iy^xtyJb4_y!?ZSSph?h$<`Zjg^UAO8&#OKjqGh-3anMo#M zKTi80((V_Gq+2u{+!0|xEf29{ZMb%<0L`;r(_iVuu+>L`U{b)^#&}F~g%tp+{jF@N zS1qH+T5Hjd(`&eppFN*R-FV<%8)&zIpP0u5`3v3u%Cke>aGL_(I#h1JUGVYR+SVd3 zQLNs#`MN%?q%M&Z!yP~)CTRQoV?_sqy=2kNJ% z7C!4pY-p05=+#}X0<|G5-vx?1YRQo40Dqr1Ka#fOdlN)|hooNJFQwgG%Ri#RJ z-;E6I{H)qz>F)b8-R?o3QdS06UKWOn?P8p#&8oi4%+I5}UnP(Jfs4h=*xIP>5BK>0 E0$(fMG5`Po diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png index 0eaf230818a171ac3c709ba536cc9863ea4875e5..3a7c7d7277fce10d54fe3c5695a5e3c61ba03354 100644 GIT binary patch literal 853 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdl8)jKx9jP7LeL$-D$|DpDgn(|mmy zw18|51{Ovs23C*~Ahu(ahO^xmH5iz|;!F$-?U@WLP&Ix)8U!W)F-Q-DW?sMuRSgtd zzywzvuz(rC25Ebo`{f;w;wfH~tRms!EF{Fa=%`Er4BMv+)-#^bTK4h-IZgRMEmqUGX>6q~k_EXyuWy2pZOy(KKGce4y8pv)$teiW%gwDm<#rMNxl5EMDn@s`C0Gxu9$euV>S@hU$b6Qw&%B@ z+NGm@CO!sGxI!y3YYF#7gNc39R`G^v@4Gp9n{w{S7@$r6;+6jbBjNx5h>jgcfT5)T g3az)JVTCiS)_gZw6f|{>E-1};y85}Sb4q9e09H3TG5`Po delta 2741 zcmV;m3QG0W2KyC|F_E=2e+B61fDixx00p#3L_t(|0qmOBawAC)1NEotz4zXG@6F%V z4LD3LSX*N_qQtlrA3B<=i+jlc3aBP`;_%^EoFhjfbdDa4ICd=J`0pM5_6HU;nb^LGCE49xH}1A*r=Fu{w@pPL!D8-RkR01><#A^;>f9G(>D0Hw6* z?1lQe0D5pZJODbp2AtrTdee;HZWXJ4g20YrTcu2P?r zR-Ig5RAHzuQqq(|g?aU=tuT4+NpYx-`jXYxC{OBZ6-agARtKzlpi)>pPzg-`WA(?fQH=#h4<}oS+;Hnm`pz*hCUn&ch&CuqBnc6Z7j|QCJ#kX&}0LTpN zvhYxdi~;C2t{_%H!b}8MzNY}3cfJL@2Atr<_wO47f4GVYU5P_AhLjaJ!OBPWrMgt= zLvemnTjr`0IL^-E1;)Eye#-J7@infm#(0pdT4nMaTo=GR`>MI;;B4bqQr|xd(A8Hd z@P7-CRgOwiZ6nM?-+!5bV->j90A=N5v%>9W25u5yhUWivc>26CfLiH%7iOK)Qx?xz4v~GBAmLHLm580$ zPO4OP>w1lG1v;?&d0zky6=~mxc}&M8}UG%_icI`aX}DfxA`Ux&dZz z{#^&Q_2OKmF7T{83*7Ad{5b-kzzuC81PFU^4iUm*OdoXRRTf@Ffn5MmUxt?fR`3LJ ze+eLfx^8_F$G36*9>`+?@HG3X`3F3$bH36kefts^cm#;2a9@aEU$<=aY{k4IEVy&m z>rh@a>eJbo!4aT7fc&Jx_h5d`(f6q8MY;kg%XZl|19ati`ZD))15cp=G;Et64p3hP zN7~wp%WUSE>VOx&el-ArgVOTNf3MVsf9m|M?CZ+QYn%fVG{AXqRO%Z_-ade?J{0G7 zwr&Ma3S0sRC{6i=IHbY@r@*NIJxDYMv2h8|t;=U@J!J;+e~>WL z{ni;GT{Cd605%~1q%g4Z4ZK`o*g6Oj0)!tG`3^iKNXDcv;gKs$?trrHSo^x_=zv*$ zO?W6k>JV{&6};*fS%Rqg;uVGzUPXb`7D6HqC9!uv2bke$3!ww%>M}I@=GA4Ez;hed z3KX~so_>)~0nF-i`|bz83@-!pf0vgW9v&M0SdhD)%{|mt_rS66e1!v`z*SFJV=X*I zffYOf1Y)0cQJjP8>V0P01;DZgZUHV{T9#6G3(&qW;=Qj+fh(x+KL7v#|Npt!uC)LF z1h`2=K~(LU*K*rX3`F&*sZNj6dz{{T&);r@P{&@wxD;)VB__iM3>D|?f6Okh06Ejy zv)WbX&Ph?{&v$jSC=kHmoH13n_XSGB3->IUArb-zb@Up+10IE((T*QojYCK zy(`_jw^R4;OAj9G)We6;)>c=K9!b>W$I_E0T|Ip&J$u&G^XJlw7t+g@(yLd}>(^bq zc_Za|`&N4QPI~`d`tU*efA~@Q^hx^sS^Dxt`ubJ+_N}Y$-zDnD4~hEuQ~LEw`u%%P z&33^Hm=nMbBJkol0UVP8TlT$iW4DF(YhP>|&#>+g`!2I^*mram2B7!8=zjq8{^z}~ z)%O6Gp+)cWz8C$^dtZhZeK7hT&>S57Z|yyh0n&mOLnHvAz8D+L{PU0TA`&Y0JcQ5SIgVh#VGN zg+LsO0)d#-=)v0aUWIK9=eG6VlZEX9Jvx94e~yg}sjB#Y21&%3Jc&8$ zdz9gvzv^oYO5}+Ok5qvZz`c2JUqb}dojxs975|S4t0)tpdRde~iTSh@FOvMM`8F6ZD~Ntv&9^~70@Lm5*5!9> zB-J*;TRPM?e~`c^`quC|gYP&>qBO3Vk=Q3I@?`QKIz5EWKR z#LlR&vU8sTeIKq43ZXuf#~w_GF4nkil{3`TZo~;i?BRR8V5JGw(_If7Dm0(0gB>`cNG3vhp}(Z66bk zAD6rWCJ_G>fYk(c6%J9KTXz|}fY=0B!3!H#LxcfRh3Qo((BTnV{E2=0PFOALw$wKP zw2zB&Y;gh873LxQ3K2nqYnnaK8O>*#rJ{LA@x82mqi#~<665g z79OJl{cRl3{OK#)1kf(eK7I29#<~?eA`Jb{2T9nMuT&S4c(yb|w-gu=CY0yuJBR|k z|Fu5z^ Date: Tue, 24 Aug 2021 12:31:17 -0700 Subject: [PATCH 07/40] Update to Swift 5.4 --- FBSnapshotTestCaseDemo/Podfile | 2 +- FBSnapshotTestCaseDemo/Podfile.lock | 2 +- Package.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FBSnapshotTestCaseDemo/Podfile b/FBSnapshotTestCaseDemo/Podfile index 509f562..2316cc4 100644 --- a/FBSnapshotTestCaseDemo/Podfile +++ b/FBSnapshotTestCaseDemo/Podfile @@ -14,7 +14,7 @@ end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '5.1' + config.build_settings['SWIFT_VERSION'] = '5.4' end end end diff --git a/FBSnapshotTestCaseDemo/Podfile.lock b/FBSnapshotTestCaseDemo/Podfile.lock index 77f03c3..f9560b8 100644 --- a/FBSnapshotTestCaseDemo/Podfile.lock +++ b/FBSnapshotTestCaseDemo/Podfile.lock @@ -15,6 +15,6 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: iOSSnapshotTestCase: 8f1c29a4de3a4ca26113fbcb107558aaa3a0a356 -PODFILE CHECKSUM: 35ff607c3424eed6ccbd8fdacc2d5c1ea41a5a0c +PODFILE CHECKSUM: e9826e7811f492c766ff702fdf662aa1f88bd489 COCOAPODS: 1.10.2 diff --git a/Package.swift b/Package.swift index 2c2a28e..688bd6b 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.4 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription From 4bc9f2011c2816b605469e689a0e37afab835e0b Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 12:34:17 -0700 Subject: [PATCH 08/40] Update CHANGELOG for v7.0 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d42946e..43c545c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 7.0.0 + +- Support for Swift Package Manager. +- Updated for Xcode 12.5 and Swift 5.4. + ## 6.2.0 - Fixed issue where images without the screen scale in the file name were failing. ([#100](https://github.com/uber/ios-snapshot-test-case/pull/100)) From 585eeb1a61a2efba51a8c4b1d0d812975919dbf3 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 12:35:38 -0700 Subject: [PATCH 09/40] Update podspec for 7.0.0 --- iOSSnapshotTestCase.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOSSnapshotTestCase.podspec b/iOSSnapshotTestCase.podspec index 5bc4411..ea9833f 100644 --- a/iOSSnapshotTestCase.podspec +++ b/iOSSnapshotTestCase.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "iOSSnapshotTestCase" s.module_name = "FBSnapshotTestCase" - s.version = "6.2.0" + s.version = "7.0.0" s.summary = "Snapshot view unit tests for iOS" s.description = <<-DESC A "snapshot test case" takes a configured UIView or CALayer @@ -17,7 +17,7 @@ Pod::Spec.new do |s| :tag => s.version.to_s } s.ios.deployment_target = '10.0' s.tvos.deployment_target = '10.0' - s.swift_version = '5.1' + s.swift_version = '5.4' s.requires_arc = true s.frameworks = 'XCTest','UIKit','Foundation','QuartzCore' s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } From 6743a701c996d8aa249e1acfbcb4fa7af4365ea6 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 12:42:18 -0700 Subject: [PATCH 10/40] Update podspec after public headers move in #126 --- iOSSnapshotTestCase.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSSnapshotTestCase.podspec b/iOSSnapshotTestCase.podspec index ea9833f..d4a5648 100644 --- a/iOSSnapshotTestCase.podspec +++ b/iOSSnapshotTestCase.podspec @@ -25,7 +25,7 @@ Pod::Spec.new do |s| s.default_subspecs = 'SwiftSupport' s.subspec 'Core' do |cs| cs.source_files = 'FBSnapshotTestCase/**/*.{h,m}', 'FBSnapshotTestCase/*.{h,m}' - cs.public_header_files = 'FBSnapshotTestCase/FBSnapshotTestCase.h','FBSnapshotTestCase/FBSnapshotTestCasePlatform.h','FBSnapshotTestCase/FBSnapshotTestController.h' + cs.public_header_files = 'FBSnapshotTestCase/Public/FBSnapshotTestCase.h','FBSnapshotTestCase/Public/FBSnapshotTestCasePlatform.h','FBSnapshotTestCase/Public/FBSnapshotTestController.h' cs.private_header_files = 'FBSnapshotTestCase/Categories/UIImage+Compare.h','FBSnapshotTestCase/Categories/UIImage+Diff.h','FBSnapshotTestCase/Categories/UIImage+Snapshot.h' end s.subspec 'SwiftSupport' do |cs| From fece014603588c86604e037d46ed0cad1c398954 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 12:54:42 -0700 Subject: [PATCH 11/40] Update Cartfile.resolved for 7.0.0 --- iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved b/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved index 4f9d436..40d7889 100644 --- a/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved +++ b/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved @@ -1 +1 @@ -github "uber/ios-snapshot-test-case" "6.2.0" +github "uber/ios-snapshot-test-case" "7.0.0" From 07c37dc09914c305a72b1412afa6cffb67483626 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 15:23:59 -0700 Subject: [PATCH 12/40] Update release doc --- docs/HowToRelease.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/HowToRelease.md b/docs/HowToRelease.md index c1b1332..616ca4f 100644 --- a/docs/HowToRelease.md +++ b/docs/HowToRelease.md @@ -1,10 +1,12 @@ = How to Release = 1. Update the CHANGELOG.md 2. Update iOSSnapshotTestCase.podspec version number -3. `pod install` inside FBSnapshotTestCaseDemo/ -4. Commit all the changes -5. Tag the commit in master with `git tag version-number`; e.g., `git tag 0.0.1` -6. Push the tag with `git push --tags` -7. `pod trunk push iOSSnapshotTestCase.podspec` -8. `carthage build --archive --configuration Debug` -9. Upload the `FBSnapshotTestCase.framework.zip` to the tagged release on Github for the version number +3. `pod spec lint` inside repo root +4. `pod install` inside FBSnapshotTestCaseDemo/ +5. `pod trunk push iOSSnapshotTestCase.podspec` +6. `carthage build --no-skip-current --use-xcframeworks` inside `iOSSnapshotTestCaseCarthageDemo/` +7. Commit all the changes +8. Tag the commit in master with `git tag version-number`; e.g., `git tag 0.0.1` +9. Push the tag with `git push --tags` +10. `carthage build --archive --configuration Debug --use-xcframeworks` +11. Upload the `FBSnapshotTestCase.framework.zip` to the tagged release on Github for the version number From d98557967177e9d3966929b134fd361d8098e022 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Tue, 24 Aug 2021 18:05:21 -0700 Subject: [PATCH 13/40] Create Action (#151) * Fix Carthage Demo * Remove the specs repo to speed up pod install * Create Action --- .github/workflows/main.yml | 40 +++++++++++++++++++ .../FBSnapshotTestCaseDemoTests.m | 3 +- FBSnapshotTestCaseDemo/Podfile | 3 +- FBSnapshotTestCaseDemo/Podfile.lock | 12 +++--- build.sh | 2 +- .../project.pbxproj | 19 +++++---- 6 files changed, 62 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6d66caa --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: macos-11 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: ./build.sh + + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: failed-snapshots + path: | + FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FailedSnapshotImages + iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/FailedSnapshotImages + diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m index 508be31..db5e02e 100644 --- a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m +++ b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m @@ -32,7 +32,8 @@ - (void)testViewSnapshot FBSnapshotVerifyLayer(redView.layer, nil); } -- (void)testViewSnapshotWithVisualEffects +/// Disabled due to incompatibility with github actions runner simulator? +- (void)_testViewSnapshotWithVisualEffects { if ([UIVisualEffect class]) { UIVisualEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; diff --git a/FBSnapshotTestCaseDemo/Podfile b/FBSnapshotTestCaseDemo/Podfile index 2316cc4..fb3eced 100644 --- a/FBSnapshotTestCaseDemo/Podfile +++ b/FBSnapshotTestCaseDemo/Podfile @@ -1,5 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '10.0' +platform :ios, '14.5' use_frameworks! diff --git a/FBSnapshotTestCaseDemo/Podfile.lock b/FBSnapshotTestCaseDemo/Podfile.lock index f9560b8..4d68011 100644 --- a/FBSnapshotTestCaseDemo/Podfile.lock +++ b/FBSnapshotTestCaseDemo/Podfile.lock @@ -1,8 +1,8 @@ PODS: - - iOSSnapshotTestCase (6.2.0): - - iOSSnapshotTestCase/SwiftSupport (= 6.2.0) - - iOSSnapshotTestCase/Core (6.2.0) - - iOSSnapshotTestCase/SwiftSupport (6.2.0): + - iOSSnapshotTestCase (7.0.0): + - iOSSnapshotTestCase/SwiftSupport (= 7.0.0) + - iOSSnapshotTestCase/Core (7.0.0) + - iOSSnapshotTestCase/SwiftSupport (7.0.0): - iOSSnapshotTestCase/Core DEPENDENCIES: @@ -13,8 +13,8 @@ EXTERNAL SOURCES: :path: ".." SPEC CHECKSUMS: - iOSSnapshotTestCase: 8f1c29a4de3a4ca26113fbcb107558aaa3a0a356 + iOSSnapshotTestCase: 63402a5707db9c4103b6cc3f04c76e981fff7952 -PODFILE CHECKSUM: e9826e7811f492c766ff702fdf662aa1f88bd489 +PODFILE CHECKSUM: fbb7d596ed79771148d8ba7593d4cf7f99855e88 COCOAPODS: 1.10.2 diff --git a/build.sh b/build.sh index 1d8e5e3..5118287 100755 --- a/build.sh +++ b/build.sh @@ -49,7 +49,7 @@ function ci_demo_preprocessor() { function ci_carthage_demo() { NAME=$1 pushd iOSSnapshotTestCaseCarthageDemo - carthage bootstrap + carthage bootstrap --no-use-binaries --use-xcframeworks # we're using --no-use-binaries because carthage's archive doesn't yet create xcframeworks, and we're using --use-xcframeworks because of Xcode 12 xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \ -scheme iOSSnapshotTestCaseCarthageDemo \ -destination "platform=iOS Simulator,name=${NAME}" \ diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj index babe47e..7931979 100644 --- a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj @@ -3,16 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ + 76F8D72026D5BFA800813F9B /* FBSnapshotTestCase.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76F8D71F26D5BFA800813F9B /* FBSnapshotTestCase.xcframework */; }; + 76F8D72126D5BFA800813F9B /* FBSnapshotTestCase.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 76F8D71F26D5BFA800813F9B /* FBSnapshotTestCase.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 76F8D72326D5BFB200813F9B /* FBSnapshotTestCase.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76F8D71F26D5BFA800813F9B /* FBSnapshotTestCase.xcframework */; }; E793D4A321ED6CB3001039B0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E793D4A221ED6CB3001039B0 /* AppDelegate.swift */; }; E793D4AA21ED6CB4001039B0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E793D4A921ED6CB4001039B0 /* Assets.xcassets */; }; E793D4AD21ED6CB4001039B0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E793D4AB21ED6CB4001039B0 /* LaunchScreen.storyboard */; }; E7E942DF21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7E942DE21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.swift */; }; - E7E942E821ED6F47005BC62E /* FBSnapshotTestCase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E942E721ED6F47005BC62E /* FBSnapshotTestCase.framework */; }; - E7E942EA21ED704D005BC62E /* FBSnapshotTestCase.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E7E942E721ED6F47005BC62E /* FBSnapshotTestCase.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -26,19 +27,21 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - E7E942E921ED7039005BC62E /* CopyFiles */ = { + 76F8D72226D5BFA800813F9B /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - E7E942EA21ED704D005BC62E /* FBSnapshotTestCase.framework in CopyFiles */, + 76F8D72126D5BFA800813F9B /* FBSnapshotTestCase.xcframework in Embed Frameworks */, ); + name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 76F8D71F26D5BFA800813F9B /* FBSnapshotTestCase.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = FBSnapshotTestCase.xcframework; path = Carthage/Build/FBSnapshotTestCase.xcframework; sourceTree = ""; }; E793D49F21ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSSnapshotTestCaseCarthageDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; E793D4A221ED6CB3001039B0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; E793D4A921ED6CB4001039B0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -55,6 +58,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 76F8D72026D5BFA800813F9B /* FBSnapshotTestCase.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -62,7 +66,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E7E942E821ED6F47005BC62E /* FBSnapshotTestCase.framework in Frameworks */, + 76F8D72326D5BFB200813F9B /* FBSnapshotTestCase.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -111,6 +115,7 @@ E7E942E621ED6F46005BC62E /* Frameworks */ = { isa = PBXGroup; children = ( + 76F8D71F26D5BFA800813F9B /* FBSnapshotTestCase.xcframework */, E7E942E721ED6F47005BC62E /* FBSnapshotTestCase.framework */, ); name = Frameworks; @@ -126,6 +131,7 @@ E793D49B21ED6CB3001039B0 /* Sources */, E793D49C21ED6CB3001039B0 /* Frameworks */, E793D49D21ED6CB3001039B0 /* Resources */, + 76F8D72226D5BFA800813F9B /* Embed Frameworks */, ); buildRules = ( ); @@ -143,7 +149,6 @@ E7E942D821ED6EE1005BC62E /* Sources */, E7E942D921ED6EE1005BC62E /* Frameworks */, E7E942DA21ED6EE1005BC62E /* Resources */, - E7E942E921ED7039005BC62E /* CopyFiles */, ); buildRules = ( ); From c31f0acb576b1b8e4525984476cbb75b4a249ce7 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Wed, 25 Aug 2021 13:36:22 -0700 Subject: [PATCH 14/40] Update README.md Correct the SwiftPM dependency example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9e9ca5..44133c4 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Add the following line to your `Package.swift`: ```spm dependencies: [ - .package(url: "https://github.com/uber/ios-snapshot-test-case.git", .exact("6.2.1")), + .package(url: "https://github.com/uber/ios-snapshot-test-case.git", from("7.0.0")), ], ``` From 27b03f8dd17fdbb81572d091f682ea5c1e3fde45 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Wed, 25 Aug 2021 13:44:26 -0700 Subject: [PATCH 15/40] Add a SwiftPM Demo Project for integration testing (#153) --- build.sh | 16 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 148 ++++++ .../Shared/Assets.xcassets/Contents.json | 6 + .../Shared/ContentView.swift | 21 + .../iOSSnapshotTestCaseSwiftPMDemoApp.swift | 17 + .../Tests iOS/Info.plist | 22 + ...napshotTestCaseSwiftPMDemoSwiftTests.swift | 25 + .../testExample@2x.png | Bin 0 -> 841 bytes iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist | 50 ++ .../project.pbxproj | 496 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/swiftpm/Package.resolved | 16 + ...SnapshotTestCaseSwiftPMDemo (iOS).xcscheme | 109 ++++ 15 files changed, 952 insertions(+) create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme diff --git a/build.sh b/build.sh index 5118287..f9cfca5 100755 --- a/build.sh +++ b/build.sh @@ -61,7 +61,23 @@ function ci_carthage_demo() { popd } +function ci_swiftpm_demo() { + NAME=$1 + pushd iOSSnapshotTestCaseSwiftPMDemo + xcodebuild -project iOSSnapshotTestCaseSwiftPMDemo.xcodeproj \ + -scheme "iOSSnapshotTestCaseSwiftPMDemo (iOS)" \ + -destination "platform=iOS Simulator,name=${NAME}" \ + build-for-testing + xcodebuild -project iOSSnapshotTestCaseSwiftPMDemo.xcodeproj \ + -scheme "iOSSnapshotTestCaseSwiftPMDemo (iOS)" \ + -destination "platform=iOS Simulator,name=${NAME}" \ + test-without-building + popd +} + ci_lib "iPhone 8" && ci_demo "iPhone 8" && ci_demo_preprocessor "iPhone 8" ci_lib "iPhone 11" && ci_demo "iPhone 11" && ci_demo_preprocessor "iPhone 11" ci_lib "iPhone 8" && ci_carthage_demo "iPhone 8" ci_lib "iPhone 11" && ci_carthage_demo "iPhone 11" +ci_lib "iPhone 8" && ci_swiftpm_demo "iPhone 8" +ci_lib "iPhone 11" && ci_swiftpm_demo "iPhone 11" diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json b/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..c136eaf --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,148 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json b/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift b/iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift new file mode 100644 index 0000000..b62669f --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift @@ -0,0 +1,21 @@ +// +// ContentView.swift +// Shared +// +// Created by Alan Zeino on 8/24/21. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, world!") + .padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift b/iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift new file mode 100644 index 0000000..757ac6a --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift @@ -0,0 +1,17 @@ +// +// iOSSnapshotTestCaseSwiftPMDemoApp.swift +// Shared +// +// Created by Alan Zeino on 8/24/21. +// + +import SwiftUI + +@main +struct iOSSnapshotTestCaseSwiftPMDemoApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist b/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift b/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift new file mode 100644 index 0000000..8d6d3c3 --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017-2019, Uber Technologies, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import XCTest +import FBSnapshotTestCase + +class iOSSnapshotTestCaseSwiftPMDemoSwiftTests: FBSnapshotTestCase { + + override func setUp() { + super.setUp() + recordMode = false + } + + func testExample() { + let view = UIView(frame: CGRect(x: 0, y: 0, width: 64, height: 64)) + view.backgroundColor = UIColor.blue + FBSnapshotVerifyView(view) + FBSnapshotVerifyLayer(view.layer) + } +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png b/iOSSnapshotTestCaseSwiftPMDemo/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..210534ff99f0806db82bfa76fc4c8ba32a174c31 GIT binary patch literal 841 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|DpDgn(|mmy zw18|51{Ovs23C*~Ahu(ahO^xmH5iz|;!F$-?U@WLP&Ix)8U!W)F-Q-DW?sMuRSgtd zzyw#_uz(rC25FncyyqH_;wB*%XqpthEy=VxxTUYh=Tz0!ISncr)oaCkZNO~Cx2V@&fUGw*Z;Bq!0?E% zfXn-8D9`o4@`VcmT82aG>NH>h08V-jd!*!rqmpOM3%L3dG^ za03I&iqQSloDK|3If7efGq5N)to?P@n}JCnp?k$$76k^ztgG+iK)Rw`-l{P$as;fd z`z{33bwer39Arq;*WJ^Bx(gTe~DWM4f<6-=+ literal 0 HcmV?d00001 diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist b/iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist new file mode 100644 index 0000000..efc211a --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist @@ -0,0 +1,50 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + + UIApplicationSupportsIndirectInputEvents + + UILaunchScreen + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4537f9b --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj @@ -0,0 +1,496 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 52; + objects = { + +/* Begin PBXBuildFile section */ + 76F8D71C26D5B0F300813F9B /* FBSnapshotTestCase in Frameworks */ = {isa = PBXBuildFile; productRef = 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */; }; + 76F8D71D26D5B0F300813F9B /* FBSnapshotTestCase in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 76FFF53726D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF53626D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift */; }; + 76FFF54426D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF51B26D5A9C50072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift */; }; + 76FFF54626D5A9C60072E261 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF51C26D5A9C50072E261 /* ContentView.swift */; }; + 76FFF54826D5A9C60072E261 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76FFF51D26D5A9C60072E261 /* Assets.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 76FFF53326D5A9C60072E261 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 76FFF51626D5A9C50072E261 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 76FFF52126D5A9C60072E261; + remoteInfo = "iOSSnapshotTestCaseSwiftPMDemo (iOS)"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 76F8D71E26D5B0F300813F9B /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 76F8D71D26D5B0F300813F9B /* FBSnapshotTestCase in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 76FFF51B26D5A9C50072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSSnapshotTestCaseSwiftPMDemoApp.swift; sourceTree = ""; }; + 76FFF51C26D5A9C50072E261 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 76FFF51D26D5A9C60072E261 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 76FFF52226D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSSnapshotTestCaseSwiftPMDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 76FFF52526D5A9C60072E261 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 76FFF53226D5A9C60072E261 /* Tests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 76FFF53626D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift; sourceTree = ""; }; + 76FFF53826D5A9C60072E261 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 76FFF51F26D5A9C60072E261 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 76FFF52F26D5A9C60072E261 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 76F8D71C26D5B0F300813F9B /* FBSnapshotTestCase in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 76FFF51526D5A9C50072E261 = { + isa = PBXGroup; + children = ( + 76FFF51A26D5A9C50072E261 /* Shared */, + 76FFF52426D5A9C60072E261 /* iOS */, + 76FFF53526D5A9C60072E261 /* Tests iOS */, + 76FFF52326D5A9C60072E261 /* Products */, + ); + sourceTree = ""; + }; + 76FFF51A26D5A9C50072E261 /* Shared */ = { + isa = PBXGroup; + children = ( + 76FFF51B26D5A9C50072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift */, + 76FFF51C26D5A9C50072E261 /* ContentView.swift */, + 76FFF51D26D5A9C60072E261 /* Assets.xcassets */, + ); + path = Shared; + sourceTree = ""; + }; + 76FFF52326D5A9C60072E261 /* Products */ = { + isa = PBXGroup; + children = ( + 76FFF52226D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemo.app */, + 76FFF53226D5A9C60072E261 /* Tests iOS.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 76FFF52426D5A9C60072E261 /* iOS */ = { + isa = PBXGroup; + children = ( + 76FFF52526D5A9C60072E261 /* Info.plist */, + ); + path = iOS; + sourceTree = ""; + }; + 76FFF53526D5A9C60072E261 /* Tests iOS */ = { + isa = PBXGroup; + children = ( + 76FFF53626D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift */, + 76FFF53826D5A9C60072E261 /* Info.plist */, + ); + path = "Tests iOS"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 76FFF52126D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemo (iOS) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 76FFF54C26D5A9C60072E261 /* Build configuration list for PBXNativeTarget "iOSSnapshotTestCaseSwiftPMDemo (iOS)" */; + buildPhases = ( + 76FFF51E26D5A9C60072E261 /* Sources */, + 76FFF51F26D5A9C60072E261 /* Frameworks */, + 76FFF52026D5A9C60072E261 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "iOSSnapshotTestCaseSwiftPMDemo (iOS)"; + productName = "iOSSnapshotTestCaseSwiftPMDemo (iOS)"; + productReference = 76FFF52226D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemo.app */; + productType = "com.apple.product-type.application"; + }; + 76FFF53126D5A9C60072E261 /* Tests iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 76FFF55226D5A9C60072E261 /* Build configuration list for PBXNativeTarget "Tests iOS" */; + buildPhases = ( + 76FFF52E26D5A9C60072E261 /* Sources */, + 76FFF52F26D5A9C60072E261 /* Frameworks */, + 76FFF53026D5A9C60072E261 /* Resources */, + 76F8D71E26D5B0F300813F9B /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 76FFF53426D5A9C60072E261 /* PBXTargetDependency */, + ); + name = "Tests iOS"; + packageProductDependencies = ( + 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */, + ); + productName = "Tests iOS"; + productReference = 76FFF53226D5A9C60072E261 /* Tests iOS.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 76FFF51626D5A9C50072E261 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1250; + LastUpgradeCheck = 1250; + TargetAttributes = { + 76FFF52126D5A9C60072E261 = { + CreatedOnToolsVersion = 12.5.1; + }; + 76FFF53126D5A9C60072E261 = { + CreatedOnToolsVersion = 12.5.1; + TestTargetID = 76FFF52126D5A9C60072E261; + }; + }; + }; + buildConfigurationList = 76FFF51926D5A9C50072E261 /* Build configuration list for PBXProject "iOSSnapshotTestCaseSwiftPMDemo" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 76FFF51526D5A9C50072E261; + packageReferences = ( + 76F8D71A26D5B0F300813F9B /* XCRemoteSwiftPackageReference "ios-snapshot-test-case" */, + ); + productRefGroup = 76FFF52326D5A9C60072E261 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 76FFF52126D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemo (iOS) */, + 76FFF53126D5A9C60072E261 /* Tests iOS */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 76FFF52026D5A9C60072E261 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 76FFF54826D5A9C60072E261 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 76FFF53026D5A9C60072E261 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 76FFF51E26D5A9C60072E261 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 76FFF54626D5A9C60072E261 /* ContentView.swift in Sources */, + 76FFF54426D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 76FFF52E26D5A9C60072E261 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 76FFF53726D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 76FFF53426D5A9C60072E261 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 76FFF52126D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemo (iOS) */; + targetProxy = 76FFF53326D5A9C60072E261 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 76FFF54A26D5A9C60072E261 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 76FFF54B26D5A9C60072E261 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 76FFF54D26D5A9C60072E261 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = iOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.uber.iOSSnapshotTestCaseSwiftPMDemo; + PRODUCT_NAME = iOSSnapshotTestCaseSwiftPMDemo; + SDKROOT = iphoneos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 76FFF54E26D5A9C60072E261 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = iOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.uber.iOSSnapshotTestCaseSwiftPMDemo; + PRODUCT_NAME = iOSSnapshotTestCaseSwiftPMDemo; + SDKROOT = iphoneos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 76FFF55326D5A9C60072E261 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Tests iOS/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.uber.Tests-iOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "iOSSnapshotTestCaseSwiftPMDemo (iOS)"; + }; + name = Debug; + }; + 76FFF55426D5A9C60072E261 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Tests iOS/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.uber.Tests-iOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "iOSSnapshotTestCaseSwiftPMDemo (iOS)"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 76FFF51926D5A9C50072E261 /* Build configuration list for PBXProject "iOSSnapshotTestCaseSwiftPMDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 76FFF54A26D5A9C60072E261 /* Debug */, + 76FFF54B26D5A9C60072E261 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 76FFF54C26D5A9C60072E261 /* Build configuration list for PBXNativeTarget "iOSSnapshotTestCaseSwiftPMDemo (iOS)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 76FFF54D26D5A9C60072E261 /* Debug */, + 76FFF54E26D5A9C60072E261 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 76FFF55226D5A9C60072E261 /* Build configuration list for PBXNativeTarget "Tests iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 76FFF55326D5A9C60072E261 /* Debug */, + 76FFF55426D5A9C60072E261 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 76F8D71A26D5B0F300813F9B /* XCRemoteSwiftPackageReference "ios-snapshot-test-case" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/uber/ios-snapshot-test-case"; + requirement = { + branch = main; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */ = { + isa = XCSwiftPackageProductDependency; + package = 76F8D71A26D5B0F300813F9B /* XCRemoteSwiftPackageReference "ios-snapshot-test-case" */; + productName = FBSnapshotTestCase; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 76FFF51626D5A9C50072E261 /* Project object */; +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..5f5bab6 --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "FBSnapshotTestCase", + "repositoryURL": "https://github.com/uber/ios-snapshot-test-case", + "state": { + "branch": "main", + "revision": "07c37dc09914c305a72b1412afa6cffb67483626", + "version": null + } + } + ] + }, + "version": 1 +} diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme new file mode 100644 index 0000000..3d2a74e --- /dev/null +++ b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 881d0b379e7aa5af8f32607e157b70f0b6771597 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Wed, 25 Aug 2021 14:32:06 -0700 Subject: [PATCH 16/40] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44133c4..86c5203 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,12 @@ Add the following line to your `Package.swift`: ```spm dependencies: [ - .package(url: "https://github.com/uber/ios-snapshot-test-case.git", from("7.0.0")), + .package(url: "https://github.com/uber/ios-snapshot-test-case.git", from: "7.0.0"), ], ``` +...or integrate with Xcode via `File -> Swift Packages -> Add Package Dependency...` using the URL of the repository. We recommend using "Up to Next Major" with the Version field, as we use Semantic Versioning and only put breaking changes in major versions. + ### Step 2: Setup Test Scheme Replace "Tests" with the name of your test project. From 3346c90a713395a52a9db910970dcaad0e7df4dd Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Wed, 25 Aug 2021 14:41:23 -0700 Subject: [PATCH 17/40] Fewer things to test in build.sh (#154) --- build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index f9cfca5..ba173b5 100755 --- a/build.sh +++ b/build.sh @@ -77,7 +77,7 @@ function ci_swiftpm_demo() { ci_lib "iPhone 8" && ci_demo "iPhone 8" && ci_demo_preprocessor "iPhone 8" ci_lib "iPhone 11" && ci_demo "iPhone 11" && ci_demo_preprocessor "iPhone 11" -ci_lib "iPhone 8" && ci_carthage_demo "iPhone 8" -ci_lib "iPhone 11" && ci_carthage_demo "iPhone 11" -ci_lib "iPhone 8" && ci_swiftpm_demo "iPhone 8" -ci_lib "iPhone 11" && ci_swiftpm_demo "iPhone 11" +ci_carthage_demo "iPhone 8" +ci_carthage_demo "iPhone 11" +ci_swiftpm_demo "iPhone 8" +ci_swiftpm_demo "iPhone 11" From f53ac6b677d9095d384d5dc2ed01e0df1c744adc Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Mon, 30 Aug 2021 15:38:03 -0700 Subject: [PATCH 18/40] Change package dep on demo project to local (#156) --- .../project.pbxproj | 35 +++++++++---------- .../xcshareddata/swiftpm/Package.resolved | 16 --------- 2 files changed, 16 insertions(+), 35 deletions(-) delete mode 100644 iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj index 4537f9b..cef9c46 100644 --- a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj +++ b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj @@ -7,12 +7,12 @@ objects = { /* Begin PBXBuildFile section */ - 76F8D71C26D5B0F300813F9B /* FBSnapshotTestCase in Frameworks */ = {isa = PBXBuildFile; productRef = 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */; }; - 76F8D71D26D5B0F300813F9B /* FBSnapshotTestCase in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 76FFF53726D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF53626D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift */; }; 76FFF54426D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF51B26D5A9C50072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift */; }; 76FFF54626D5A9C60072E261 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF51C26D5A9C50072E261 /* ContentView.swift */; }; 76FFF54826D5A9C60072E261 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76FFF51D26D5A9C60072E261 /* Assets.xcassets */; }; + E7C9A6FD26DC239C001AA250 /* FBSnapshotTestCase in Frameworks */ = {isa = PBXBuildFile; productRef = E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */; }; + E7C9A6FE26DC239C001AA250 /* FBSnapshotTestCase in Embed Frameworks */ = {isa = PBXBuildFile; productRef = E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -32,7 +32,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 76F8D71D26D5B0F300813F9B /* FBSnapshotTestCase in Embed Frameworks */, + E7C9A6FE26DC239C001AA250 /* FBSnapshotTestCase in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -48,6 +48,7 @@ 76FFF53226D5A9C60072E261 /* Tests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 76FFF53626D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift; sourceTree = ""; }; 76FFF53826D5A9C60072E261 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E7C9A6FA26DC2367001AA250 /* ios-snapshot-test-case */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "ios-snapshot-test-case"; path = ..; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,7 +63,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 76F8D71C26D5B0F300813F9B /* FBSnapshotTestCase in Frameworks */, + E7C9A6FD26DC239C001AA250 /* FBSnapshotTestCase in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -72,10 +73,12 @@ 76FFF51526D5A9C50072E261 = { isa = PBXGroup; children = ( + E7C9A6FA26DC2367001AA250 /* ios-snapshot-test-case */, 76FFF51A26D5A9C50072E261 /* Shared */, 76FFF52426D5A9C60072E261 /* iOS */, 76FFF53526D5A9C60072E261 /* Tests iOS */, 76FFF52326D5A9C60072E261 /* Products */, + E7C9A6FB26DC239C001AA250 /* Frameworks */, ); sourceTree = ""; }; @@ -115,6 +118,13 @@ path = "Tests iOS"; sourceTree = ""; }; + E7C9A6FB26DC239C001AA250 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -151,7 +161,7 @@ ); name = "Tests iOS"; packageProductDependencies = ( - 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */, + E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */, ); productName = "Tests iOS"; productReference = 76FFF53226D5A9C60072E261 /* Tests iOS.xctest */; @@ -185,7 +195,6 @@ ); mainGroup = 76FFF51526D5A9C50072E261; packageReferences = ( - 76F8D71A26D5B0F300813F9B /* XCRemoteSwiftPackageReference "ios-snapshot-test-case" */, ); productRefGroup = 76FFF52326D5A9C60072E261 /* Products */; projectDirPath = ""; @@ -473,21 +482,9 @@ }; /* End XCConfigurationList section */ -/* Begin XCRemoteSwiftPackageReference section */ - 76F8D71A26D5B0F300813F9B /* XCRemoteSwiftPackageReference "ios-snapshot-test-case" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/uber/ios-snapshot-test-case"; - requirement = { - branch = main; - kind = branch; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - /* Begin XCSwiftPackageProductDependency section */ - 76F8D71B26D5B0F300813F9B /* FBSnapshotTestCase */ = { + E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */ = { isa = XCSwiftPackageProductDependency; - package = 76F8D71A26D5B0F300813F9B /* XCRemoteSwiftPackageReference "ios-snapshot-test-case" */; productName = FBSnapshotTestCase; }; /* End XCSwiftPackageProductDependency section */ diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 5f5bab6..0000000 --- a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "FBSnapshotTestCase", - "repositoryURL": "https://github.com/uber/ios-snapshot-test-case", - "state": { - "branch": "main", - "revision": "07c37dc09914c305a72b1412afa6cffb67483626", - "version": null - } - } - ] - }, - "version": 1 -} From 85b185b730c97dd06f37a56b45d1669c81783a53 Mon Sep 17 00:00:00 2001 From: Paul van Klaveren Date: Tue, 31 Aug 2021 00:55:45 +0200 Subject: [PATCH 19/40] =?UTF-8?q?Fixed=20typo=20in=20documentation=20of=20?= =?UTF-8?q?`FBSnapshotTestCase`:=20"that"=20=E2=86=92=20"than"=20(#144)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I assume the author meant to write: > "… it's often easier to … compare an image … to a reference image … _than_ write lots of complex layout-code tests." --- FBSnapshotTestCase/Public/FBSnapshotTestCase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FBSnapshotTestCase/Public/FBSnapshotTestCase.h b/FBSnapshotTestCase/Public/FBSnapshotTestCase.h index e0821fa..13c26d2 100644 --- a/FBSnapshotTestCase/Public/FBSnapshotTestCase.h +++ b/FBSnapshotTestCase/Public/FBSnapshotTestCase.h @@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN /** The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test - and compare an image of the view to a reference image that write lots of complex layout-code tests. + and compare an image of the view to a reference image than write lots of complex layout-code tests. In order to flip the tests in your subclass to record the reference images set @c recordMode to @c YES. From 6ff475b1097eeb0f79e4c304c7df604ec82924cd Mon Sep 17 00:00:00 2001 From: Maxwell Elliott <56700854+tinder-maxwellelliott@users.noreply.github.com> Date: Wed, 1 Sep 2021 11:53:51 -0700 Subject: [PATCH 20/40] Adds Bazel Support V2 (#155) * Adds Bazel Support V2 Also updates CI to run Bazel tests * get test output * setup python for xctestrunner * go to python 2 * python 3.7 --- .bazelrc | 1 + .github/workflows/main.yml | 9 +++++ .gitignore | 1 + BUILD.bazel | 28 +++++++++++++++ .../FBSnapshotTestCasePlatform.m | 2 +- FBSnapshotTestCase/FBSnapshotTestController.m | 4 +-- FBSnapshotTestCaseTests/BUILD.bazel | 26 ++++++++++++++ .../FBSnapshotControllerTests.m | 28 +++++++++++---- WORKSPACE | 35 +++++++++++++++++++ build.sh | 5 +++ 10 files changed, 129 insertions(+), 10 deletions(-) create mode 100644 .bazelrc create mode 100644 BUILD.bazel create mode 100644 FBSnapshotTestCaseTests/BUILD.bazel create mode 100644 WORKSPACE diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000..594ae2c --- /dev/null +++ b/.bazelrc @@ -0,0 +1 @@ +build --apple_platform_type=ios diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d66caa..647e786 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,15 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + # Setup python for Bazel test runner + - uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install biplist + # Runs a single command using the runners shell - name: Run a one-line script run: ./build.sh diff --git a/.gitignore b/.gitignore index 18e7cc4..88699b0 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ Pods FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FailedSnapshotImages iOSSnapshotTestCaseCarthageDemo/Carthage/Checkouts iOSSnapshotTestCaseCarthageDemo/Carthage/Build +bazel-* diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 0000000..f03abed --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,28 @@ +load( + "@build_bazel_rules_swift//swift:swift.bzl", + "swift_library", +) + +objc_library( + name = "FBSnapshotTestCaseCore", + module_name = "FBSnapshotTestCaseCore", + srcs = glob(["FBSnapshotTestCase/*.m", "FBSnapshotTestCase/Categories/*.h", "FBSnapshotTestCase/Categories/*.m"], allow_empty = False), + hdrs = glob(["FBSnapshotTestCase/Public/*.h"], allow_empty = False), + defines = [ + "SWIFT_PACKAGE" + ], + copts = [ + "-Wno-deprecated-declarations" + ], + visibility = ["//visibility:public"] +) + +swift_library( + name = "FBSnapshotTestCase", + module_name = "FBSnapshotTestCase", + srcs = ["FBSnapshotTestCase/Support/SwiftSupport.swift"], + deps = [ + ":FBSnapshotTestCaseCore" + ], + visibility = ["//visibility:public"] +) diff --git a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m b/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m index b1a7be0..09bace2 100644 --- a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m +++ b/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m @@ -8,7 +8,7 @@ */ #import -#import "FBSnapshotTestCasePlatform.h" +#import "Public/FBSnapshotTestCasePlatform.h" BOOL FBSnapshotTestCaseIs64Bit(void) { diff --git a/FBSnapshotTestCase/FBSnapshotTestController.m b/FBSnapshotTestCase/FBSnapshotTestController.m index b522dae..1c518c5 100644 --- a/FBSnapshotTestCase/FBSnapshotTestController.m +++ b/FBSnapshotTestCase/FBSnapshotTestController.m @@ -10,8 +10,8 @@ #import #import -#import "FBSnapshotTestCasePlatform.h" -#import "FBSnapshotTestController.h" +#import "Public/FBSnapshotTestCasePlatform.h" +#import "Public/FBSnapshotTestController.h" #import "Categories/UIImage+Compare.h" #import "Categories/UIImage+Diff.h" #import "Categories/UIImage+Snapshot.h" diff --git a/FBSnapshotTestCaseTests/BUILD.bazel b/FBSnapshotTestCaseTests/BUILD.bazel new file mode 100644 index 0000000..6003bfc --- /dev/null +++ b/FBSnapshotTestCaseTests/BUILD.bazel @@ -0,0 +1,26 @@ +load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") + +objc_library( + name = "FBSnapshotTestCaseTestsLib", + enable_modules = True, + srcs = ["FBSnapshotControllerTests.m"], + deps = [ + "//:FBSnapshotTestCaseCore" + ], + defines = [ + "BAZEL" + ], + data = glob(["*.png"], allow_empty = False), + sdk_frameworks = [ + "CoreGraphics", + "QuartzCore" + ] +) + +ios_unit_test( + name = "FBSnapshotTestCaseTests", + deps = [ + ":FBSnapshotTestCaseTestsLib" + ], + minimum_os_version = "10.0", +) diff --git a/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m b/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m index 0c0fc78..3f6aac9 100644 --- a/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m +++ b/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m @@ -8,7 +8,14 @@ */ #import +#if BAZEL +@import FBSnapshotTestCaseCore; +@import UIKit; +@import CoreGraphics; +@import QuartzCore; +#else #import "FBSnapshotTestCase.h" +#endif @interface FBSnapshotControllerTests : XCTestCase @@ -100,14 +107,14 @@ - (void)testFailedImageWithFileNameOptionShouldHaveEachOptionInName XCTAssertNotNil(referenceImage); UIImage *testImage = [self _bundledImageNamed:@"square_with_pixel" type:@"png"]; XCTAssertNotNil(testImage); - + NSUInteger FBSnapshotTestCaseFileNameIncludeOptionMaxOffset = 4; for (NSUInteger i = 0; i <= FBSnapshotTestCaseFileNameIncludeOptionMaxOffset; i++) { FBSnapshotTestCaseFileNameIncludeOption options = 1 << i; id testClass = nil; FBSnapshotTestController *controller = [[FBSnapshotTestController alloc] initWithTestClass:testClass]; [controller setFileNameOptions:options]; - + NSString *referenceImagesDirectory = @"/dev/null/"; [controller setReferenceImagesDirectory:referenceImagesDirectory]; NSError *error = nil; @@ -117,7 +124,7 @@ - (void)testFailedImageWithFileNameOptionShouldHaveEachOptionInName NSString *deviceIncludedReferencePath = FBFileNameIncludeNormalizedFileNameFromOption(NSStringFromSelector(selector), options); NSString *filePath = (NSString *)[error.userInfo objectForKey:FBReferenceImageFilePathKey]; XCTAssertTrue([filePath containsString:deviceIncludedReferencePath]); - + NSString *expectedFilePath = [NSString stringWithFormat:@"%@%@.png", referenceImagesDirectory, deviceIncludedReferencePath]; XCTAssertEqualObjects(expectedFilePath, filePath); } @@ -129,13 +136,13 @@ - (void)testFailedImageWithFileNameOptionShouldHaveAllOptionsInName XCTAssertNotNil(referenceImage); UIImage *testImage = [self _bundledImageNamed:@"square_with_pixel" type:@"png"]; XCTAssertNotNil(testImage); - + FBSnapshotTestCaseFileNameIncludeOption options = (FBSnapshotTestCaseFileNameIncludeOptionDevice | FBSnapshotTestCaseFileNameIncludeOptionOS | FBSnapshotTestCaseFileNameIncludeOptionScreenSize | FBSnapshotTestCaseFileNameIncludeOptionScreenScale); - + id testClass = nil; FBSnapshotTestController *controller = [[FBSnapshotTestController alloc] initWithTestClass:testClass]; [controller setFileNameOptions:options]; - + NSString *referenceImagesDirectory = @"/dev/null/"; [controller setReferenceImagesDirectory:referenceImagesDirectory]; NSError *error = nil; @@ -145,7 +152,7 @@ - (void)testFailedImageWithFileNameOptionShouldHaveAllOptionsInName NSString *allOptionsIncludedReferencePath = FBFileNameIncludeNormalizedFileNameFromOption(NSStringFromSelector(selector), options); NSString *filePath = (NSString *)[error.userInfo objectForKey:FBReferenceImageFilePathKey]; XCTAssertTrue([filePath containsString:allOptionsIncludedReferencePath]); - + // Manually constructing expected filePath to make sure it looks correct NSString *expectedFilePath = [NSString stringWithFormat:@"%@%@_%@_%@_%.0fx%.0f@%.fx.png", referenceImagesDirectory, @@ -193,10 +200,17 @@ - (void)testCompareReferenceImageWithLowPixelToleranceShouldMatch - (UIImage *)_bundledImageNamed:(NSString *)name type:(NSString *)type { + #if BAZEL + NSBundle *bundle = [NSBundle bundleForClass:[FBSnapshotControllerTests class]]; + NSString *path = [bundle pathForResource:name ofType:type]; + NSData *data = [[NSData alloc] initWithContentsOfFile:path]; + return [[UIImage alloc] initWithData:data]; + #else NSURL *url = [[NSURL fileURLWithPath: @__FILE__] URLByDeletingLastPathComponent]; NSString *path = [[url URLByAppendingPathComponent: [NSString stringWithFormat:@"%@.%@", name, type]] path]; NSData *data = [[NSData alloc] initWithContentsOfFile:path]; return [[UIImage alloc] initWithData:data]; + #endif } @end diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000..771627d --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,35 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "build_bazel_rules_apple", + sha256 = "0052d452af7742c8f3a4e0929763388a66403de363775db7e90adecb2ba4944b", + url = "https://github.com/bazelbuild/rules_apple/releases/download/0.31.3/rules_apple.0.31.3.tar.gz", +) + +load( + "@build_bazel_rules_apple//apple:repositories.bzl", + "apple_rules_dependencies", +) + +apple_rules_dependencies() + +load( + "@build_bazel_rules_swift//swift:repositories.bzl", + "swift_rules_dependencies", +) + +swift_rules_dependencies() + +load( + "@build_bazel_rules_swift//swift:extras.bzl", + "swift_rules_extra_dependencies", +) + +swift_rules_extra_dependencies() + +load( + "@build_bazel_apple_support//lib:repositories.bzl", + "apple_support_dependencies", +) + +apple_support_dependencies() diff --git a/build.sh b/build.sh index ba173b5..5784a9f 100755 --- a/build.sh +++ b/build.sh @@ -75,9 +75,14 @@ function ci_swiftpm_demo() { popd } +function test_bazel() { + bazelisk test //FBSnapshotTestCaseTests:FBSnapshotTestCaseTests --test_output=all +} + ci_lib "iPhone 8" && ci_demo "iPhone 8" && ci_demo_preprocessor "iPhone 8" ci_lib "iPhone 11" && ci_demo "iPhone 11" && ci_demo_preprocessor "iPhone 11" ci_carthage_demo "iPhone 8" ci_carthage_demo "iPhone 11" ci_swiftpm_demo "iPhone 8" ci_swiftpm_demo "iPhone 11" +test_bazel From 58e341a4d9b0c020eb3c75b54a13cd344eed2fca Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Wed, 1 Sep 2021 15:39:25 -0700 Subject: [PATCH 21/40] Use xcbeautify (#158) --- .github/workflows/main.yml | 5 +++++ build.sh | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 647e786..525b8e0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,11 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + - name: Install xcbeautify + uses: Cyberbeni/install-swift-tool@v2 + with: + url: https://github.com/thii/xcbeautify + # Setup python for Bazel test runner - uses: actions/setup-python@v2 with: diff --git a/build.sh b/build.sh index 5784a9f..7109eb9 100755 --- a/build.sh +++ b/build.sh @@ -8,12 +8,12 @@ function ci_lib() { -scheme "FBSnapshotTestCase iOS" \ -destination "platform=iOS Simulator,name=${NAME}" \ -sdk iphonesimulator \ - build-for-testing + build-for-testing | xcbeautify xcodebuild -project FBSnapshotTestCase.xcodeproj \ -scheme "FBSnapshotTestCase iOS" \ -destination "platform=iOS Simulator,name=${NAME}" \ -sdk iphonesimulator \ - test-without-building + test-without-building | xcbeautify } function ci_demo() { @@ -23,11 +23,11 @@ function ci_demo() { xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \ -scheme FBSnapshotTestCaseDemo \ -destination "platform=iOS Simulator,name=${NAME}" \ - build-for-testing + build-for-testing | xcbeautify xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \ -scheme FBSnapshotTestCaseDemo \ -destination "platform=iOS Simulator,name=${NAME}" \ - test-without-building + test-without-building | xcbeautify popd } @@ -38,11 +38,11 @@ function ci_demo_preprocessor() { xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \ -scheme FBSnapshotTestCasePreprocessorDemo \ -destination "platform=iOS Simulator,name=${NAME}" \ - build-for-testing + build-for-testing | xcbeautify xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \ -scheme FBSnapshotTestCasePreprocessorDemo \ -destination "platform=iOS Simulator,name=${NAME}" \ - test-without-building + test-without-building | xcbeautify popd } @@ -53,11 +53,11 @@ function ci_carthage_demo() { xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \ -scheme iOSSnapshotTestCaseCarthageDemo \ -destination "platform=iOS Simulator,name=${NAME}" \ - build-for-testing + build-for-testing | xcbeautify xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \ -scheme iOSSnapshotTestCaseCarthageDemo \ -destination "platform=iOS Simulator,name=${NAME}" \ - test-without-building + test-without-building | xcbeautify popd } @@ -67,11 +67,11 @@ function ci_swiftpm_demo() { xcodebuild -project iOSSnapshotTestCaseSwiftPMDemo.xcodeproj \ -scheme "iOSSnapshotTestCaseSwiftPMDemo (iOS)" \ -destination "platform=iOS Simulator,name=${NAME}" \ - build-for-testing + build-for-testing | xcbeautify xcodebuild -project iOSSnapshotTestCaseSwiftPMDemo.xcodeproj \ -scheme "iOSSnapshotTestCaseSwiftPMDemo (iOS)" \ -destination "platform=iOS Simulator,name=${NAME}" \ - test-without-building + test-without-building | xcbeautify popd } From ee61aa232e81ef941bfa2d8ed3e93fbbf7ffbaf7 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Fri, 3 Sep 2021 12:44:31 -0700 Subject: [PATCH 22/40] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 86c5203..749f172 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # iOSSnapshotTestCase (previously [FBSnapshotTestCase](https://github.com/facebookarchive/ios-snapshot-test-case)) -[![Build Status](https://travis-ci.org/uber/ios-snapshot-test-case.svg)](https://travis-ci.org/uber/ios-snapshot-test-case) +[![Build Status](https://github.com/uber/ios-snapshot-test-case/workflows/build/badge.svg?branch=main)](https://github.com/uber/ios-snapshot-test-case/actions) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/iOSSnapshotTestCase.svg)](https://img.shields.io/cocoapods/v/iOSSnapshotTestCase.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square) ## What it does From 981500cb9dfcb5a1ea66ef52252da77717b49281 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Fri, 3 Sep 2021 12:46:17 -0700 Subject: [PATCH 23/40] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 749f172..449217f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # iOSSnapshotTestCase (previously [FBSnapshotTestCase](https://github.com/facebookarchive/ios-snapshot-test-case)) -[![Build Status](https://github.com/uber/ios-snapshot-test-case/workflows/build/badge.svg?branch=main)](https://github.com/uber/ios-snapshot-test-case/actions) +[![Build Status](https://github.com/uber/ios-snapshot-test-case/workflows/main/badge.svg?branch=main)](https://github.com/uber/ios-snapshot-test-case/actions) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/iOSSnapshotTestCase.svg)](https://img.shields.io/cocoapods/v/iOSSnapshotTestCase.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square) From 63899a54b9a707c5ae73088e60794ea399432ce6 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Fri, 3 Sep 2021 12:48:18 -0700 Subject: [PATCH 24/40] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 449217f..ace11ed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # iOSSnapshotTestCase (previously [FBSnapshotTestCase](https://github.com/facebookarchive/ios-snapshot-test-case)) -[![Build Status](https://github.com/uber/ios-snapshot-test-case/workflows/main/badge.svg?branch=main)](https://github.com/uber/ios-snapshot-test-case/actions) +[![Build Status](https://github.com/uber/ios-snapshot-test-case/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/uber/ios-snapshot-test-case/actions) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/iOSSnapshotTestCase.svg)](https://img.shields.io/cocoapods/v/iOSSnapshotTestCase.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square) From f3140d1d4d650dc5bd14ce6ced4cf386594998fa Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Mon, 13 Sep 2021 13:31:46 -0700 Subject: [PATCH 25/40] Lower Swift version requirement to 5.3 (#162) --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 688bd6b..ae26475 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.4 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription From bce75201ea3b6d4c124d9637686d8cacb1e42fe5 Mon Sep 17 00:00:00 2001 From: Mark DiFranco Date: Thu, 21 Oct 2021 17:21:17 -0400 Subject: [PATCH 26/40] Fix spelling mistake 'Test Hist' (#166) --- docs/LibraryVsApplicationTestBundles.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/LibraryVsApplicationTestBundles.md b/docs/LibraryVsApplicationTestBundles.md index 884119f..bd990d7 100644 --- a/docs/LibraryVsApplicationTestBundles.md +++ b/docs/LibraryVsApplicationTestBundles.md @@ -22,7 +22,7 @@ Unit tests that test parts of a framework or library should be part of a Library * No need to install anything, which makes running your tests faster and reduces the likelihood of Simulator instability * The Test Host application will start an application lifecycle, which is state that can cause instability in your tests -* Only one host application can run at the same time in a Simulator, so tests with a Test Host cannot parallelize on one simulator. The `xctest` stub process spawned without a Test Hist isn’t a full iOS application, so multiple can run in parallel sharing a single simulator. +* Only one host application can run at the same time in a Simulator, so tests with a Test Host cannot parallelize on one simulator. The `xctest` stub process spawned without a Test Host isn’t a full iOS application, so multiple can run in parallel sharing a single simulator. If you are using [Buck](https://buckbuild.com/), removing the `test_host_app` option for `apple_test()` rules will allow Buck and `xctool` to run your test bundles in parallel. @@ -96,4 +96,4 @@ static NSUInteger const UIControlEventsMaxOffset = 19; @end -``` \ No newline at end of file +``` From b258c505754dbf27242990e95a5caf42034ad520 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Thu, 21 Oct 2021 16:06:33 -0700 Subject: [PATCH 27/40] Xcode 13 support (#150) --- FBSnapshotTestCase.xcodeproj/project.pbxproj | 26 +++++++++++++++++-- .../Categories/UIApplication+KeyWindow.h | 20 ++++++++++++++ .../Categories/UIApplication+KeyWindow.m | 26 +++++++++++++++++++ .../Categories/UIImage+Snapshot.m | 4 ++- FBSnapshotTestCaseDemo/Podfile.lock | 4 +-- iOSSnapshotTestCase.podspec | 2 +- 6 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h create mode 100644 FBSnapshotTestCase/Categories/UIApplication+KeyWindow.m diff --git a/FBSnapshotTestCase.xcodeproj/project.pbxproj b/FBSnapshotTestCase.xcodeproj/project.pbxproj index 642ad72..fa0f77a 100644 --- a/FBSnapshotTestCase.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCase.xcodeproj/project.pbxproj @@ -48,6 +48,10 @@ B76C68291C6BD6D200586E5B /* rect.png in Resources */ = {isa = PBXBuildFile; fileRef = B76C68271C6BD68100586E5B /* rect.png */; }; B76C682A1C6BD6D500586E5B /* rect.png in Resources */ = {isa = PBXBuildFile; fileRef = B76C68271C6BD68100586E5B /* rect.png */; }; E5C2CD621B1F399A00669887 /* square_with_pixel.png in Resources */ = {isa = PBXBuildFile; fileRef = E5C2CD611B1F399A00669887 /* square_with_pixel.png */; }; + E73EAEE326D49B9000590C3D /* UIApplication+KeyWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E73EAEE126D49B9000590C3D /* UIApplication+KeyWindow.h */; }; + E73EAEE426D49B9000590C3D /* UIApplication+KeyWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E73EAEE126D49B9000590C3D /* UIApplication+KeyWindow.h */; }; + E73EAEE526D49B9000590C3D /* UIApplication+KeyWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E73EAEE226D49B9000590C3D /* UIApplication+KeyWindow.m */; }; + E73EAEE626D49B9000590C3D /* UIApplication+KeyWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E73EAEE226D49B9000590C3D /* UIApplication+KeyWindow.m */; }; F0D698F51B204E120005CAC9 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0D698F41B204E120005CAC9 /* SwiftSupport.swift */; }; /* End PBXBuildFile section */ @@ -94,6 +98,8 @@ B32447DB1AB78B5E00B1D6FF /* square.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square.png; sourceTree = ""; }; B76C68271C6BD68100586E5B /* rect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rect.png; sourceTree = ""; }; E5C2CD611B1F399A00669887 /* square_with_pixel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square_with_pixel.png; sourceTree = ""; }; + E73EAEE126D49B9000590C3D /* UIApplication+KeyWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIApplication+KeyWindow.h"; sourceTree = ""; }; + E73EAEE226D49B9000590C3D /* UIApplication+KeyWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIApplication+KeyWindow.m"; sourceTree = ""; }; F0D698F41B204E120005CAC9 /* SwiftSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = Support/SwiftSupport.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -140,6 +146,8 @@ 133564131B59C3F500A4E4BF /* UIImage+Diff.m */, 133564141B59C3F500A4E4BF /* UIImage+Snapshot.h */, 133564151B59C3F500A4E4BF /* UIImage+Snapshot.m */, + E73EAEE126D49B9000590C3D /* UIApplication+KeyWindow.h */, + E73EAEE226D49B9000590C3D /* UIApplication+KeyWindow.m */, ); path = Categories; sourceTree = ""; @@ -227,6 +235,7 @@ 827137991C63ABF900354E42 /* FBSnapshotTestCase.h in Headers */, 8271379B1C63ABF900354E42 /* FBSnapshotTestController.h in Headers */, 827137931C63ABF000354E42 /* UIImage+Snapshot.h in Headers */, + E73EAEE426D49B9000590C3D /* UIApplication+KeyWindow.h in Headers */, 827137921C63ABF000354E42 /* UIImage+Diff.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -240,6 +249,7 @@ B319882A1AB7849400B0A900 /* FBSnapshotTestController.h in Headers */, 133564181B59C3F500A4E4BF /* UIImage+Diff.h in Headers */, 133564161B59C3F500A4E4BF /* UIImage+Compare.h in Headers */, + E73EAEE326D49B9000590C3D /* UIApplication+KeyWindow.h in Headers */, 1335641A1B59C3F500A4E4BF /* UIImage+Snapshot.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -417,6 +427,7 @@ files = ( 827137961C63ABF400354E42 /* UIImage+Diff.m in Sources */, 8271379E1C63ABFD00354E42 /* FBSnapshotTestController.m in Sources */, + E73EAEE626D49B9000590C3D /* UIApplication+KeyWindow.m in Sources */, 8271379D1C63ABFD00354E42 /* FBSnapshotTestCasePlatform.m in Sources */, 8271379C1C63ABFD00354E42 /* FBSnapshotTestCase.m in Sources */, 827137951C63ABF400354E42 /* UIImage+Compare.m in Sources */, @@ -439,6 +450,7 @@ files = ( 133564171B59C3F500A4E4BF /* UIImage+Compare.m in Sources */, B31988291AB7849400B0A900 /* FBSnapshotTestCase.m in Sources */, + E73EAEE526D49B9000590C3D /* UIApplication+KeyWindow.m in Sources */, 133564191B59C3F500A4E4BF /* UIImage+Diff.m in Sources */, 1335641B1B59C3F500A4E4BF /* UIImage+Snapshot.m in Sources */, B319882B1AB7849400B0A900 /* FBSnapshotTestController.m in Sources */, @@ -618,14 +630,19 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ""; SDKROOT = iphoneos; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Werror", + ); }; name = Debug; }; @@ -671,8 +688,9 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CFLAGS = ""; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; @@ -680,6 +698,10 @@ VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Werror", + ); }; name = Release; }; diff --git a/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h b/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h new file mode 100644 index 0000000..0a2788c --- /dev/null +++ b/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018, Uber Technologies, Inc. + * Copyright (c) 2015-2018, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIApplication (KeyWindow) + +- (nullable UIWindow *)ub_keyWindow; + +@end + +NS_ASSUME_NONNULL_END diff --git a/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.m b/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.m new file mode 100644 index 0000000..ff7ac44 --- /dev/null +++ b/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.m @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017-2018, Uber Technologies, Inc. + * Copyright (c) 2015-2018, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +#if SWIFT_PACKAGE +#import "UIApplication+KeyWindow.h" +#else +#import +#endif + +@implementation UIApplication (KeyWindow) + +- (nullable UIWindow *)ub_keyWindow +{ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + return UIApplication.sharedApplication.keyWindow; +#pragma GCC diagnostic pop +} + +@end diff --git a/FBSnapshotTestCase/Categories/UIImage+Snapshot.m b/FBSnapshotTestCase/Categories/UIImage+Snapshot.m index bd81f47..80c9aca 100644 --- a/FBSnapshotTestCase/Categories/UIImage+Snapshot.m +++ b/FBSnapshotTestCase/Categories/UIImage+Snapshot.m @@ -9,8 +9,10 @@ #if SWIFT_PACKAGE #import "UIImage+Snapshot.h" +#import "UIApplication+KeyWindow.h" #else #import +#import #endif @implementation UIImage (Snapshot) @@ -46,7 +48,7 @@ + (UIImage *)fb_imageForView:(UIView *)view UIWindow *window = [view isKindOfClass:[UIWindow class]] ? (UIWindow *)view : view.window; BOOL removeFromSuperview = NO; if (!window) { - window = [[UIApplication sharedApplication] keyWindow]; + window = [[UIApplication sharedApplication] ub_keyWindow]; } if (!view.window && view != window) { diff --git a/FBSnapshotTestCaseDemo/Podfile.lock b/FBSnapshotTestCaseDemo/Podfile.lock index 4d68011..e53e9eb 100644 --- a/FBSnapshotTestCaseDemo/Podfile.lock +++ b/FBSnapshotTestCaseDemo/Podfile.lock @@ -13,8 +13,8 @@ EXTERNAL SOURCES: :path: ".." SPEC CHECKSUMS: - iOSSnapshotTestCase: 63402a5707db9c4103b6cc3f04c76e981fff7952 + iOSSnapshotTestCase: fea60fd99da3b57d7bcd5a20531755c82b76359e PODFILE CHECKSUM: fbb7d596ed79771148d8ba7593d4cf7f99855e88 -COCOAPODS: 1.10.2 +COCOAPODS: 1.11.2 diff --git a/iOSSnapshotTestCase.podspec b/iOSSnapshotTestCase.podspec index d4a5648..812dea3 100644 --- a/iOSSnapshotTestCase.podspec +++ b/iOSSnapshotTestCase.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.subspec 'Core' do |cs| cs.source_files = 'FBSnapshotTestCase/**/*.{h,m}', 'FBSnapshotTestCase/*.{h,m}' cs.public_header_files = 'FBSnapshotTestCase/Public/FBSnapshotTestCase.h','FBSnapshotTestCase/Public/FBSnapshotTestCasePlatform.h','FBSnapshotTestCase/Public/FBSnapshotTestController.h' - cs.private_header_files = 'FBSnapshotTestCase/Categories/UIImage+Compare.h','FBSnapshotTestCase/Categories/UIImage+Diff.h','FBSnapshotTestCase/Categories/UIImage+Snapshot.h' + cs.private_header_files = 'FBSnapshotTestCase/Categories/UIImage+Compare.h','FBSnapshotTestCase/Categories/UIImage+Diff.h','FBSnapshotTestCase/Categories/UIImage+Snapshot.h','FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h' end s.subspec 'SwiftSupport' do |cs| cs.dependency 'iOSSnapshotTestCase/Core' From 5853c774151df33bc5991abb5c56c99357e1a6fd Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Thu, 21 Oct 2021 18:52:35 -0700 Subject: [PATCH 28/40] Fix all the paths for spm (#167) * Fix paths in project * remove random folder from iOSSnapshotTestCaseSwiftPMDemo * Fix build.sh * Use bundle instead of file path hackery * Bazel png path --- BUILD.bazel | 16 ++-- FBSnapshotTestCase.xcodeproj/project.pbxproj | 80 ++++-------------- .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 Package.swift | 36 ++++---- build.sh | 10 +-- .../project.pbxproj | 0 .../contents.xcworkspacedata | 0 .../xcschemes/FBSnapshotTestCaseDemo.xcscheme | 0 ...BSnapshotTestCasePreprocessorDemo.xcscheme | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/WorkspaceSettings.xcsettings | 0 .../FBSnapshotTestCaseDemo/FBAppDelegate.h | 0 .../FBSnapshotTestCaseDemo/FBAppDelegate.m | 0 .../FBSnapshotTestCaseDemo-Info.plist | 0 .../FBSnapshotTestCaseDemo-Prefix.pch | 0 .../AppIcon.appiconset/Contents.json | 0 .../Images.xcassets/Contents.json | 0 .../Launch Screen.storyboard | 0 .../en.lproj/InfoPlist.strings | 0 .../FBSnapshotTestCaseDemo/main.m | 0 .../FBSnapshotTestCaseDemoTests-Info.plist | 0 .../FBSnapshotTestCaseDemoTests.m | 0 .../FBSnapshotTestCaseSwiftTests.swift | 0 .../testExample@2x.png | Bin .../testViewSnapshot@2x.png | Bin ...erentBackgroundColorPerArchitecture@2x.png | Bin .../testViewSnapshotWithUIAppearance@2x.png | Bin ...iewSnapshotWithUIAppearanceResizing@2x.png | Bin .../testViewSnapshotWithVisualEffects@2x.png | Bin .../testExample@2x.png | Bin .../testExample@3x.png | Bin .../testViewSnapshot@2x.png | Bin .../testViewSnapshot@3x.png | Bin ...erentBackgroundColorPerArchitecture@2x.png | Bin ...erentBackgroundColorPerArchitecture@3x.png | Bin .../testViewSnapshotWithUIAppearance@2x.png | Bin .../testViewSnapshotWithUIAppearance@3x.png | Bin ...iewSnapshotWithUIAppearanceResizing@2x.png | Bin ...iewSnapshotWithUIAppearanceResizing@3x.png | Bin .../testViewSnapshotWithVisualEffects@2x.png | Bin .../testViewSnapshotWithVisualEffects@3x.png | Bin .../en.lproj/InfoPlist.strings | 0 .../FBSnapshotTestCaseDemo}/Podfile | 4 +- .../FBSnapshotTestCaseDemo}/Podfile.lock | 8 +- .../Scheme_FB_REFERENCE_IMAGE_DIR.png | Bin .../iOSSnapshotTestCaseCarthageDemo}/Cartfile | 0 .../Cartfile.resolved | 0 .../project.pbxproj | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/WorkspaceSettings.xcsettings | 0 .../iOSSnapshotTestCaseCarthageDemo.xcscheme | 0 .../AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../Assets.xcassets/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 .../Info.plist | 0 .../Info.plist | 0 .../testExample@2x.png | Bin .../testExample@3x.png | Bin ...apshotTestCaseCarthageDemoSwiftTests.swift | 0 .../AccentColor.colorset/Contents.json | 0 .../AppIcon.appiconset/Contents.json | 0 .../Shared/Assets.xcassets/Contents.json | 0 .../Shared/ContentView.swift | 0 .../iOSSnapshotTestCaseSwiftPMDemoApp.swift | 0 .../Tests iOS/Info.plist | 0 ...napshotTestCaseSwiftPMDemoSwiftTests.swift | 2 +- .../testExample@2x.png | Bin .../iOS/Info.plist | 0 .../project.pbxproj | 26 ++++-- .../contents.xcworkspacedata | 7 ++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++ ...SnapshotTestCaseSwiftPMDemo (iOS).xcscheme | 0 iOSSnapshotTestCase.podspec | 8 +- .../iOSSnapshotTestCase}/SwiftSupport.swift | 2 +- .../Categories/UIApplication+KeyWindow.h | 0 .../Categories/UIApplication+KeyWindow.m | 0 .../Categories/UIImage+Compare.h | 0 .../Categories/UIImage+Compare.m | 0 .../Categories/UIImage+Diff.h | 0 .../Categories/UIImage+Diff.m | 0 .../Categories/UIImage+Snapshot.h | 0 .../Categories/UIImage+Snapshot.m | 0 .../FBSnapshotTestCase.m | 0 .../FBSnapshotTestCasePlatform.m | 0 .../FBSnapshotTestController.m | 0 .../Public/FBSnapshotTestCase.h | 0 .../Public/FBSnapshotTestCasePlatform.h | 0 .../Public/FBSnapshotTestController.h | 0 .../Resources}/FBSnapshotTestCase-Info.plist | 0 .../iOSSnapshotTestCaseTests}/BUILD.bazel | 10 +-- .../FBSnapshotControllerTests.m | 9 +- .../FBSnapshotTestCaseTests-Info.plist | 0 .../Resources}/rect.png | Bin .../Resources}/rect_shade.png | Bin .../Resources}/square-copy.png | Bin .../Resources}/square.png | Bin .../Resources}/square_with_pixel.png | Bin .../Resources}/square_with_text.png | Bin 102 files changed, 96 insertions(+), 130 deletions(-) rename {iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj => FBSnapshotTestCase.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) rename {FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace => FBSnapshotTestCase.xcodeproj/project.xcworkspace}/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCaseDemo.xcscheme (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCasePreprocessorDemo.xcscheme (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo.xcworkspace/contents.xcworkspacedata (100%) rename {iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace => demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace}/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/FBAppDelegate.h (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/FBAppDelegate.m (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Info.plist (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Prefix.pch (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/Images.xcassets/Contents.json (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/Launch Screen.storyboard (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/en.lproj/InfoPlist.strings (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemo/main.m (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests-Info.plist (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseSwiftTests.swift (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@3x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@3x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@3x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@3x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@3x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@3x.png (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/FBSnapshotTestCaseDemoTests/en.lproj/InfoPlist.strings (100%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/Podfile (78%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/Podfile.lock (62%) rename {FBSnapshotTestCaseDemo => demos/FBSnapshotTestCaseDemo}/Scheme_FB_REFERENCE_IMAGE_DIR.png (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/Cartfile (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/Cartfile.resolved (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename {iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj => demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemo/Info.plist (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png (100%) rename {iOSSnapshotTestCaseCarthageDemo => demos/iOSSnapshotTestCaseCarthageDemo}/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/Shared/Assets.xcassets/AccentColor.colorset/Contents.json (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/Shared/Assets.xcassets/Contents.json (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/Shared/ContentView.swift (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/Tests iOS/Info.plist (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift (95%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/iOS/Info.plist (100%) rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj (94%) create mode 100644 demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename {iOSSnapshotTestCaseSwiftPMDemo => demos/iOSSnapshotTestCaseSwiftPMDemo}/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme (100%) rename {FBSnapshotTestCase/Support => src/iOSSnapshotTestCase}/SwiftSupport.swift (98%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIApplication+KeyWindow.h (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIApplication+KeyWindow.m (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIImage+Compare.h (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIImage+Compare.m (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIImage+Diff.h (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIImage+Diff.m (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIImage+Snapshot.h (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Categories/UIImage+Snapshot.m (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/FBSnapshotTestCase.m (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/FBSnapshotTestCasePlatform.m (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/FBSnapshotTestController.m (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Public/FBSnapshotTestCase.h (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Public/FBSnapshotTestCasePlatform.h (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore}/Public/FBSnapshotTestController.h (100%) rename {FBSnapshotTestCase => src/iOSSnapshotTestCaseCore/Resources}/FBSnapshotTestCase-Info.plist (100%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests}/BUILD.bazel (62%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests}/FBSnapshotControllerTests.m (96%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests/Resources}/FBSnapshotTestCaseTests-Info.plist (100%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests/Resources}/rect.png (100%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests/Resources}/rect_shade.png (100%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests/Resources}/square-copy.png (100%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests/Resources}/square.png (100%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests/Resources}/square_with_pixel.png (100%) rename {FBSnapshotTestCaseTests => src/iOSSnapshotTestCaseTests/Resources}/square_with_text.png (100%) diff --git a/BUILD.bazel b/BUILD.bazel index f03abed..7ceaf81 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -4,10 +4,10 @@ load( ) objc_library( - name = "FBSnapshotTestCaseCore", - module_name = "FBSnapshotTestCaseCore", - srcs = glob(["FBSnapshotTestCase/*.m", "FBSnapshotTestCase/Categories/*.h", "FBSnapshotTestCase/Categories/*.m"], allow_empty = False), - hdrs = glob(["FBSnapshotTestCase/Public/*.h"], allow_empty = False), + name = "iOSSnapshotTestCaseCore", + module_name = "iOSSnapshotTestCaseCore", + srcs = glob(["src/iOSSnapshotTestCaseCore/*.m", "src/iOSSnapshotTestCaseCore/Categories/*.h", "src/iOSSnapshotTestCaseCore/Categories/*.m"], allow_empty = False), + hdrs = glob(["src/iOSSnapshotTestCaseCore/Public/*.h"], allow_empty = False), defines = [ "SWIFT_PACKAGE" ], @@ -18,11 +18,11 @@ objc_library( ) swift_library( - name = "FBSnapshotTestCase", - module_name = "FBSnapshotTestCase", - srcs = ["FBSnapshotTestCase/Support/SwiftSupport.swift"], + name = "iOSSnapshotTestCase", + module_name = "iOSSnapshotTestCase", + srcs = ["src/iOSSnapshotTestCaseCore/SwiftSupport.swift"], deps = [ - ":FBSnapshotTestCaseCore" + ":iOSSnapshotTestCaseCore" ], visibility = ["//visibility:public"] ) diff --git a/FBSnapshotTestCase.xcodeproj/project.pbxproj b/FBSnapshotTestCase.xcodeproj/project.pbxproj index fa0f77a..b39dd50 100644 --- a/FBSnapshotTestCase.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCase.xcodeproj/project.pbxproj @@ -15,8 +15,8 @@ 1335641B1B59C3F500A4E4BF /* UIImage+Snapshot.m in Sources */ = {isa = PBXBuildFile; fileRef = 133564151B59C3F500A4E4BF /* UIImage+Snapshot.m */; }; 13CBB39D1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 13CBB39B1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13CBB39E1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */; }; - 42F2B74420C0D7A400ABED24 /* rect_shade.png in Resources */ = {isa = PBXBuildFile; fileRef = 42F2B74320C0D7A400ABED24 /* rect_shade.png */; }; - 42F2B74520C0D7A400ABED24 /* rect_shade.png in Resources */ = {isa = PBXBuildFile; fileRef = 42F2B74320C0D7A400ABED24 /* rect_shade.png */; }; + 7623EA18272234D5006BF966 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 7623EA17272234D5006BF966 /* Resources */; }; + 7623EA19272234D5006BF966 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 7623EA17272234D5006BF966 /* Resources */; }; 827137841C63AB7000354E42 /* FBSnapshotTestCase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8271377A1C63AB6F00354E42 /* FBSnapshotTestCase.framework */; }; 827137911C63ABE900354E42 /* UIImage+Compare.h in Headers */ = {isa = PBXBuildFile; fileRef = 133564101B59C3F500A4E4BF /* UIImage+Compare.h */; }; 827137921C63ABF000354E42 /* UIImage+Diff.h in Headers */ = {isa = PBXBuildFile; fileRef = 133564121B59C3F500A4E4BF /* UIImage+Diff.h */; }; @@ -30,11 +30,6 @@ 8271379C1C63ABFD00354E42 /* FBSnapshotTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = B31988211AB7849400B0A900 /* FBSnapshotTestCase.m */; }; 8271379D1C63ABFD00354E42 /* FBSnapshotTestCasePlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */; }; 8271379E1C63ABFD00354E42 /* FBSnapshotTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = B31988231AB7849400B0A900 /* FBSnapshotTestController.m */; }; - 8271379F1C63AC0000354E42 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0D698F41B204E120005CAC9 /* SwiftSupport.swift */; }; - 827137A01C63AC0700354E42 /* square_with_pixel.png in Resources */ = {isa = PBXBuildFile; fileRef = E5C2CD611B1F399A00669887 /* square_with_pixel.png */; }; - 827137A11C63AC0900354E42 /* square_with_text.png in Resources */ = {isa = PBXBuildFile; fileRef = B32447D91AB78B5E00B1D6FF /* square_with_text.png */; }; - 827137A21C63AC0D00354E42 /* square-copy.png in Resources */ = {isa = PBXBuildFile; fileRef = B32447DA1AB78B5E00B1D6FF /* square-copy.png */; }; - 827137A31C63AC0D00354E42 /* square.png in Resources */ = {isa = PBXBuildFile; fileRef = B32447DB1AB78B5E00B1D6FF /* square.png */; }; 827137A41C63AC0F00354E42 /* FBSnapshotControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B31988301AB784CB00B0A900 /* FBSnapshotControllerTests.m */; }; B31987FC1AB782D100B0A900 /* FBSnapshotTestCase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B31987F01AB782D000B0A900 /* FBSnapshotTestCase.framework */; }; B31988281AB7849400B0A900 /* FBSnapshotTestCase.h in Headers */ = {isa = PBXBuildFile; fileRef = B31988201AB7849400B0A900 /* FBSnapshotTestCase.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -42,17 +37,10 @@ B319882A1AB7849400B0A900 /* FBSnapshotTestController.h in Headers */ = {isa = PBXBuildFile; fileRef = B31988221AB7849400B0A900 /* FBSnapshotTestController.h */; settings = {ATTRIBUTES = (Public, ); }; }; B319882B1AB7849400B0A900 /* FBSnapshotTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = B31988231AB7849400B0A900 /* FBSnapshotTestController.m */; }; B31988311AB784CB00B0A900 /* FBSnapshotControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B31988301AB784CB00B0A900 /* FBSnapshotControllerTests.m */; }; - B32447DC1AB78B5E00B1D6FF /* square_with_text.png in Resources */ = {isa = PBXBuildFile; fileRef = B32447D91AB78B5E00B1D6FF /* square_with_text.png */; }; - B32447DD1AB78B5E00B1D6FF /* square-copy.png in Resources */ = {isa = PBXBuildFile; fileRef = B32447DA1AB78B5E00B1D6FF /* square-copy.png */; }; - B32447DE1AB78B5E00B1D6FF /* square.png in Resources */ = {isa = PBXBuildFile; fileRef = B32447DB1AB78B5E00B1D6FF /* square.png */; }; - B76C68291C6BD6D200586E5B /* rect.png in Resources */ = {isa = PBXBuildFile; fileRef = B76C68271C6BD68100586E5B /* rect.png */; }; - B76C682A1C6BD6D500586E5B /* rect.png in Resources */ = {isa = PBXBuildFile; fileRef = B76C68271C6BD68100586E5B /* rect.png */; }; - E5C2CD621B1F399A00669887 /* square_with_pixel.png in Resources */ = {isa = PBXBuildFile; fileRef = E5C2CD611B1F399A00669887 /* square_with_pixel.png */; }; E73EAEE326D49B9000590C3D /* UIApplication+KeyWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E73EAEE126D49B9000590C3D /* UIApplication+KeyWindow.h */; }; E73EAEE426D49B9000590C3D /* UIApplication+KeyWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E73EAEE126D49B9000590C3D /* UIApplication+KeyWindow.h */; }; E73EAEE526D49B9000590C3D /* UIApplication+KeyWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E73EAEE226D49B9000590C3D /* UIApplication+KeyWindow.m */; }; E73EAEE626D49B9000590C3D /* UIApplication+KeyWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E73EAEE226D49B9000590C3D /* UIApplication+KeyWindow.m */; }; - F0D698F51B204E120005CAC9 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0D698F41B204E120005CAC9 /* SwiftSupport.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -81,26 +69,19 @@ 133564151B59C3F500A4E4BF /* UIImage+Snapshot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Snapshot.m"; sourceTree = ""; }; 13CBB39B1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestCasePlatform.h; path = Public/FBSnapshotTestCasePlatform.h; sourceTree = ""; }; 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestCasePlatform.m; sourceTree = ""; }; - 42F2B74320C0D7A400ABED24 /* rect_shade.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rect_shade.png; sourceTree = ""; }; + 7623EA17272234D5006BF966 /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = ""; }; 8271377A1C63AB6F00354E42 /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBSnapshotTestCase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 827137831C63AB7000354E42 /* FBSnapshotTestCase tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "FBSnapshotTestCase tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; B31987F01AB782D000B0A900 /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBSnapshotTestCase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B31987F41AB782D000B0A900 /* FBSnapshotTestCase-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FBSnapshotTestCase-Info.plist"; sourceTree = ""; }; + B31987F41AB782D000B0A900 /* FBSnapshotTestCase-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "FBSnapshotTestCase-Info.plist"; path = "Resources/FBSnapshotTestCase-Info.plist"; sourceTree = ""; }; B31987FB1AB782D100B0A900 /* FBSnapshotTestCase iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "FBSnapshotTestCase iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - B31988011AB782D100B0A900 /* FBSnapshotTestCaseTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FBSnapshotTestCaseTests-Info.plist"; sourceTree = ""; }; B31988201AB7849400B0A900 /* FBSnapshotTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestCase.h; path = Public/FBSnapshotTestCase.h; sourceTree = ""; }; B31988211AB7849400B0A900 /* FBSnapshotTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestCase.m; sourceTree = ""; }; B31988221AB7849400B0A900 /* FBSnapshotTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestController.h; path = Public/FBSnapshotTestController.h; sourceTree = ""; }; B31988231AB7849400B0A900 /* FBSnapshotTestController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestController.m; sourceTree = ""; }; B31988301AB784CB00B0A900 /* FBSnapshotControllerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotControllerTests.m; sourceTree = ""; }; - B32447D91AB78B5E00B1D6FF /* square_with_text.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square_with_text.png; sourceTree = ""; }; - B32447DA1AB78B5E00B1D6FF /* square-copy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "square-copy.png"; sourceTree = ""; }; - B32447DB1AB78B5E00B1D6FF /* square.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square.png; sourceTree = ""; }; - B76C68271C6BD68100586E5B /* rect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rect.png; sourceTree = ""; }; - E5C2CD611B1F399A00669887 /* square_with_pixel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square_with_pixel.png; sourceTree = ""; }; E73EAEE126D49B9000590C3D /* UIApplication+KeyWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIApplication+KeyWindow.h"; sourceTree = ""; }; E73EAEE226D49B9000590C3D /* UIApplication+KeyWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIApplication+KeyWindow.m"; sourceTree = ""; }; - F0D698F41B204E120005CAC9 /* SwiftSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = Support/SwiftSupport.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -184,11 +165,10 @@ 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */, B31988221AB7849400B0A900 /* FBSnapshotTestController.h */, B31988231AB7849400B0A900 /* FBSnapshotTestController.m */, - F0D698F41B204E120005CAC9 /* SwiftSupport.swift */, B31987F31AB782D000B0A900 /* Supporting Files */, ); name = Sources; - path = FBSnapshotTestCase; + path = src/iOSSnapshotTestCaseCore; sourceTree = ""; }; B31987F31AB782D000B0A900 /* Supporting Files */ = { @@ -202,25 +182,11 @@ B31987FF1AB782D100B0A900 /* Tests */ = { isa = PBXGroup; children = ( - 42F2B74320C0D7A400ABED24 /* rect_shade.png */, - B76C68271C6BD68100586E5B /* rect.png */, - E5C2CD611B1F399A00669887 /* square_with_pixel.png */, - B32447D91AB78B5E00B1D6FF /* square_with_text.png */, - B32447DA1AB78B5E00B1D6FF /* square-copy.png */, - B32447DB1AB78B5E00B1D6FF /* square.png */, B31988301AB784CB00B0A900 /* FBSnapshotControllerTests.m */, - B31988001AB782D100B0A900 /* Supporting Files */, + 7623EA17272234D5006BF966 /* Resources */, ); name = Tests; - path = FBSnapshotTestCaseTests; - sourceTree = ""; - }; - B31988001AB782D100B0A900 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B31988011AB782D100B0A900 /* FBSnapshotTestCaseTests-Info.plist */, - ); - name = "Supporting Files"; + path = src/iOSSnapshotTestCaseTests; sourceTree = ""; }; /* End PBXGroup section */ @@ -389,12 +355,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - B76C682A1C6BD6D500586E5B /* rect.png in Resources */, - 827137A01C63AC0700354E42 /* square_with_pixel.png in Resources */, - 827137A21C63AC0D00354E42 /* square-copy.png in Resources */, - 827137A31C63AC0D00354E42 /* square.png in Resources */, - 827137A11C63AC0900354E42 /* square_with_text.png in Resources */, - 42F2B74520C0D7A400ABED24 /* rect_shade.png in Resources */, + 7623EA19272234D5006BF966 /* Resources in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -409,12 +370,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - B76C68291C6BD6D200586E5B /* rect.png in Resources */, - B32447DC1AB78B5E00B1D6FF /* square_with_text.png in Resources */, - E5C2CD621B1F399A00669887 /* square_with_pixel.png in Resources */, - B32447DE1AB78B5E00B1D6FF /* square.png in Resources */, - B32447DD1AB78B5E00B1D6FF /* square-copy.png in Resources */, - 42F2B74420C0D7A400ABED24 /* rect_shade.png in Resources */, + 7623EA18272234D5006BF966 /* Resources in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -432,7 +388,6 @@ 8271379C1C63ABFD00354E42 /* FBSnapshotTestCase.m in Sources */, 827137951C63ABF400354E42 /* UIImage+Compare.m in Sources */, 827137971C63ABF400354E42 /* UIImage+Snapshot.m in Sources */, - 8271379F1C63AC0000354E42 /* SwiftSupport.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -454,7 +409,6 @@ 133564191B59C3F500A4E4BF /* UIImage+Diff.m in Sources */, 1335641B1B59C3F500A4E4BF /* UIImage+Snapshot.m in Sources */, B319882B1AB7849400B0A900 /* FBSnapshotTestController.m in Sources */, - F0D698F51B204E120005CAC9 /* SwiftSupport.swift in Sources */, 13CBB39E1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -498,7 +452,7 @@ "$(inherited)", ); GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "$(SRCROOT)/FBSnapshotTestCase/FBSnapshotTestCase-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/src/iOSSnapshotTestCaseCore/Resources/FBSnapshotTestCase-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( @@ -532,7 +486,7 @@ "$(inherited)", ); GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "$(SRCROOT)/FBSnapshotTestCase/FBSnapshotTestCase-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/src/iOSSnapshotTestCaseCore/Resources/FBSnapshotTestCase-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( @@ -555,7 +509,7 @@ buildSettings = { DEBUG_INFORMATION_FORMAT = dwarf; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "FBSnapshotTestCaseTests/FBSnapshotTestCaseTests-Info.plist"; + INFOPLIST_FILE = "src/iOSSnapshotTestCaseTests/Resources/FBSnapshotTestCaseTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.FBSnapshotTestCase-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -571,7 +525,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "FBSnapshotTestCaseTests/FBSnapshotTestCaseTests-Info.plist"; + INFOPLIST_FILE = "src/iOSSnapshotTestCaseTests/Resources/FBSnapshotTestCaseTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.FBSnapshotTestCase-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -719,7 +673,7 @@ "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", ); - INFOPLIST_FILE = "FBSnapshotTestCase/FBSnapshotTestCase-Info.plist"; + INFOPLIST_FILE = "src/iOSSnapshotTestCaseCore/Resources/FBSnapshotTestCase-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( @@ -749,7 +703,7 @@ "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", ); - INFOPLIST_FILE = "FBSnapshotTestCase/FBSnapshotTestCase-Info.plist"; + INFOPLIST_FILE = "src/iOSSnapshotTestCaseCore/Resources/FBSnapshotTestCase-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( @@ -776,7 +730,7 @@ "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = "FBSnapshotTestCaseTests/FBSnapshotTestCaseTests-Info.plist"; + INFOPLIST_FILE = "src/iOSSnapshotTestCaseTests/Resources/FBSnapshotTestCaseTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -790,7 +744,7 @@ "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", ); - INFOPLIST_FILE = "FBSnapshotTestCaseTests/FBSnapshotTestCaseTests-Info.plist"; + INFOPLIST_FILE = "src/iOSSnapshotTestCaseTests/Resources/FBSnapshotTestCaseTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/FBSnapshotTestCase.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to FBSnapshotTestCase.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/FBSnapshotTestCase.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to FBSnapshotTestCase.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Package.swift b/Package.swift index ae26475..cc47d63 100644 --- a/Package.swift +++ b/Package.swift @@ -1,43 +1,39 @@ // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription +import CoreImage let package = Package( - name: "FBSnapshotTestCase", + name: "iOSSnapshotTestCase", platforms: [ .iOS(.v10), .tvOS(.v10), ], products: [ .library( - name: "FBSnapshotTestCase", + name: "iOSSnapshotTestCase", type: .dynamic, - targets: ["FBSnapshotTestCase", "FBSnapshotTestCaseCore"]), + targets: [ + "iOSSnapshotTestCase", + "iOSSnapshotTestCaseCore" + ] + ), ], dependencies: [], targets: [ .target( - name: "FBSnapshotTestCase", - dependencies: ["FBSnapshotTestCaseCore"], - path: "FBSnapshotTestCase", - sources: ["Support"] + name: "iOSSnapshotTestCase", + dependencies: ["iOSSnapshotTestCaseCore"] ), .target( - name: "FBSnapshotTestCaseCore", - path: "FBSnapshotTestCase", - sources: ["Categories", - "FBSnapshotTestCase.h", - "FBSnapshotTestCase.m", - "FBSnapshotTestCasePlatform.h", - "FBSnapshotTestCasePlatform.m", - "FBSnapshotTestController.h", - "FBSnapshotTestController.m"], + name: "iOSSnapshotTestCaseCore", + exclude: ["Resources/FBSnapshotTestCase-Info.plist"], publicHeadersPath: "Public" ), .testTarget( - name: "FBSnapshotTestCaseTests", - dependencies: ["FBSnapshotTestCase"], - path: "FBSnapshotTestCaseTests", - sources: ["FBSnapshotControllerTests.m"] + name: "iOSSnapshotTestCaseTests", + dependencies: ["iOSSnapshotTestCase"], + exclude: ["BUILD.bazel"], + resources: [.process("Resources")] ), ] ) diff --git a/build.sh b/build.sh index 7109eb9..8b84dca 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,7 @@ function ci_lib() { function ci_demo() { NAME=$1 - pushd FBSnapshotTestCaseDemo + pushd demos/FBSnapshotTestCaseDemo pod install xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \ -scheme FBSnapshotTestCaseDemo \ @@ -33,7 +33,7 @@ function ci_demo() { function ci_demo_preprocessor() { NAME=$1 - pushd FBSnapshotTestCaseDemo + pushd demos/FBSnapshotTestCaseDemo pod install xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \ -scheme FBSnapshotTestCasePreprocessorDemo \ @@ -48,7 +48,7 @@ function ci_demo_preprocessor() { function ci_carthage_demo() { NAME=$1 - pushd iOSSnapshotTestCaseCarthageDemo + pushd demos/iOSSnapshotTestCaseCarthageDemo carthage bootstrap --no-use-binaries --use-xcframeworks # we're using --no-use-binaries because carthage's archive doesn't yet create xcframeworks, and we're using --use-xcframeworks because of Xcode 12 xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \ -scheme iOSSnapshotTestCaseCarthageDemo \ @@ -63,7 +63,7 @@ function ci_carthage_demo() { function ci_swiftpm_demo() { NAME=$1 - pushd iOSSnapshotTestCaseSwiftPMDemo + pushd demos/iOSSnapshotTestCaseSwiftPMDemo xcodebuild -project iOSSnapshotTestCaseSwiftPMDemo.xcodeproj \ -scheme "iOSSnapshotTestCaseSwiftPMDemo (iOS)" \ -destination "platform=iOS Simulator,name=${NAME}" \ @@ -76,7 +76,7 @@ function ci_swiftpm_demo() { } function test_bazel() { - bazelisk test //FBSnapshotTestCaseTests:FBSnapshotTestCaseTests --test_output=all + bazelisk test //src/iOSSnapshotTestCaseTests:iOSSnapshotTestCaseTests --test_output=all } ci_lib "iPhone 8" && ci_demo "iPhone 8" && ci_demo_preprocessor "iPhone 8" diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.pbxproj diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCaseDemo.xcscheme b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCaseDemo.xcscheme similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCaseDemo.xcscheme rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCaseDemo.xcscheme diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCasePreprocessorDemo.xcscheme b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCasePreprocessorDemo.xcscheme similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCasePreprocessorDemo.xcscheme rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcodeproj/xcshareddata/xcschemes/FBSnapshotTestCasePreprocessorDemo.xcscheme diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/contents.xcworkspacedata b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/contents.xcworkspacedata similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/contents.xcworkspacedata rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/contents.xcworkspacedata diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.h b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.h similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.h rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.h diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.m b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.m similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.m rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBAppDelegate.m diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Info.plist b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Info.plist similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Info.plist rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Info.plist diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Prefix.pch b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Prefix.pch similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Prefix.pch rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo-Prefix.pch diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/AppIcon.appiconset/Contents.json b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/AppIcon.appiconset/Contents.json rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/Contents.json b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/Contents.json similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/Contents.json rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Images.xcassets/Contents.json diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Launch Screen.storyboard b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Launch Screen.storyboard similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Launch Screen.storyboard rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/Launch Screen.storyboard diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/en.lproj/InfoPlist.strings b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/en.lproj/InfoPlist.strings similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/en.lproj/InfoPlist.strings rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/en.lproj/InfoPlist.strings diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/main.m b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/main.m similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/main.m rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemo/main.m diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests-Info.plist b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests-Info.plist similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests-Info.plist rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests-Info.plist diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseSwiftTests.swift b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseSwiftTests.swift similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseSwiftTests.swift rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseSwiftTests.swift diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_32/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@3x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@3x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@3x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests.FBSnapshotTestCaseSwiftTest/testExample@3x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@3x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@3x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@3x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshot@3x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@3x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@3x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@3x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithDifferentBackgroundColorPerArchitecture@3x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@3x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@3x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@3x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearance@3x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@3x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@3x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@3x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithUIAppearanceResizing@3x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@2x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@3x.png b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@3x.png similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@3x.png rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotWithVisualEffects@3x.png diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/en.lproj/InfoPlist.strings b/demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/en.lproj/InfoPlist.strings similarity index 100% rename from FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/en.lproj/InfoPlist.strings rename to demos/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/en.lproj/InfoPlist.strings diff --git a/FBSnapshotTestCaseDemo/Podfile b/demos/FBSnapshotTestCaseDemo/Podfile similarity index 78% rename from FBSnapshotTestCaseDemo/Podfile rename to demos/FBSnapshotTestCaseDemo/Podfile index fb3eced..7df6cf8 100644 --- a/FBSnapshotTestCaseDemo/Podfile +++ b/demos/FBSnapshotTestCaseDemo/Podfile @@ -3,11 +3,11 @@ platform :ios, '14.5' use_frameworks! target :'FBSnapshotTestCaseDemoTests' do - pod 'iOSSnapshotTestCase', :path => '..' + pod 'iOSSnapshotTestCase', :path => '../..' end target :'FBSnapshotTestCasePreprocessorDemoTests' do - pod 'iOSSnapshotTestCase', :path => '..' + pod 'iOSSnapshotTestCase', :path => '../..' end post_install do |installer| diff --git a/FBSnapshotTestCaseDemo/Podfile.lock b/demos/FBSnapshotTestCaseDemo/Podfile.lock similarity index 62% rename from FBSnapshotTestCaseDemo/Podfile.lock rename to demos/FBSnapshotTestCaseDemo/Podfile.lock index e53e9eb..2ab8ef3 100644 --- a/FBSnapshotTestCaseDemo/Podfile.lock +++ b/demos/FBSnapshotTestCaseDemo/Podfile.lock @@ -6,15 +6,15 @@ PODS: - iOSSnapshotTestCase/Core DEPENDENCIES: - - iOSSnapshotTestCase (from `..`) + - iOSSnapshotTestCase (from `../..`) EXTERNAL SOURCES: iOSSnapshotTestCase: - :path: ".." + :path: "../.." SPEC CHECKSUMS: - iOSSnapshotTestCase: fea60fd99da3b57d7bcd5a20531755c82b76359e + iOSSnapshotTestCase: 9af2360fa90f4b1f55cab53c0be6f78dbef7d39b -PODFILE CHECKSUM: fbb7d596ed79771148d8ba7593d4cf7f99855e88 +PODFILE CHECKSUM: 6f2be7d7d46e065f7346db59c3950c6775795f35 COCOAPODS: 1.11.2 diff --git a/FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png b/demos/FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png similarity index 100% rename from FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png rename to demos/FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png diff --git a/iOSSnapshotTestCaseCarthageDemo/Cartfile b/demos/iOSSnapshotTestCaseCarthageDemo/Cartfile similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/Cartfile rename to demos/iOSSnapshotTestCaseCarthageDemo/Cartfile diff --git a/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved b/demos/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved rename to demos/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Info.plist b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Info.plist similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Info.plist rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Info.plist diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift b/demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift similarity index 100% rename from iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift rename to demos/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json b/demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json rename to demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json b/demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json rename to demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json b/demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json rename to demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/Assets.xcassets/Contents.json diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift b/demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift rename to demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/ContentView.swift diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift b/demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift rename to demos/iOSSnapshotTestCaseSwiftPMDemo/Shared/iOSSnapshotTestCaseSwiftPMDemoApp.swift diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist b/demos/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist rename to demos/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/Info.plist diff --git a/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift b/demos/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift similarity index 95% rename from iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift rename to demos/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift index 8d6d3c3..d1039a7 100644 --- a/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift +++ b/demos/iOSSnapshotTestCaseSwiftPMDemo/Tests iOS/iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift @@ -7,7 +7,7 @@ */ import XCTest -import FBSnapshotTestCase +import iOSSnapshotTestCase class iOSSnapshotTestCaseSwiftPMDemoSwiftTests: FBSnapshotTestCase { diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png rename to demos/iOSSnapshotTestCaseSwiftPMDemo/iOS Tests/ReferenceImages_64/Tests_iOS.iOSSnapshotTestCaseSwiftPMDemoSwiftTests/testExample@2x.png diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist rename to demos/iOSSnapshotTestCaseSwiftPMDemo/iOS/Info.plist diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj similarity index 94% rename from iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj rename to demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj index cef9c46..23be10c 100644 --- a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj +++ b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.pbxproj @@ -7,12 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 7623EA2127223856006BF966 /* iOSSnapshotTestCase in Frameworks */ = {isa = PBXBuildFile; productRef = 7623EA2027223856006BF966 /* iOSSnapshotTestCase */; }; + 7623EA2227223856006BF966 /* iOSSnapshotTestCase in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 7623EA2027223856006BF966 /* iOSSnapshotTestCase */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 76FFF53726D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF53626D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift */; }; 76FFF54426D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF51B26D5A9C50072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift */; }; 76FFF54626D5A9C60072E261 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFF51C26D5A9C50072E261 /* ContentView.swift */; }; 76FFF54826D5A9C60072E261 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76FFF51D26D5A9C60072E261 /* Assets.xcassets */; }; - E7C9A6FD26DC239C001AA250 /* FBSnapshotTestCase in Frameworks */ = {isa = PBXBuildFile; productRef = E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */; }; - E7C9A6FE26DC239C001AA250 /* FBSnapshotTestCase in Embed Frameworks */ = {isa = PBXBuildFile; productRef = E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -32,7 +32,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - E7C9A6FE26DC239C001AA250 /* FBSnapshotTestCase in Embed Frameworks */, + 7623EA2227223856006BF966 /* iOSSnapshotTestCase in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -40,6 +40,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 7623EA1F2722384C006BF966 /* ios-snapshot-test-case */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "ios-snapshot-test-case"; path = ../..; sourceTree = ""; }; 76FFF51B26D5A9C50072E261 /* iOSSnapshotTestCaseSwiftPMDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSSnapshotTestCaseSwiftPMDemoApp.swift; sourceTree = ""; }; 76FFF51C26D5A9C50072E261 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 76FFF51D26D5A9C60072E261 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -48,7 +49,6 @@ 76FFF53226D5A9C60072E261 /* Tests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 76FFF53626D5A9C60072E261 /* iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSSnapshotTestCaseSwiftPMDemoSwiftTests.swift; sourceTree = ""; }; 76FFF53826D5A9C60072E261 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E7C9A6FA26DC2367001AA250 /* ios-snapshot-test-case */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "ios-snapshot-test-case"; path = ..; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -63,17 +63,25 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E7C9A6FD26DC239C001AA250 /* FBSnapshotTestCase in Frameworks */, + 7623EA2127223856006BF966 /* iOSSnapshotTestCase in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 7623EA1E2722384C006BF966 /* Packages */ = { + isa = PBXGroup; + children = ( + 7623EA1F2722384C006BF966 /* ios-snapshot-test-case */, + ); + name = Packages; + sourceTree = ""; + }; 76FFF51526D5A9C50072E261 = { isa = PBXGroup; children = ( - E7C9A6FA26DC2367001AA250 /* ios-snapshot-test-case */, + 7623EA1E2722384C006BF966 /* Packages */, 76FFF51A26D5A9C50072E261 /* Shared */, 76FFF52426D5A9C60072E261 /* iOS */, 76FFF53526D5A9C60072E261 /* Tests iOS */, @@ -161,7 +169,7 @@ ); name = "Tests iOS"; packageProductDependencies = ( - E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */, + 7623EA2027223856006BF966 /* iOSSnapshotTestCase */, ); productName = "Tests iOS"; productReference = 76FFF53226D5A9C60072E261 /* Tests iOS.xctest */; @@ -483,9 +491,9 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - E7C9A6FC26DC239C001AA250 /* FBSnapshotTestCase */ = { + 7623EA2027223856006BF966 /* iOSSnapshotTestCase */ = { isa = XCSwiftPackageProductDependency; - productName = FBSnapshotTestCase; + productName = iOSSnapshotTestCase; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme b/demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme similarity index 100% rename from iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme rename to demos/iOSSnapshotTestCaseSwiftPMDemo/iOSSnapshotTestCaseSwiftPMDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseSwiftPMDemo (iOS).xcscheme diff --git a/iOSSnapshotTestCase.podspec b/iOSSnapshotTestCase.podspec index 812dea3..e7bd333 100644 --- a/iOSSnapshotTestCase.podspec +++ b/iOSSnapshotTestCase.podspec @@ -24,12 +24,12 @@ Pod::Spec.new do |s| s.user_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '$(PLATFORM_DIR)/Developer/Library/Frameworks' } s.default_subspecs = 'SwiftSupport' s.subspec 'Core' do |cs| - cs.source_files = 'FBSnapshotTestCase/**/*.{h,m}', 'FBSnapshotTestCase/*.{h,m}' - cs.public_header_files = 'FBSnapshotTestCase/Public/FBSnapshotTestCase.h','FBSnapshotTestCase/Public/FBSnapshotTestCasePlatform.h','FBSnapshotTestCase/Public/FBSnapshotTestController.h' - cs.private_header_files = 'FBSnapshotTestCase/Categories/UIImage+Compare.h','FBSnapshotTestCase/Categories/UIImage+Diff.h','FBSnapshotTestCase/Categories/UIImage+Snapshot.h','FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h' + cs.source_files = 'src/iOSSnapshotTestCaseCore/**/*.{h,m}', 'src/iOSSnapshotTestCaseCore/*.{h,m}' + cs.public_header_files = 'src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCase.h','src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCasePlatform.h','src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestController.h' + cs.private_header_files = 'src/iOSSnapshotTestCaseCore/Categories/UIImage+Compare.h','src/iOSSnapshotTestCaseCore/Categories/UIImage+Diff.h','src/iOSSnapshotTestCaseCore/Categories/UIImage+Snapshot.h','src/iOSSnapshotTestCaseCore/Categories/UIApplication+KeyWindow.h' end s.subspec 'SwiftSupport' do |cs| cs.dependency 'iOSSnapshotTestCase/Core' - cs.source_files = 'FBSnapshotTestCase/**/*.swift' + cs.source_files = 'src/iOSSnapshotTestCase/SwiftSupport.swift' end end diff --git a/FBSnapshotTestCase/Support/SwiftSupport.swift b/src/iOSSnapshotTestCase/SwiftSupport.swift similarity index 98% rename from FBSnapshotTestCase/Support/SwiftSupport.swift rename to src/iOSSnapshotTestCase/SwiftSupport.swift index 305a3a6..c5339cf 100644 --- a/FBSnapshotTestCase/Support/SwiftSupport.swift +++ b/src/iOSSnapshotTestCase/SwiftSupport.swift @@ -11,7 +11,7 @@ import UIKit import XCTest #if SWIFT_PACKAGE -@_exported import FBSnapshotTestCaseCore +@_exported import iOSSnapshotTestCaseCore #endif public extension FBSnapshotTestCase { diff --git a/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h b/src/iOSSnapshotTestCaseCore/Categories/UIApplication+KeyWindow.h similarity index 100% rename from FBSnapshotTestCase/Categories/UIApplication+KeyWindow.h rename to src/iOSSnapshotTestCaseCore/Categories/UIApplication+KeyWindow.h diff --git a/FBSnapshotTestCase/Categories/UIApplication+KeyWindow.m b/src/iOSSnapshotTestCaseCore/Categories/UIApplication+KeyWindow.m similarity index 100% rename from FBSnapshotTestCase/Categories/UIApplication+KeyWindow.m rename to src/iOSSnapshotTestCaseCore/Categories/UIApplication+KeyWindow.m diff --git a/FBSnapshotTestCase/Categories/UIImage+Compare.h b/src/iOSSnapshotTestCaseCore/Categories/UIImage+Compare.h similarity index 100% rename from FBSnapshotTestCase/Categories/UIImage+Compare.h rename to src/iOSSnapshotTestCaseCore/Categories/UIImage+Compare.h diff --git a/FBSnapshotTestCase/Categories/UIImage+Compare.m b/src/iOSSnapshotTestCaseCore/Categories/UIImage+Compare.m similarity index 100% rename from FBSnapshotTestCase/Categories/UIImage+Compare.m rename to src/iOSSnapshotTestCaseCore/Categories/UIImage+Compare.m diff --git a/FBSnapshotTestCase/Categories/UIImage+Diff.h b/src/iOSSnapshotTestCaseCore/Categories/UIImage+Diff.h similarity index 100% rename from FBSnapshotTestCase/Categories/UIImage+Diff.h rename to src/iOSSnapshotTestCaseCore/Categories/UIImage+Diff.h diff --git a/FBSnapshotTestCase/Categories/UIImage+Diff.m b/src/iOSSnapshotTestCaseCore/Categories/UIImage+Diff.m similarity index 100% rename from FBSnapshotTestCase/Categories/UIImage+Diff.m rename to src/iOSSnapshotTestCaseCore/Categories/UIImage+Diff.m diff --git a/FBSnapshotTestCase/Categories/UIImage+Snapshot.h b/src/iOSSnapshotTestCaseCore/Categories/UIImage+Snapshot.h similarity index 100% rename from FBSnapshotTestCase/Categories/UIImage+Snapshot.h rename to src/iOSSnapshotTestCaseCore/Categories/UIImage+Snapshot.h diff --git a/FBSnapshotTestCase/Categories/UIImage+Snapshot.m b/src/iOSSnapshotTestCaseCore/Categories/UIImage+Snapshot.m similarity index 100% rename from FBSnapshotTestCase/Categories/UIImage+Snapshot.m rename to src/iOSSnapshotTestCaseCore/Categories/UIImage+Snapshot.m diff --git a/FBSnapshotTestCase/FBSnapshotTestCase.m b/src/iOSSnapshotTestCaseCore/FBSnapshotTestCase.m similarity index 100% rename from FBSnapshotTestCase/FBSnapshotTestCase.m rename to src/iOSSnapshotTestCaseCore/FBSnapshotTestCase.m diff --git a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m b/src/iOSSnapshotTestCaseCore/FBSnapshotTestCasePlatform.m similarity index 100% rename from FBSnapshotTestCase/FBSnapshotTestCasePlatform.m rename to src/iOSSnapshotTestCaseCore/FBSnapshotTestCasePlatform.m diff --git a/FBSnapshotTestCase/FBSnapshotTestController.m b/src/iOSSnapshotTestCaseCore/FBSnapshotTestController.m similarity index 100% rename from FBSnapshotTestCase/FBSnapshotTestController.m rename to src/iOSSnapshotTestCaseCore/FBSnapshotTestController.m diff --git a/FBSnapshotTestCase/Public/FBSnapshotTestCase.h b/src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCase.h similarity index 100% rename from FBSnapshotTestCase/Public/FBSnapshotTestCase.h rename to src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCase.h diff --git a/FBSnapshotTestCase/Public/FBSnapshotTestCasePlatform.h b/src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCasePlatform.h similarity index 100% rename from FBSnapshotTestCase/Public/FBSnapshotTestCasePlatform.h rename to src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCasePlatform.h diff --git a/FBSnapshotTestCase/Public/FBSnapshotTestController.h b/src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestController.h similarity index 100% rename from FBSnapshotTestCase/Public/FBSnapshotTestController.h rename to src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestController.h diff --git a/FBSnapshotTestCase/FBSnapshotTestCase-Info.plist b/src/iOSSnapshotTestCaseCore/Resources/FBSnapshotTestCase-Info.plist similarity index 100% rename from FBSnapshotTestCase/FBSnapshotTestCase-Info.plist rename to src/iOSSnapshotTestCaseCore/Resources/FBSnapshotTestCase-Info.plist diff --git a/FBSnapshotTestCaseTests/BUILD.bazel b/src/iOSSnapshotTestCaseTests/BUILD.bazel similarity index 62% rename from FBSnapshotTestCaseTests/BUILD.bazel rename to src/iOSSnapshotTestCaseTests/BUILD.bazel index 6003bfc..a486cc1 100644 --- a/FBSnapshotTestCaseTests/BUILD.bazel +++ b/src/iOSSnapshotTestCaseTests/BUILD.bazel @@ -1,16 +1,16 @@ load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") objc_library( - name = "FBSnapshotTestCaseTestsLib", + name = "iOSSnapshotTestCaseTestsLib", enable_modules = True, srcs = ["FBSnapshotControllerTests.m"], deps = [ - "//:FBSnapshotTestCaseCore" + "//:iOSSnapshotTestCaseCore" ], defines = [ "BAZEL" ], - data = glob(["*.png"], allow_empty = False), + data = glob(["Resources/*.png"], allow_empty = False), sdk_frameworks = [ "CoreGraphics", "QuartzCore" @@ -18,9 +18,9 @@ objc_library( ) ios_unit_test( - name = "FBSnapshotTestCaseTests", + name = "iOSSnapshotTestCaseTests", deps = [ - ":FBSnapshotTestCaseTestsLib" + ":iOSSnapshotTestCaseTestsLib" ], minimum_os_version = "10.0", ) diff --git a/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m b/src/iOSSnapshotTestCaseTests/FBSnapshotControllerTests.m similarity index 96% rename from FBSnapshotTestCaseTests/FBSnapshotControllerTests.m rename to src/iOSSnapshotTestCaseTests/FBSnapshotControllerTests.m index 3f6aac9..9331038 100644 --- a/FBSnapshotTestCaseTests/FBSnapshotControllerTests.m +++ b/src/iOSSnapshotTestCaseTests/FBSnapshotControllerTests.m @@ -9,7 +9,7 @@ #import #if BAZEL -@import FBSnapshotTestCaseCore; +@import iOSSnapshotTestCaseCore; @import UIKit; @import CoreGraphics; @import QuartzCore; @@ -200,17 +200,10 @@ - (void)testCompareReferenceImageWithLowPixelToleranceShouldMatch - (UIImage *)_bundledImageNamed:(NSString *)name type:(NSString *)type { - #if BAZEL NSBundle *bundle = [NSBundle bundleForClass:[FBSnapshotControllerTests class]]; NSString *path = [bundle pathForResource:name ofType:type]; NSData *data = [[NSData alloc] initWithContentsOfFile:path]; return [[UIImage alloc] initWithData:data]; - #else - NSURL *url = [[NSURL fileURLWithPath: @__FILE__] URLByDeletingLastPathComponent]; - NSString *path = [[url URLByAppendingPathComponent: [NSString stringWithFormat:@"%@.%@", name, type]] path]; - NSData *data = [[NSData alloc] initWithContentsOfFile:path]; - return [[UIImage alloc] initWithData:data]; - #endif } @end diff --git a/FBSnapshotTestCaseTests/FBSnapshotTestCaseTests-Info.plist b/src/iOSSnapshotTestCaseTests/Resources/FBSnapshotTestCaseTests-Info.plist similarity index 100% rename from FBSnapshotTestCaseTests/FBSnapshotTestCaseTests-Info.plist rename to src/iOSSnapshotTestCaseTests/Resources/FBSnapshotTestCaseTests-Info.plist diff --git a/FBSnapshotTestCaseTests/rect.png b/src/iOSSnapshotTestCaseTests/Resources/rect.png similarity index 100% rename from FBSnapshotTestCaseTests/rect.png rename to src/iOSSnapshotTestCaseTests/Resources/rect.png diff --git a/FBSnapshotTestCaseTests/rect_shade.png b/src/iOSSnapshotTestCaseTests/Resources/rect_shade.png similarity index 100% rename from FBSnapshotTestCaseTests/rect_shade.png rename to src/iOSSnapshotTestCaseTests/Resources/rect_shade.png diff --git a/FBSnapshotTestCaseTests/square-copy.png b/src/iOSSnapshotTestCaseTests/Resources/square-copy.png similarity index 100% rename from FBSnapshotTestCaseTests/square-copy.png rename to src/iOSSnapshotTestCaseTests/Resources/square-copy.png diff --git a/FBSnapshotTestCaseTests/square.png b/src/iOSSnapshotTestCaseTests/Resources/square.png similarity index 100% rename from FBSnapshotTestCaseTests/square.png rename to src/iOSSnapshotTestCaseTests/Resources/square.png diff --git a/FBSnapshotTestCaseTests/square_with_pixel.png b/src/iOSSnapshotTestCaseTests/Resources/square_with_pixel.png similarity index 100% rename from FBSnapshotTestCaseTests/square_with_pixel.png rename to src/iOSSnapshotTestCaseTests/Resources/square_with_pixel.png diff --git a/FBSnapshotTestCaseTests/square_with_text.png b/src/iOSSnapshotTestCaseTests/Resources/square_with_text.png similarity index 100% rename from FBSnapshotTestCaseTests/square_with_text.png rename to src/iOSSnapshotTestCaseTests/Resources/square_with_text.png From 7b10770333a961be6e5a41c9ce04b8c6d3990126 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Thu, 21 Oct 2021 19:23:05 -0700 Subject: [PATCH 29/40] Update version numbers --- CHANGELOG.md | 6 ++++++ demos/FBSnapshotTestCaseDemo/Podfile.lock | 10 +++++----- iOSSnapshotTestCase.podspec | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43c545c..b5be750 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## 8.0.0 + +- We fixed all the file path issues and renamed the targets from FBSnapshotTestCase to iOSSnapshotTestCase. There were a lot of confusing old legacy decisions lingering in the repo and it didn't make sense to keep using confusing naming or directory structures. If you use SPM you will have to use 'import iOSSnapshotTestCase'. Cocoapods and Carthage will continue to use 'import FBSnapshotTestCase'. +- Xcode 13 and iOS 15 support. +- Bazel support. + ## 7.0.0 - Support for Swift Package Manager. diff --git a/demos/FBSnapshotTestCaseDemo/Podfile.lock b/demos/FBSnapshotTestCaseDemo/Podfile.lock index 2ab8ef3..fa0c1ff 100644 --- a/demos/FBSnapshotTestCaseDemo/Podfile.lock +++ b/demos/FBSnapshotTestCaseDemo/Podfile.lock @@ -1,8 +1,8 @@ PODS: - - iOSSnapshotTestCase (7.0.0): - - iOSSnapshotTestCase/SwiftSupport (= 7.0.0) - - iOSSnapshotTestCase/Core (7.0.0) - - iOSSnapshotTestCase/SwiftSupport (7.0.0): + - iOSSnapshotTestCase (8.0.0): + - iOSSnapshotTestCase/SwiftSupport (= 8.0.0) + - iOSSnapshotTestCase/Core (8.0.0) + - iOSSnapshotTestCase/SwiftSupport (8.0.0): - iOSSnapshotTestCase/Core DEPENDENCIES: @@ -13,7 +13,7 @@ EXTERNAL SOURCES: :path: "../.." SPEC CHECKSUMS: - iOSSnapshotTestCase: 9af2360fa90f4b1f55cab53c0be6f78dbef7d39b + iOSSnapshotTestCase: a670511f9ee3829c2b9c23e6e68f315fd7b6790f PODFILE CHECKSUM: 6f2be7d7d46e065f7346db59c3950c6775795f35 diff --git a/iOSSnapshotTestCase.podspec b/iOSSnapshotTestCase.podspec index e7bd333..3bbd22d 100644 --- a/iOSSnapshotTestCase.podspec +++ b/iOSSnapshotTestCase.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "iOSSnapshotTestCase" s.module_name = "FBSnapshotTestCase" - s.version = "7.0.0" + s.version = "8.0.0" s.summary = "Snapshot view unit tests for iOS" s.description = <<-DESC A "snapshot test case" takes a configured UIView or CALayer From 9a8bab5ae3aa2e1258989b23a9a286a8eb95800b Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Thu, 21 Oct 2021 19:49:47 -0700 Subject: [PATCH 30/40] Add missing SwiftSupport.swift file to xcodeproj needed to publish Carthage --- FBSnapshotTestCase.xcodeproj/project.pbxproj | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/FBSnapshotTestCase.xcodeproj/project.pbxproj b/FBSnapshotTestCase.xcodeproj/project.pbxproj index b39dd50..1afc3e2 100644 --- a/FBSnapshotTestCase.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCase.xcodeproj/project.pbxproj @@ -17,6 +17,8 @@ 13CBB39E1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */; }; 7623EA18272234D5006BF966 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 7623EA17272234D5006BF966 /* Resources */; }; 7623EA19272234D5006BF966 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 7623EA17272234D5006BF966 /* Resources */; }; + 765F91B727225D0D00B2C248 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 765F91B627225D0D00B2C248 /* SwiftSupport.swift */; }; + 765F91B827225D0D00B2C248 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 765F91B627225D0D00B2C248 /* SwiftSupport.swift */; }; 827137841C63AB7000354E42 /* FBSnapshotTestCase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8271377A1C63AB6F00354E42 /* FBSnapshotTestCase.framework */; }; 827137911C63ABE900354E42 /* UIImage+Compare.h in Headers */ = {isa = PBXBuildFile; fileRef = 133564101B59C3F500A4E4BF /* UIImage+Compare.h */; }; 827137921C63ABF000354E42 /* UIImage+Diff.h in Headers */ = {isa = PBXBuildFile; fileRef = 133564121B59C3F500A4E4BF /* UIImage+Diff.h */; }; @@ -70,6 +72,7 @@ 13CBB39B1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestCasePlatform.h; path = Public/FBSnapshotTestCasePlatform.h; sourceTree = ""; }; 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestCasePlatform.m; sourceTree = ""; }; 7623EA17272234D5006BF966 /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = ""; }; + 765F91B627225D0D00B2C248 /* SwiftSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = ../iOSSnapshotTestCase/SwiftSupport.swift; sourceTree = ""; }; 8271377A1C63AB6F00354E42 /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBSnapshotTestCase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 827137831C63AB7000354E42 /* FBSnapshotTestCase tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "FBSnapshotTestCase tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; B31987F01AB782D000B0A900 /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBSnapshotTestCase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -165,6 +168,7 @@ 13CBB39C1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m */, B31988221AB7849400B0A900 /* FBSnapshotTestController.h */, B31988231AB7849400B0A900 /* FBSnapshotTestController.m */, + 765F91B627225D0D00B2C248 /* SwiftSupport.swift */, B31987F31AB782D000B0A900 /* Supporting Files */, ); name = Sources; @@ -308,13 +312,14 @@ TargetAttributes = { 827137791C63AB6F00354E42 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 1300; }; 827137821C63AB7000354E42 = { CreatedOnToolsVersion = 7.2; }; B31987EF1AB782D000B0A900 = { CreatedOnToolsVersion = 6.1.1; - LastSwiftMigration = 0920; + LastSwiftMigration = 1300; }; B31987FA1AB782D100B0A900 = { CreatedOnToolsVersion = 6.1.1; @@ -388,6 +393,7 @@ 8271379C1C63ABFD00354E42 /* FBSnapshotTestCase.m in Sources */, 827137951C63ABF400354E42 /* UIImage+Compare.m in Sources */, 827137971C63ABF400354E42 /* UIImage+Snapshot.m in Sources */, + 765F91B827225D0D00B2C248 /* SwiftSupport.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -410,6 +416,7 @@ 1335641B1B59C3F500A4E4BF /* UIImage+Snapshot.m in Sources */, B319882B1AB7849400B0A900 /* FBSnapshotTestController.m in Sources */, 13CBB39E1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.m in Sources */, + 765F91B727225D0D00B2C248 /* SwiftSupport.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -441,6 +448,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -475,6 +483,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -507,6 +516,7 @@ 8271378D1C63AB7000354E42 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; DEBUG_INFORMATION_FORMAT = dwarf; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "src/iOSSnapshotTestCaseTests/Resources/FBSnapshotTestCaseTests-Info.plist"; @@ -522,6 +532,7 @@ 8271378E1C63AB7000354E42 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_NO_COMMON_BLOCKS = YES; @@ -663,6 +674,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -684,6 +696,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.facebook.FBSnapshotTestCase; PRODUCT_NAME = FBSnapshotTestCase; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 5.0; }; @@ -693,6 +706,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -722,6 +736,7 @@ B319880A1AB782D100B0A900 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", @@ -740,6 +755,7 @@ B319880B1AB782D100B0A900 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", From 7e9ae18798127138991767259b3216ace138969a Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Thu, 21 Oct 2021 20:27:39 -0700 Subject: [PATCH 31/40] Fix deployment target in xcodeproj to resolve Carthage issues --- FBSnapshotTestCase.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FBSnapshotTestCase.xcodeproj/project.pbxproj b/FBSnapshotTestCase.xcodeproj/project.pbxproj index 1afc3e2..a1f6976 100644 --- a/FBSnapshotTestCase.xcodeproj/project.pbxproj +++ b/FBSnapshotTestCase.xcodeproj/project.pbxproj @@ -595,7 +595,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; @@ -653,7 +653,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; OTHER_CFLAGS = ""; SDKROOT = iphoneos; From 49b48bc71e0a69e930a376053b09b6541b31c159 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Thu, 21 Oct 2021 20:39:50 -0700 Subject: [PATCH 32/40] Update release docs --- docs/HowToRelease.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/HowToRelease.md b/docs/HowToRelease.md index 616ca4f..80ecd76 100644 --- a/docs/HowToRelease.md +++ b/docs/HowToRelease.md @@ -1,12 +1,15 @@ = How to Release = 1. Update the CHANGELOG.md 2. Update iOSSnapshotTestCase.podspec version number -3. `pod spec lint` inside repo root -4. `pod install` inside FBSnapshotTestCaseDemo/ -5. `pod trunk push iOSSnapshotTestCase.podspec` -6. `carthage build --no-skip-current --use-xcframeworks` inside `iOSSnapshotTestCaseCarthageDemo/` -7. Commit all the changes -8. Tag the commit in master with `git tag version-number`; e.g., `git tag 0.0.1` -9. Push the tag with `git push --tags` -10. `carthage build --archive --configuration Debug --use-xcframeworks` -11. Upload the `FBSnapshotTestCase.framework.zip` to the tagged release on Github for the version number +3. `pod lib lint` inside repo root +4. `pod install` inside `demos/FBSnapshotTestCaseDemo/` +5. Commit all the changes +6. Tag the commit in master with `git tag version-number`; e.g., `git tag 0.0.1` +7. Push the tag with `git push --tags` +8. `pod trunk push iOSSnapshotTestCase.podspec` +9. `carthage update --use-xcframeworks` inside `demos/iOSSnapshotTestCaseCarthageDemo/` +10. `carthage build --no-skip-current --use-xcframeworks` inside `demos/iOSSnapshotTestCaseCarthageDemo/` +11. `iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved` can be commited and pushed to repo without new version if changed. +11. Return to repo root. +11. `carthage build --archive --configuration Debug --use-xcframeworks` +12. Upload the `FBSnapshotTestCase.framework.zip` to the tagged release on Github for the version number From 444c218adaa6a99ba0536b4ec9ad5500047d9051 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Fri, 22 Oct 2021 12:31:57 -0700 Subject: [PATCH 33/40] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ace11ed..2fd0862 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If your test target is Objective-C only use `iOSSnapshotTestCase/Core` instead, Add the following line to your Cartfile: ```carthage -github "uber/ios-snapshot-test-case" ~> 6.1.0 +github "uber/ios-snapshot-test-case" ~> 8.0.0 ``` #### Swift Package Manager @@ -58,7 +58,7 @@ Add the following line to your `Package.swift`: ```spm dependencies: [ - .package(url: "https://github.com/uber/ios-snapshot-test-case.git", from: "7.0.0"), + .package(url: "https://github.com/uber/ios-snapshot-test-case.git", from: "8.0.0"), ], ``` From dba86106213507efc0a07f59305a8affd6c1f331 Mon Sep 17 00:00:00 2001 From: Erik Kerber Date: Thu, 10 Mar 2022 16:50:10 -0600 Subject: [PATCH 34/40] Fix path to SwiftSupport.swift in BUILD.bazel (#170) --- BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index 7ceaf81..80b1ada 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -20,7 +20,7 @@ objc_library( swift_library( name = "iOSSnapshotTestCase", module_name = "iOSSnapshotTestCase", - srcs = ["src/iOSSnapshotTestCaseCore/SwiftSupport.swift"], + srcs = ["src/iOSSnapshotTestCase/SwiftSupport.swift"], deps = [ ":iOSSnapshotTestCaseCore" ], From 47cdb5f0a27a5c48b1bae5c797ca6dc6e9685bb7 Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Thu, 10 Mar 2022 14:50:42 -0800 Subject: [PATCH 35/40] Update links to env var code in readme (#173) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2fd0862..6df04e7 100644 --- a/README.md +++ b/README.md @@ -67,14 +67,14 @@ dependencies: [ ### Step 2: Setup Test Scheme Replace "Tests" with the name of your test project. -1. There are [three ways](https://github.com/uber/ios-snapshot-test-case/blob/master/FBSnapshotTestCase/FBSnapshotTestCase.h#L19-L29) of setting reference image directories, the recommended one is to define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should point to the directory where you want reference images to be stored. We normally use this: +1. There are [three ways](https://github.com/uber/ios-snapshot-test-case/blob/main/src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCase.h#L17-L31) of setting reference image directories, the recommended one is to define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should point to the directory where you want reference images to be stored. We normally use this: |Name|Value| |:---|:----| |`FB_REFERENCE_IMAGE_DIR`|`$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages`| |`IMAGE_DIFF_DIR`|`$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/FailureDiffs`| -Define the `IMAGE_DIFF_DIR` to the directory where you want to store diffs of failed snapshots. There are also [three ways](https://github.com/uber/ios-snapshot-test-case/blob/master/FBSnapshotTestCase/FBSnapshotTestCase.h#L34-L43) to set failed image diff directories. +Define the `IMAGE_DIFF_DIR` to the directory where you want to store diffs of failed snapshots. There are also [three ways](https://github.com/uber/ios-snapshot-test-case/blob/main/src/iOSSnapshotTestCaseCore/Public/FBSnapshotTestCase.h#L33-L45) to set failed image diff directories. ![](FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png) From 5ec4135b22725e873eb03c335c0481393b7ecd49 Mon Sep 17 00:00:00 2001 From: Takuhiro Muta <417.72ki@gmail.com> Date: Fri, 11 Mar 2022 07:51:30 +0900 Subject: [PATCH 36/40] remove importing `CoreImage` (#169) --- Package.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Package.swift b/Package.swift index cc47d63..08858dd 100644 --- a/Package.swift +++ b/Package.swift @@ -1,7 +1,6 @@ // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription -import CoreImage let package = Package( name: "iOSSnapshotTestCase", From 71f19547d9f9d0959a10881814de41b2114a8e1c Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Wed, 16 Mar 2022 10:50:17 -0700 Subject: [PATCH 37/40] Add a bazelversion file (#176) --- .bazelversion | 1 + 1 file changed, 1 insertion(+) create mode 100644 .bazelversion diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..fae6e3d --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +4.2.1 From 57b023c8bb3df361e2fae01532cd066ec0b65d2e Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Thu, 29 Jun 2023 13:18:44 -0400 Subject: [PATCH 38/40] Adds link to XCTest in objc_library rule (#180) This allows the bazel configuration to compile under certain scenarios Co-authored-by: Maxwell Elliott --- BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD.bazel b/BUILD.bazel index 80b1ada..0ae5406 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -14,6 +14,7 @@ objc_library( copts = [ "-Wno-deprecated-declarations" ], + sdk_frameworks = ["XCTest"], visibility = ["//visibility:public"] ) From e4b81173e067af753a7a3f6260bfa37865799688 Mon Sep 17 00:00:00 2001 From: Alan Zeino Date: Thu, 9 Jan 2025 11:36:43 -0800 Subject: [PATCH 39/40] Update LibraryVsApplicationTestBundles.md --- docs/LibraryVsApplicationTestBundles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LibraryVsApplicationTestBundles.md b/docs/LibraryVsApplicationTestBundles.md index bd990d7..6218edc 100644 --- a/docs/LibraryVsApplicationTestBundles.md +++ b/docs/LibraryVsApplicationTestBundles.md @@ -10,7 +10,7 @@ Library Test Bundles were once called _Logic_ Test Bundles in Apple's nomenclatu ### Application tests -Unit tests that test parts of an application (such as UIViewControllers, UIWindows, UIViews) should typically be part of an Application test bundle. An Application test bundle requires a Test Host (an application to run your tests in) and at test run time, a simulator too. The attached Test Host provides access to some iOS APIs that only work inside Application test bundles. In our experience, we've seen these: +Unit tests that test parts of an application (such as UIViewControllers, UIWindows, UIViews) should typically be part of an Application test bundle. An Application test bundle requires a 'Test Host' (an application to run your tests in) and at test run time, a simulator too. The attached Test Host provides access to some iOS APIs that only work inside Application test bundles. In our experience, we've seen these: * `-[UIControl sendActionsForControlEvents:]` — This API is commonly used to trigger actions at runtime and sometimes you might want to use it inside a test to trigger a particular code path which is ordinarily run when a user performs an action. While it does not work inside a Library test bundle, we've written our own version for unit tests (see 'Code Snippets' below) that works well for this need. * `UIAppearance` — Most `UIAppearance` APIs break when there is no test host present. From 0ed5bceee307680523b119cd3ac4510b5247eda2 Mon Sep 17 00:00:00 2001 From: reesebadazz2 Date: Mon, 15 Sep 2025 12:40:43 -0500 Subject: [PATCH 40/40] Update main.yml - name: First interaction uses: actions/first-interaction@v1.3.0 with: # Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }} repo-token: # Comment to post on an individual's first issue issue-message: # optional # Comment to post on an individual's first pull request pr-message: # optional --- .github/workflows/main.yml | 64 ++++++-------------------------------- 1 file changed, 10 insertions(+), 54 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 525b8e0..7d00b3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,54 +1,10 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: macos-11 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Install xcbeautify - uses: Cyberbeni/install-swift-tool@v2 - with: - url: https://github.com/thii/xcbeautify - - # Setup python for Bazel test runner - - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install biplist - - # Runs a single command using the runners shell - - name: Run a one-line script - run: ./build.sh - - - name: Archive production artifacts - uses: actions/upload-artifact@v2 - if: failure() - with: - name: failed-snapshots - path: | - FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FailedSnapshotImages - iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/FailedSnapshotImages - + - name: First interaction + uses: actions/first-interaction@v1.3.0 + with: + # Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }} + repo-token: + # Comment to post on an individual's first issue + issue-message: # optional + # Comment to post on an individual's first pull request + pr-message: # optional +