Skip to content

Commit c64b3c2

Browse files
Add AppBoxTests unit test target
- Add new unit test bundle target 'AppBoxTests' to the Xcode project - Configure test host as the AppBox application - Add sample test file (AppBoxTests/AppBoxTests.swift) - Update AppBox scheme to include the test target in Test action - Set deployment target to macOS 12.4 matching the host app Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f8c0d0f commit c64b3c2

3 files changed

Lines changed: 167 additions & 35 deletions

File tree

AppBox.xcodeproj/project.pbxproj

Lines changed: 134 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
449BD6B9282111B0008EFB2B /* AppBoxService+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 449BD6B5282111B0008EFB2B /* AppBoxService+CoreDataClass.m */; };
1414
4D3E492303A5E78B0417E17F /* ObjectiveDropboxOfficial.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 656E98171CB7E85AA663AFE8 /* ObjectiveDropboxOfficial.xcframework */; };
1515
6968AADC9DEB5554A06F19BD /* CocoaLumberjack in Frameworks */ = {isa = PBXBuildFile; productRef = 33146DD70AA7C380685E53AA /* CocoaLumberjack */; };
16+
771E1F8D4D831C50C1178A75 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09E11F809EFA1C7844F25D6B /* Cocoa.framework */; };
1617
AC4CF046F7F2B76CF56BF8E4 /* ObjectiveDropboxOfficial.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 656E98171CB7E85AA663AFE8 /* ObjectiveDropboxOfficial.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
18+
CE169D69B9BA8383673CB6A6 /* AppBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49339F0F4810664BDDE096F8 /* AppBoxTests.swift */; };
1719
DB04358B2E69628F005F0173 /* appboxcli in CopyFiles */ = {isa = PBXBuildFile; fileRef = DB0435832E696255005F0173 /* appboxcli */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
1820
DB0435912E6962EA005F0173 /* CLISupportHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = DB0435902E6962EA005F0173 /* CLISupportHelper.m */; };
1921
DB1A06622160DCB4008D33FD /* CoreDataMigration2to3.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = DB1A06612160DCB4008D33FD /* CoreDataMigration2to3.xcmappingmodel */; };
@@ -94,6 +96,16 @@
9496
F6AEC01BE879A2BB998E829D /* ZipArchive in Frameworks */ = {isa = PBXBuildFile; productRef = EFE5EA7464F3539F2562A787 /* ZipArchive */; };
9597
/* End PBXBuildFile section */
9698

99+
/* Begin PBXContainerItemProxy section */
100+
36376D9B366B3D16A6DDD659 /* PBXContainerItemProxy */ = {
101+
isa = PBXContainerItemProxy;
102+
containerPortal = E16437C71D743A4E00CE8B7E /* Project object */;
103+
proxyType = 1;
104+
remoteGlobalIDString = E16437CE1D743A4E00CE8B7E;
105+
remoteInfo = AppBox;
106+
};
107+
/* End PBXContainerItemProxy section */
108+
97109
/* Begin PBXCopyFilesBuildPhase section */
98110
DB04357E2E696172005F0173 /* CopyFiles */ = {
99111
isa = PBXCopyFilesBuildPhase;
@@ -129,6 +141,8 @@
129141
/* End PBXCopyFilesBuildPhase section */
130142

131143
/* Begin PBXFileReference section */
144+
09E11F809EFA1C7844F25D6B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
145+
410508CD3AC54858C78C571E /* AppBoxTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppBoxTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
132146
4410D18C26FF76A20046E5F9 /* DBAccountManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBAccountManager.h; sourceTree = "<group>"; };
133147
4410D18D26FF76A20046E5F9 /* DBAccountManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBAccountManager.m; sourceTree = "<group>"; };
134148
4410D19B26FF851D0046E5F9 /* CoreDataMigration3to4.xcmappingmodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcmappingmodel; path = CoreDataMigration3to4.xcmappingmodel; sourceTree = "<group>"; };
@@ -137,6 +151,7 @@
137151
449BD6B6282111B0008EFB2B /* AppBoxService+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AppBoxService+CoreDataProperties.h"; sourceTree = "<group>"; };
138152
449BD6B7282111B0008EFB2B /* AppBoxService+CoreDataClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AppBoxService+CoreDataClass.h"; sourceTree = "<group>"; };
139153
44DCC66B25EEA1910074AB1E /* AppBox4.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = AppBox4.xcdatamodel; sourceTree = "<group>"; };
154+
49339F0F4810664BDDE096F8 /* AppBoxTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AppBoxTests.swift; sourceTree = "<group>"; };
140155
656E98171CB7E85AA663AFE8 /* ObjectiveDropboxOfficial.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ObjectiveDropboxOfficial.xcframework; path = Frameworks/ObjectiveDropboxOfficial.xcframework; sourceTree = "<group>"; };
141156
DB0435832E696255005F0173 /* appboxcli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = appboxcli; sourceTree = BUILT_PRODUCTS_DIR; };
142157
DB04358F2E6962EA005F0173 /* CLISupportHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CLISupportHelper.h; sourceTree = "<group>"; };
@@ -277,7 +292,7 @@
277292
/* End PBXFileReference section */
278293

279294
/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
280-
DB04358D2E696299005F0173 /* Exceptions for "AppBoxCLI" folder in "Copy Files" phase from "AppBox" target */ = {
295+
DB04358D2E696299005F0173 /* Exceptions for "AppBoxCLI" folder in "" build phase */ = {
281296
isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;
282297
buildPhase = DB04357E2E696172005F0173 /* CopyFiles */;
283298
membershipExceptions = (
@@ -292,14 +307,22 @@
292307
DB0435842E696255005F0173 /* AppBoxCLI */ = {
293308
isa = PBXFileSystemSynchronizedRootGroup;
294309
exceptions = (
295-
DB04358D2E696299005F0173 /* Exceptions for "AppBoxCLI" folder in "Copy Files" phase from "AppBox" target */,
310+
DB04358D2E696299005F0173 /* Exceptions for "AppBoxCLI" folder in "" build phase */,
296311
);
297312
path = AppBoxCLI;
298313
sourceTree = "<group>";
299314
};
300315
/* End PBXFileSystemSynchronizedRootGroup section */
301316

302317
/* Begin PBXFrameworksBuildPhase section */
318+
39EB20B3B931736A9853F6EB /* Frameworks */ = {
319+
isa = PBXFrameworksBuildPhase;
320+
buildActionMask = 2147483647;
321+
files = (
322+
771E1F8D4D831C50C1178A75 /* Cocoa.framework in Frameworks */,
323+
);
324+
runOnlyForDeploymentPostprocessing = 0;
325+
};
303326
DB0435802E696255005F0173 /* Frameworks */ = {
304327
isa = PBXFrameworksBuildPhase;
305328
buildActionMask = 2147483647;
@@ -327,6 +350,23 @@
327350
/* End PBXFrameworksBuildPhase section */
328351

329352
/* Begin PBXGroup section */
353+
9BB2CCACA72911C65FE295AF /* OS X */ = {
354+
isa = PBXGroup;
355+
children = (
356+
09E11F809EFA1C7844F25D6B /* Cocoa.framework */,
357+
);
358+
name = "OS X";
359+
sourceTree = "<group>";
360+
};
361+
AECBA8D5D0C166DA17FF6ED0 /* AppBoxTests */ = {
362+
isa = PBXGroup;
363+
children = (
364+
49339F0F4810664BDDE096F8 /* AppBoxTests.swift */,
365+
);
366+
name = AppBoxTests;
367+
path = AppBoxTests;
368+
sourceTree = "<group>";
369+
};
330370
DB04358E2E6962DB005F0173 /* CLISupportHelper */ = {
331371
isa = PBXGroup;
332372
children = (
@@ -543,6 +583,7 @@
543583
DB0435842E696255005F0173 /* AppBoxCLI */,
544584
E164389A1D743ECA00CE8B7E /* Frameworks */,
545585
E16437D01D743A4E00CE8B7E /* Products */,
586+
AECBA8D5D0C166DA17FF6ED0 /* AppBoxTests */,
546587
);
547588
sourceTree = "<group>";
548589
};
@@ -639,6 +680,7 @@
639680
E164389F1D7469CD00CE8B7E /* AppKit.framework */,
640681
E16438981D743EAA00CE8B7E /* Cocoa.framework */,
641682
E16438961D743EA300CE8B7E /* WebKit.framework */,
683+
9BB2CCACA72911C65FE295AF /* OS X */,
642684
);
643685
name = Frameworks;
644686
sourceTree = "<group>";
@@ -879,6 +921,24 @@
879921
/* End PBXGroup section */
880922

881923
/* Begin PBXNativeTarget section */
924+
367F0DC24506E92D3530690B /* AppBoxTests */ = {
925+
isa = PBXNativeTarget;
926+
buildConfigurationList = D4BF633B2BC821379016AAC9 /* Build configuration list for PBXNativeTarget "AppBoxTests" */;
927+
buildPhases = (
928+
4A568FBC3E2A1A064341626E /* Sources */,
929+
39EB20B3B931736A9853F6EB /* Frameworks */,
930+
4D460A77BBF2E26AD7EB3B42 /* Resources */,
931+
);
932+
buildRules = (
933+
);
934+
dependencies = (
935+
6D6716FA80C807155360DE15 /* PBXTargetDependency */,
936+
);
937+
name = AppBoxTests;
938+
productName = AppBoxTests;
939+
productReference = 410508CD3AC54858C78C571E /* AppBoxTests.xctest */;
940+
productType = "com.apple.product-type.bundle.unit-test";
941+
};
882942
DB0435822E696255005F0173 /* AppBoxCLI */ = {
883943
isa = PBXNativeTarget;
884944
buildConfigurationList = DB0435872E696255005F0173 /* Build configuration list for PBXNativeTarget "AppBoxCLI" */;
@@ -935,6 +995,10 @@
935995
LastUpgradeCheck = 1410;
936996
ORGANIZATIONNAME = "Developer Insider";
937997
TargetAttributes = {
998+
367F0DC24506E92D3530690B = {
999+
CreatedOnToolsVersion = 16.4;
1000+
TestTargetID = E16437CE1D743A4E00CE8B7E;
1001+
};
9381002
DB0435822E696255005F0173 = {
9391003
CreatedOnToolsVersion = 16.4;
9401004
};
@@ -968,11 +1032,19 @@
9681032
targets = (
9691033
E16437CE1D743A4E00CE8B7E /* AppBox */,
9701034
DB0435822E696255005F0173 /* AppBoxCLI */,
1035+
367F0DC24506E92D3530690B /* AppBoxTests */,
9711036
);
9721037
};
9731038
/* End PBXProject section */
9741039

9751040
/* Begin PBXResourcesBuildPhase section */
1041+
4D460A77BBF2E26AD7EB3B42 /* Resources */ = {
1042+
isa = PBXResourcesBuildPhase;
1043+
buildActionMask = 2147483647;
1044+
files = (
1045+
);
1046+
runOnlyForDeploymentPostprocessing = 0;
1047+
};
9761048
E16437CD1D743A4E00CE8B7E /* Resources */ = {
9771049
isa = PBXResourcesBuildPhase;
9781050
buildActionMask = 2147483647;
@@ -996,6 +1068,14 @@
9961068
/* End PBXResourcesBuildPhase section */
9971069

9981070
/* Begin PBXSourcesBuildPhase section */
1071+
4A568FBC3E2A1A064341626E /* Sources */ = {
1072+
isa = PBXSourcesBuildPhase;
1073+
buildActionMask = 2147483647;
1074+
files = (
1075+
CE169D69B9BA8383673CB6A6 /* AppBoxTests.swift in Sources */,
1076+
);
1077+
runOnlyForDeploymentPostprocessing = 0;
1078+
};
9991079
DB04357F2E696255005F0173 /* Sources */ = {
10001080
isa = PBXSourcesBuildPhase;
10011081
buildActionMask = 2147483647;
@@ -1071,7 +1151,50 @@
10711151
};
10721152
/* End PBXSourcesBuildPhase section */
10731153

1154+
/* Begin PBXTargetDependency section */
1155+
6D6716FA80C807155360DE15 /* PBXTargetDependency */ = {
1156+
isa = PBXTargetDependency;
1157+
name = AppBox;
1158+
target = E16437CE1D743A4E00CE8B7E /* AppBox */;
1159+
targetProxy = 36376D9B366B3D16A6DDD659 /* PBXContainerItemProxy */;
1160+
};
1161+
/* End PBXTargetDependency section */
1162+
10741163
/* Begin XCBuildConfiguration section */
1164+
20D73489B2D59D7B20B6D742 /* Release */ = {
1165+
isa = XCBuildConfiguration;
1166+
buildSettings = {
1167+
BUNDLE_LOADER = "$(TEST_HOST)";
1168+
CODE_SIGN_STYLE = Automatic;
1169+
DEAD_CODE_STRIPPING = YES;
1170+
GENERATE_INFOPLIST_FILE = YES;
1171+
MACOSX_DEPLOYMENT_TARGET = 12.4;
1172+
PRODUCT_BUNDLE_IDENTIFIER = com.developerinsider.AppBoxTests;
1173+
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
1174+
PRODUCT_NAME = "$(TARGET_NAME)";
1175+
SDKROOT = macosx;
1176+
SWIFT_VERSION = 5.0;
1177+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AppBox.app/Contents/MacOS/AppBox";
1178+
};
1179+
name = Release;
1180+
};
1181+
8F55BF9DC84A2B7F66AE5AA2 /* Debug */ = {
1182+
isa = XCBuildConfiguration;
1183+
buildSettings = {
1184+
BUNDLE_LOADER = "$(TEST_HOST)";
1185+
CODE_SIGN_STYLE = Automatic;
1186+
DEAD_CODE_STRIPPING = YES;
1187+
GENERATE_INFOPLIST_FILE = YES;
1188+
MACOSX_DEPLOYMENT_TARGET = 12.4;
1189+
PRODUCT_BUNDLE_IDENTIFIER = com.developerinsider.AppBoxTests;
1190+
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
1191+
PRODUCT_NAME = "$(TARGET_NAME)";
1192+
SDKROOT = macosx;
1193+
SWIFT_VERSION = 5.0;
1194+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AppBox.app/Contents/MacOS/AppBox";
1195+
};
1196+
name = Debug;
1197+
};
10751198
DB0435882E696255005F0173 /* Debug */ = {
10761199
isa = XCBuildConfiguration;
10771200
buildSettings = {
@@ -1327,6 +1450,15 @@
13271450
/* End XCBuildConfiguration section */
13281451

13291452
/* Begin XCConfigurationList section */
1453+
D4BF633B2BC821379016AAC9 /* Build configuration list for PBXNativeTarget "AppBoxTests" */ = {
1454+
isa = XCConfigurationList;
1455+
buildConfigurations = (
1456+
20D73489B2D59D7B20B6D742 /* Release */,
1457+
8F55BF9DC84A2B7F66AE5AA2 /* Debug */,
1458+
);
1459+
defaultConfigurationIsVisible = 0;
1460+
defaultConfigurationName = Release;
1461+
};
13301462
DB0435872E696255005F0173 /* Build configuration list for PBXNativeTarget "AppBoxCLI" */ = {
13311463
isa = XCConfigurationList;
13321464
buildConfigurations = (

AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1610"
4-
version = "1.3">
3+
LastUpgradeVersion = "1600"
4+
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
@@ -20,6 +20,20 @@
2020
ReferencedContainer = "container:AppBox.xcodeproj">
2121
</BuildableReference>
2222
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "NO"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "NO">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "367F0DC24506E92D3530690B"
32+
BuildableName = "AppBoxTests.xctest"
33+
BlueprintName = "AppBoxTests"
34+
ReferencedContainer = "container:AppBox.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
2337
</BuildActionEntries>
2438
</BuildAction>
2539
<TestAction
@@ -37,6 +51,16 @@
3751
</BuildableReference>
3852
</MacroExpansion>
3953
<Testables>
54+
<TestableReference
55+
skipped = "NO">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "367F0DC24506E92D3530690B"
59+
BuildableName = "AppBoxTests.xctest"
60+
BlueprintName = "AppBoxTests"
61+
ReferencedContainer = "container:AppBox.xcodeproj">
62+
</BuildableReference>
63+
</TestableReference>
4064
</Testables>
4165
</TestAction>
4266
<LaunchAction
@@ -59,28 +83,6 @@
5983
ReferencedContainer = "container:AppBox.xcodeproj">
6084
</BuildableReference>
6185
</BuildableProductRunnable>
62-
<CommandLineArguments>
63-
<CommandLineArgument
64-
argument = "ipa=/Volumes/LongTime/ProjectWorking/fastlane-plugin-appbox/AppBox-Fastlane-Demo-Project/AppBox-Fastlane-Demo.ipa email=vineet.choudhary@finoit.com,vineetchoudhary@live.in message=&apos;Hello there!!&apos; keepsamelink=true"
65-
isEnabled = "NO">
66-
</CommandLineArgument>
67-
<CommandLineArgument
68-
argument = "build=/Users/vineetchoudhary/Downloads/ourValues-iOS-UAT-AppStore"
69-
isEnabled = "NO">
70-
</CommandLineArgument>
71-
<CommandLineArgument
72-
argument = "ipa=/Users/vineetchoudhary/Desktop/IPAs/Space Test/PayloadIphone10.0.ipa"
73-
isEnabled = "NO">
74-
</CommandLineArgument>
75-
<CommandLineArgument
76-
argument = "build=/Volumes/LongTime/ProjectWorking/AR"
77-
isEnabled = "NO">
78-
</CommandLineArgument>
79-
<CommandLineArgument
80-
argument = "build=/Users/vineetchoudhary/Desktop/xcode10test/xcode10appstore"
81-
isEnabled = "NO">
82-
</CommandLineArgument>
83-
</CommandLineArguments>
8486
</LaunchAction>
8587
<ProfileAction
8688
buildConfiguration = "Release"
@@ -105,14 +107,5 @@
105107
<ArchiveAction
106108
buildConfiguration = "Release"
107109
revealArchiveInOrganizer = "YES">
108-
<PostActions>
109-
<ExecutionAction
110-
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
111-
<ActionContent
112-
title = "Run Script"
113-
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;">
114-
</ActionContent>
115-
</ExecutionAction>
116-
</PostActions>
117110
</ArchiveAction>
118111
</Scheme>

AppBoxTests/AppBoxTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import XCTest
2+
3+
final class AppBoxTests: XCTestCase {
4+
func testExample() throws {
5+
XCTAssertTrue(true, "Basic test to verify the test target is configured correctly")
6+
}
7+
}

0 commit comments

Comments
 (0)