Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@
CC0F88601E4280B800576FED /* _ASCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = CC0F885E1E4280B800576FED /* _ASCollectionViewCell.h */; settings = {ATTRIBUTES = (Private, ); }; };
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, ); }; };
CC0F886B1E4286FA00576FED /* ReferenceImages_32 in Resources */ = {isa = PBXBuildFile; fileRef = CC0F88681E4286FA00576FED /* ReferenceImages_32 */; };
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.m in Sources */ = {isa = PBXBuildFile; fileRef = CC11F9791DB181180024D77B /* ASNetworkImageNodeTests.m */; };
Expand Down Expand Up @@ -700,7 +699,6 @@
CC0F885A1E42807F00576FED /* ASCollectionViewFlowLayoutInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionViewFlowLayoutInspector.h; sourceTree = "<group>"; };
CC0F885D1E4280B800576FED /* _ASCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _ASCollectionViewCell.m; sourceTree = "<group>"; };
CC0F885E1E4280B800576FED /* _ASCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _ASCollectionViewCell.h; sourceTree = "<group>"; };
CC0F88681E4286FA00576FED /* ReferenceImages_32 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ReferenceImages_32; 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.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASNetworkImageNodeTests.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1036,7 +1034,6 @@
058D09C6195D04C000B7D73C /* Supporting Files */ = {
isa = PBXGroup;
children = (
CC0F88681E4286FA00576FED /* ReferenceImages_32 */,
CC0F88691E4286FA00576FED /* ReferenceImages_64 */,
CC0F886A1E4286FA00576FED /* ReferenceImages_iOS_10 */,
058D09C7195D04C000B7D73C /* AsyncDisplayKitTests-Info.plist */,
Expand Down Expand Up @@ -1671,7 +1668,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CC0F886B1E4286FA00576FED /* ReferenceImages_32 in Resources */,
CC0F886C1E4286FA00576FED /* ReferenceImages_64 in Resources */,
CC0F886D1E4286FA00576FED /* ReferenceImages_iOS_10 in Resources */,
052EE06B1A15A0D8002C6279 /* TestResources in Resources */,
Expand Down
25 changes: 8 additions & 17 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def asyncdisplaykit_library(
apple_library(
name = name,
prefix_header = 'Source/AsyncDisplayKit-Prefix.pch',
header_path_prefix = 'Source',
header_path_prefix = 'AsyncDisplayKit',
exported_headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS,
headers = ASYNCDISPLAYKIT_PRIVATE_HEADERS,
srcs = glob([
Expand All @@ -58,8 +58,6 @@ def asyncdisplaykit_library(
'Photos',
'-weak_framework',
'MapKit',
'-weak_framework',
'AssetsLibrary',
],
deps = deps,
frameworks = [
Expand All @@ -72,6 +70,9 @@ def asyncdisplaykit_library(
'$SDKROOT/System/Library/Frameworks/CoreGraphics.framework',
'$SDKROOT/System/Library/Frameworks/CoreLocation.framework',
'$SDKROOT/System/Library/Frameworks/AVFoundation.framework',

# TODO somehow AssetsLibrary can't be weak_framework
'$SDKROOT/System/Library/Frameworks/AssetsLibrary.framework',
] + additional_frameworks,
visibility = ['PUBLIC'],
)
Expand Down Expand Up @@ -100,12 +101,6 @@ for name in ['AsyncDisplayKit', 'AsyncDisplayKit-PINRemoteImage']:
# Test Host
# TODO: Split to smaller BUCK files and parse in parallel
#####################################
apple_resource(
name = 'TestHostResources',
files = ['Default-568h@2x.png'],
dirs = [],
)

apple_bundle(
name = 'TestHost',
binary = ':TestHostBinary',
Expand All @@ -120,14 +115,10 @@ apple_bundle(
apple_binary(
name = 'TestHostBinary',
headers = glob(['Tests/TestHost/*.h']),
srcs = glob([
'Tests/TestHost/*.m',
'Tests/TestHost/*.mm',
]),
srcs = glob(['Tests/TestHost/*.m']),
lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS,
linker_flags = COMMON_LINKER_FLAGS,
deps = [
':TestHostResources',
':AsyncDisplayKit-Core',
],
frameworks = [
Expand Down Expand Up @@ -158,10 +149,9 @@ apple_test(
'PRODUCT_BUNDLE_IDENTIFIER': 'com.facebook.AsyncDisplayKitTests',
},
prefix_header = 'Tests/AsyncDisplayKitTests-Prefix.pch',
header_path_prefix = 'AsyncDisplayKit',
# Expose all ASDK headers to tests
headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS + ASYNCDISPLAYKIT_PRIVATE_HEADERS + glob([
'Tests/*.h',
]),
headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS + ASYNCDISPLAYKIT_PRIVATE_HEADERS + glob(['Tests/*.h']),
srcs = glob([
'Tests/*.m',
'Tests/*.mm'
Expand All @@ -172,6 +162,7 @@ apple_test(
snapshot_reference_images_path='Tests/ReferenceImages',
preprocessor_flags = COMMON_PREPROCESSOR_FLAGS + [
'-Wno-implicit-function-declaration',
'-Wno-deprecated-declarations',
],
lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS,
linker_flags = COMMON_LINKER_FLAGS,
Expand Down
5 changes: 1 addition & 4 deletions Tests/ASDisplayNodeTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2149,12 +2149,9 @@ - (void)testThatOnDidLoadThrowsIfCalledOnLoadedOffMain
{
ASTestDisplayNode *node = [[ASTestDisplayNode alloc] init];
[node view];
dispatch_semaphore_t sem = dispatch_semaphore_create(0);
[NSThread detachNewThreadWithBlock:^{
[self executeOffThread:^{
XCTAssertThrows([node onDidLoad:^(ASDisplayNode * _Nonnull node) { }]);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case was failing on iOS 9 because detachNewThreadWithBlock is available since iOS 10.

dispatch_semaphore_signal(sem);
}];
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
}

- (void)testThatOnDidLoadWorks
Expand Down
7 changes: 7 additions & 0 deletions Tests/ASImageNodeSnapshotTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ @interface ASImageNodeSnapshotTests : ASSnapshotTestCase

@implementation ASImageNodeSnapshotTests

- (void)setUp
{
[super setUp];

self.recordMode = NO;
}

- (UIImage *)testImage
{
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"logo-square"
Expand Down
8 changes: 0 additions & 8 deletions Tests/ASRelativeLayoutSpecSnapshotTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ @implementation ASRelativeLayoutSpecSnapshotTests

#pragma mark - XCTestCase

- (void)setUp
{
[super setUp];

self.recordMode = NO;
}


- (void)testWithOptions
{
[self testAllVerticalPositionsForHorizontalPosition:ASRelativeLayoutSpecPositionStart];
Expand Down
7 changes: 1 addition & 6 deletions Tests/ASSnapshotTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@
// or 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.
[suffixesSet addObject:@"_32"];
[suffixesSet addObject:@"_64"];
if (AS_AT_LEAST_IOS10) {
[suffixesSet addObject:@"_iOS_10"];
}
#if __LP64__
return [suffixesSet reversedOrderedSet];
#else
[suffixesSet addObject:@"_64"];
return [suffixesSet copy];
#endif
}

@implementation ASSnapshotTestCase
Expand Down
7 changes: 0 additions & 7 deletions Tests/ASWrapperSpecSnapshotTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ @interface ASWrapperSpecSnapshotTests : ASLayoutSpecSnapshotTestCase

@implementation ASWrapperSpecSnapshotTests

- (void)setUp
{
[super setUp];

self.recordMode = NO;
}

- (void)testWrapperSpecWithOneElementShouldSizeToElement
{
ASDisplayNode *child = ASDisplayNodeWithBackgroundColor([UIColor redColor], {50, 50});
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.