Skip to content

Commit

Permalink
Add new workspaces for tests for different integrations (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai-Holler committed Jun 21, 2017
1 parent e503ad5 commit 5357d25
Show file tree
Hide file tree
Showing 32 changed files with 106 additions and 109 deletions.
9 changes: 0 additions & 9 deletions ASDKListKit/Podfile

This file was deleted.

56 changes: 32 additions & 24 deletions AsyncDisplayKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ target :'AsyncDisplayKitTests' do
pod 'JGMethodSwizzler', :git => 'https://github.com/JonasGessner/JGMethodSwizzler', :branch => 'master'

# Only for buck build
pod 'PINRemoteImage', '3.0.0-beta.7'
pod 'PINRemoteImage', '3.0.0-beta.10'
end

#TODO CocoaPods plugin instead?
post_install do |installer|
require 'fileutils'
#TODO CocoaPods plugin instead?
post_install do |installer|
require 'fileutils'

# Assuming we're at the root dir
buck_files_dir = 'buck-files'
if File.directory?(buck_files_dir)
installer.pod_targets.flat_map do |pod_target|
pod_name = pod_target.pod_name
# Copy the file at buck-files/BUCK_pod_name to Pods/pod_name/BUCK,
# override existing file if needed
buck_file = buck_files_dir + '/BUCK_' + pod_name
if File.file?(buck_file)
FileUtils.cp(buck_file, 'Pods/' + pod_name + '/BUCK', :preserve => false)
end
# Assuming we're at the root dir
buck_files_dir = 'buck-files'
if File.directory?(buck_files_dir)
installer.pod_targets.flat_map do |pod_target|
pod_name = pod_target.pod_name
# Copy the file at buck-files/BUCK_pod_name to Pods/pod_name/BUCK,
# override existing file if needed
buck_file = buck_files_dir + '/BUCK_' + pod_name
if File.file?(buck_file)
FileUtils.cp(buck_file, 'Pods/' + pod_name + '/BUCK', :preserve => false)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
CC55323D1E16F2A90011C01F /* ASListTestCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = CC5532351E16F2A90011C01F /* ASListTestCellNode.m */; };
CC55323E1E16F2A90011C01F /* ASListTestObject.m in Sources */ = {isa = PBXBuildFile; fileRef = CC5532371E16F2A90011C01F /* ASListTestObject.m */; };
CC55323F1E16F2A90011C01F /* ASListKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC5532381E16F2A90011C01F /* ASListKitTests.m */; };
CCC31FAD1EF9B96600E41731 /* ASDisplayNode+OCMock.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC31FA51EF9B96600E41731 /* ASDisplayNode+OCMock.m */; };
CCC31FAE1EF9B96600E41731 /* ASTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC31FA71EF9B96600E41731 /* ASTestCase.m */; };
CCC31FAF1EF9B96600E41731 /* NSInvocation+ASTestHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC31FAA1EF9B96600E41731 /* NSInvocation+ASTestHelpers.m */; };
CCC31FB01EF9B96600E41731 /* OCMockObject+ASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC31FAC1EF9B96600E41731 /* OCMockObject+ASAdditions.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -35,7 +39,14 @@
CC5532361E16F2A90011C01F /* ASListTestObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASListTestObject.h; sourceTree = "<group>"; };
CC5532371E16F2A90011C01F /* ASListTestObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASListTestObject.m; sourceTree = "<group>"; };
CC5532381E16F2A90011C01F /* ASListKitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASListKitTests.m; sourceTree = "<group>"; };
CC55326C1E16F67A0011C01F /* ASXCTExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASXCTExtensions.h; sourceTree = "<group>"; };
CCC31FA51EF9B96600E41731 /* ASDisplayNode+OCMock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASDisplayNode+OCMock.m"; sourceTree = "<group>"; };
CCC31FA61EF9B96600E41731 /* ASTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTestCase.h; sourceTree = "<group>"; };
CCC31FA71EF9B96600E41731 /* ASTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTestCase.m; sourceTree = "<group>"; };
CCC31FA81EF9B96600E41731 /* ASXCTExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASXCTExtensions.h; sourceTree = "<group>"; };
CCC31FA91EF9B96600E41731 /* NSInvocation+ASTestHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSInvocation+ASTestHelpers.h"; sourceTree = "<group>"; };
CCC31FAA1EF9B96600E41731 /* NSInvocation+ASTestHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSInvocation+ASTestHelpers.m"; sourceTree = "<group>"; };
CCC31FAB1EF9B96600E41731 /* OCMockObject+ASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OCMockObject+ASAdditions.h"; sourceTree = "<group>"; };
CCC31FAC1EF9B96600E41731 /* OCMockObject+ASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OCMockObject+ASAdditions.m"; sourceTree = "<group>"; };
D6BDED6F23A72F40F571EEF0 /* Pods-ASDKListKitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ASDKListKitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ASDKListKitTests/Pods-ASDKListKitTests.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -92,22 +103,14 @@
CC5532251E16EB9D0011C01F /* ASDKListKitTests */ = {
isa = PBXGroup;
children = (
CC55326D1E16F67D0011C01F /* Common */,
CCC31FA41EF9B96600E41731 /* Common */,
CC55326E1E170A740011C01F /* ListKit Fixtures */,
CC5532381E16F2A90011C01F /* ASListKitTests.m */,
CC5532281E16EB9D0011C01F /* Info.plist */,
);
path = ASDKListKitTests;
sourceTree = "<group>";
};
CC55326D1E16F67D0011C01F /* Common */ = {
isa = PBXGroup;
children = (
CC55326C1E16F67A0011C01F /* ASXCTExtensions.h */,
);
name = Common;
sourceTree = "<group>";
};
CC55326E1E170A740011C01F /* ListKit Fixtures */ = {
isa = PBXGroup;
children = (
Expand All @@ -127,6 +130,22 @@
name = "ListKit Fixtures";
sourceTree = "<group>";
};
CCC31FA41EF9B96600E41731 /* Common */ = {
isa = PBXGroup;
children = (
CCC31FA51EF9B96600E41731 /* ASDisplayNode+OCMock.m */,
CCC31FA61EF9B96600E41731 /* ASTestCase.h */,
CCC31FA71EF9B96600E41731 /* ASTestCase.m */,
CCC31FA81EF9B96600E41731 /* ASXCTExtensions.h */,
CCC31FA91EF9B96600E41731 /* NSInvocation+ASTestHelpers.h */,
CCC31FAA1EF9B96600E41731 /* NSInvocation+ASTestHelpers.m */,
CCC31FAB1EF9B96600E41731 /* OCMockObject+ASAdditions.h */,
CCC31FAC1EF9B96600E41731 /* OCMockObject+ASAdditions.m */,
);
name = Common;
path = ../../Tests/Common;
sourceTree = SOURCE_ROOT;
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -204,7 +223,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
876CE14CAF6A87E34577E157 /* [CP] Copy Pods Resources */ = {
Expand Down Expand Up @@ -244,10 +263,14 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CCC31FAD1EF9B96600E41731 /* ASDisplayNode+OCMock.m in Sources */,
CC55323E1E16F2A90011C01F /* ASListTestObject.m in Sources */,
CCC31FAF1EF9B96600E41731 /* NSInvocation+ASTestHelpers.m in Sources */,
CC5532391E16F2A90011C01F /* ASListTestSupplementarySource.m in Sources */,
CCC31FB01EF9B96600E41731 /* OCMockObject+ASAdditions.m in Sources */,
CC55323D1E16F2A90011C01F /* ASListTestCellNode.m in Sources */,
CC55323B1E16F2A90011C01F /* ASListKitTestAdapterDataSource.m in Sources */,
CCC31FAE1EF9B96600E41731 /* ASTestCase.m in Sources */,
CC55323C1E16F2A90011C01F /* ASListTestSection.m in Sources */,
CC55323F1E16F2A90011C01F /* ASListKitTests.m in Sources */,
CC55323A1E16F2A90011C01F /* ASListTestSupplementaryNode.m in Sources */,
Expand All @@ -260,12 +283,14 @@
CC55321D1E16EB7A0011C01F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
};
name = Debug;
};
CC55321E1E16EB7A0011C01F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
};
name = Release;
};
Expand Down Expand Up @@ -311,7 +336,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = ASDKListKitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -357,7 +382,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = ASDKListKitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = asyncdisplaykit.ASDKListKitTests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ - (NSArray *)objectsForListAdapter:(IGListAdapter *)listAdapter
return self.objects;
}

- (IGListSectionController <IGListSectionType> *)listAdapter:(IGListAdapter *)listAdapter sectionControllerForObject:(id)object
- (IGListSectionController *)listAdapter:(IGListAdapter *)listAdapter sectionControllerForObject:(id)object
{
ASListTestSection *section = [[ASListTestSection alloc] init];
return section;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#import "ASListKitTestAdapterDataSource.h"
#import "ASXCTExtensions.h"
#import <JGMethodSwizzler/JGMethodSwizzler.h>
#import "ASTestCase.h"

@interface ASListKitTests : XCTestCase
@interface ASListKitTests : ASTestCase

@property (nonatomic, strong) ASCollectionNode *collectionNode;
@property (nonatomic, strong) UICollectionView *collectionView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#import <IGListKit/IGListKit.h>
#import <AsyncDisplayKit/AsyncDisplayKit.h>

@interface ASListTestSection : IGListSectionController <IGListSectionType, ASSectionController>
@interface ASListTestSection : IGListSectionController <ASSectionController>

@property (nonatomic) NSInteger itemCount;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@

@property (nonatomic, weak) id<IGListCollectionContext> collectionContext;

@property (nonatomic, weak) IGListSectionController<IGListSectionType> *sectionController;
@property (nonatomic, weak) IGListSectionController *sectionController;

@end
File renamed without changes.
9 changes: 9 additions & 0 deletions SubspecWorkspaces/ASDKListKit/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
target 'ASDKListKitTests' do
pod 'Texture/IGListKit', :path => '../..'
pod 'OCMock', '~> 3.4'
pod 'JGMethodSwizzler', :git => 'https://github.com/JonasGessner/JGMethodSwizzler', :branch => 'master'
end

6 changes: 2 additions & 4 deletions Tests/ASDisplayNodeTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2266,12 +2266,10 @@ - (void)testThatItIsAllowedToRetrieveDebugDescriptionIncludingVCOffMainThread
UIViewController *vc = [[UIViewController alloc] init];
[vc.view addSubnode:node];
dispatch_group_t g = dispatch_group_create();
dispatch_group_enter(g);
__block NSString *debugDescription;
[NSThread detachNewThreadWithBlock:^{
dispatch_group_async(g, dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{
debugDescription = [node debugDescription];
dispatch_group_leave(g);
}];
});
dispatch_group_wait(g, DISPATCH_TIME_FOREVER);
// Ensure the debug description contains the VC string.
// Have to split into two lines because XCTAssert macro can't handle the stringWithFormat:.
Expand Down
36 changes: 0 additions & 36 deletions Tests/ASXCTExtensions.h

This file was deleted.

File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion Tests/ASTestCase.m → Tests/Common/ASTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ - (void)tearDown
for (unsigned int i = 0; i < ivarCount; i++) {
Ivar ivar = ivars[i];
NSString *key = [NSString stringWithCString:ivar_getName(ivar) encoding:NSUTF8StringEncoding];
[self setValue:nil forKey:key];
if (OCMIsObjectType(ivar_getTypeEncoding(ivar))) {
[self setValue:nil forKey:key];
}
}
if (ivars) {
free(ivars);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#import "OCMockObject+ASAdditions.h"

#import <OCMock/OCMock.h>
#import "ASInternalHelpers.h"
#import <objc/runtime.h>
#import "ASTestCase.h"

Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ fi

if [ "$MODE" = "tests_listkit" ]; then
echo "Building & testing AsyncDisplayKit+IGListKit."
pod install --project-directory=ASDKListKit
pod install --project-directory=SubspecWorkspaces/ASDKListKit
set -o pipefail && xcodebuild \
-workspace ASDKListKit/ASDKListKit.xcworkspace \
-workspace SubspecWorkspaces/ASDKListKit/ASDKListKit.xcworkspace \
-scheme ASDKListKitTests \
-sdk "$SDK" \
-destination "$PLATFORM" \
Expand Down

0 comments on commit 5357d25

Please sign in to comment.