Skip to content

Commit

Permalink
Reference Image Updates in preparation for iOSSnapshotTestCase 6.2 (#…
Browse files Browse the repository at this point in the history
…1857)

- Update all the tests identifiers in code to use `_` instead of `-`.
-- Rename all the reference images with `_` instead of `-`.
-- The above two changes are in preparation for iOSSnapshotTestsCase doing this for us.
- Move all the reference images in the path "ReferenceImages_iOS_10" to "ReferenceImages_64".
-- When copying these reference images, prefer the iOS10 reference images since we now run under iOS10.
-- The exception is testRoundedCornerBlock where we prefer the 64 one.
-- Remove "_iOS_10" as a suffix in code.

Co-authored-by: Rahul Malik <[email protected]>
  • Loading branch information
Greg Bolsinga and rahul-malik authored May 28, 2020
1 parent 3c0e044 commit a97b689
Show file tree
Hide file tree
Showing 198 changed files with 3 additions and 14 deletions.
4 changes: 0 additions & 4 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@
CC0F88621E4281E200576FED /* ASSectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCE04B1E1E313EA7006AEBBB /* ASSectionController.h */; settings = {ATTRIBUTES = (Public, ); }; };
CC0F88631E4281E700576FED /* ASSupplementaryNodeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CCE04B2B1E314A32006AEBBB /* ASSupplementaryNodeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
CC0F886C1E4286FA00576FED /* ReferenceImages_64 in Resources */ = {isa = PBXBuildFile; fileRef = CC0F88691E4286FA00576FED /* ReferenceImages_64 */; };
CC0F886D1E4286FA00576FED /* ReferenceImages_iOS_10 in Resources */ = {isa = PBXBuildFile; fileRef = CC0F886A1E4286FA00576FED /* ReferenceImages_iOS_10 */; };
CC11F97A1DB181180024D77B /* ASNetworkImageNodeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC11F9791DB181180024D77B /* ASNetworkImageNodeTests.mm */; };
CC18248C200D49C800875940 /* ASTextNodeCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = CC18248B200D49C800875940 /* ASTextNodeCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
CC224E962066CA6D00BBA57F /* configuration.json in Resources */ = {isa = PBXBuildFile; fileRef = CC224E952066CA6D00BBA57F /* configuration.json */; };
Expand Down Expand Up @@ -867,7 +866,6 @@
CC0F885D1E4280B800576FED /* _ASCollectionViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _ASCollectionViewCell.mm; sourceTree = "<group>"; };
CC0F885E1E4280B800576FED /* _ASCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _ASCollectionViewCell.h; sourceTree = "<group>"; };
CC0F88691E4286FA00576FED /* ReferenceImages_64 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ReferenceImages_64; sourceTree = "<group>"; };
CC0F886A1E4286FA00576FED /* ReferenceImages_iOS_10 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ReferenceImages_iOS_10; sourceTree = "<group>"; };
CC11F9791DB181180024D77B /* ASNetworkImageNodeTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASNetworkImageNodeTests.mm; sourceTree = "<group>"; };
CC18248B200D49C800875940 /* ASTextNodeCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASTextNodeCommon.h; sourceTree = "<group>"; };
CC224E952066CA6D00BBA57F /* configuration.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = configuration.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1407,7 +1405,6 @@
children = (
CC01EB6C23105C2000CDB61A /* TestAsset.xcassets */,
CC0F88691E4286FA00576FED /* ReferenceImages_64 */,
CC0F886A1E4286FA00576FED /* ReferenceImages_iOS_10 */,
058D09C7195D04C000B7D73C /* AsyncDisplayKitTests-Info.plist */,
058D09C8195D04C000B7D73C /* InfoPlist.strings */,
);
Expand Down Expand Up @@ -2241,7 +2238,6 @@
buildActionMask = 2147483647;
files = (
CC0F886C1E4286FA00576FED /* ReferenceImages_64 in Resources */,
CC0F886D1E4286FA00576FED /* ReferenceImages_iOS_10 in Resources */,
052EE06B1A15A0D8002C6279 /* TestResources in Resources */,
CC01EB6D23105C2000CDB61A /* TestAsset.xcassets in Resources */,
058D09CA195D04C000B7D73C /* InfoPlist.strings in Resources */,
Expand Down
4 changes: 2 additions & 2 deletions Tests/ASDisplayNodeSnapshotTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ - (void)testClippingCornerRounding
#if AS_AT_LEAST_IOS13
if (@available(iOS 13.0, *)) {
[[UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight] performAsCurrentTraitCollection:^{
ASSnapshotVerifyNode(node, ([NSString stringWithFormat:@"%d-light", (int)c]));
ASSnapshotVerifyNode(node, ([NSString stringWithFormat:@"%d_light", (int)c]));
}];

[[UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark] performAsCurrentTraitCollection:^{
ASSnapshotVerifyNode(node, ([NSString stringWithFormat:@"%d-dark", (int)c]));
ASSnapshotVerifyNode(node, ([NSString stringWithFormat:@"%d_dark", (int)c]));
}];
} else {
ASSnapshotVerifyNode(node, ([NSString stringWithFormat:@"%d", (int)c]));
Expand Down
2 changes: 1 addition & 1 deletion Tests/ASInsetLayoutSpecSnapshotTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static UIEdgeInsets insetsForCombination(NSUInteger combination, CGFloat insetVa

static NSString *nameForInsets(UIEdgeInsets insets)
{
return [NSString stringWithFormat:@"%.f-%.f-%.f-%.f", insets.top, insets.left, insets.bottom, insets.right];
return [NSString stringWithFormat:@"%.f_%.f_%.f_%.f", insets.top, insets.left, insets.bottom, insets.right];
}

@interface ASInsetLayoutSpecSnapshotTests : ASLayoutSpecSnapshotTestCase
Expand Down
7 changes: 0 additions & 7 deletions Tests/ASSnapshotTestCase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
NSOrderedSet *ASSnapshotTestCaseDefaultSuffixes(void)
{
NSMutableOrderedSet *suffixesSet = [[NSMutableOrderedSet alloc] init];
// In some rare cases, slightly different rendering may occur on iOS 10 (text rasterization).
// If the test folders find any image that exactly matches, they pass;
// if an image is not present at all, or it fails, it moves on to check the others.
// This means the order doesn't matter besides reducing logging / performance.
if (AS_AT_LEAST_IOS10) {
[suffixesSet addObject:@"_iOS_10"];
}
[suffixesSet addObject:@"_64"];
return [suffixesSet copy];
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified ..._64/ASStackLayoutSpecSnapshotTests/[email protected]
Binary file modified ...64/ASStackLayoutSpecSnapshotTests/[email protected]
Binary file modified ...es_64/ASStackLayoutSpecSnapshotTests/[email protected]
Binary file modified ...ges_64/ASStackLayoutSpecSnapshotTests/[email protected]
Binary file modified ...nceImages_64/ASStackLayoutSpecSnapshotTests/[email protected]
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified ...ferenceImages_64/ASTextNodeSnapshotTests/[email protected]
Binary file modified ...ferenceImages_64/ASTextNodeSnapshotTests/[email protected]
Binary file modified ...ferenceImages_64/ASTextNodeSnapshotTests/[email protected]
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit a97b689

Please sign in to comment.