Skip to content

Commit 9c35977

Browse files
committed
test: tests added
Signed-off-by: Denis Dobanda <[email protected]>
1 parent 647d8fc commit 9c35977

File tree

9 files changed

+451
-12
lines changed

9 files changed

+451
-12
lines changed

.swiftpm/xcode/xcshareddata/xcschemes/SecurityToolkit.xcscheme

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
3030
shouldUseLaunchSchemeArgsEnv = "YES"
3131
shouldAutocreateTestPlan = "YES">
32+
<Testables>
33+
<TestableReference
34+
skipped = "NO">
35+
<BuildableReference
36+
BuildableIdentifier = "primary"
37+
BlueprintIdentifier = "SecurityToolkitTests"
38+
BuildableName = "SecurityToolkitTests"
39+
BlueprintName = "SecurityToolkitTests"
40+
ReferencedContainer = "container:">
41+
</BuildableReference>
42+
</TestableReference>
43+
</Testables>
3244
</TestAction>
3345
<LaunchAction
3446
buildConfiguration = "Debug"

.swiftpm/xcode/xcshareddata/xcschemes/SecurityToolkitExample.xcscheme

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
33
LastUpgradeVersion = "1540"
4-
version = "2.2">
4+
version = "2.1">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES"
@@ -27,17 +27,47 @@
2727
buildForProfiling = "YES"
2828
buildForArchiving = "YES"
2929
buildForAnalyzing = "YES">
30-
<AutocreatedTestPlanReference>
31-
</AutocreatedTestPlanReference>
30+
<TestPlanReference
31+
reference = "container:SecurityToolkitExample/SecurityToolkitExample.xctestplan">
32+
</TestPlanReference>
3233
</BuildActionEntry>
3334
</BuildActionEntries>
3435
</BuildAction>
3536
<TestAction
3637
buildConfiguration = "Debug"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
39-
shouldUseLaunchSchemeArgsEnv = "YES"
40-
shouldAutocreateTestPlan = "YES">
40+
shouldUseLaunchSchemeArgsEnv = "YES">
41+
<TestPlans>
42+
<TestPlanReference
43+
reference = "container:SecurityToolkitExample/SecurityToolkitExample.xctestplan"
44+
default = "YES">
45+
</TestPlanReference>
46+
</TestPlans>
47+
<Testables>
48+
<TestableReference
49+
skipped = "NO"
50+
parallelizable = "YES">
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "88D9D4D32E71AB2000D85A38"
54+
BuildableName = "SecurityToolkitTests.xctest"
55+
BlueprintName = "SecurityToolkitTests"
56+
ReferencedContainer = "container:SecurityToolkitExample/SecurityToolkitExample.xcodeproj">
57+
</BuildableReference>
58+
</TestableReference>
59+
<TestableReference
60+
skipped = "NO"
61+
parallelizable = "YES">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "881894992E71B2AA00989BA6"
65+
BuildableName = "SecurityToolkitExampleTests.xctest"
66+
BlueprintName = "SecurityToolkitExampleTests"
67+
ReferencedContainer = "container:SecurityToolkitExample/SecurityToolkitExample.xcodeproj">
68+
</BuildableReference>
69+
</TestableReference>
70+
</Testables>
4171
</TestAction>
4272
<LaunchAction
4373
buildConfiguration = "Debug"

Package.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ let package = Package(
1616
targets: [
1717
.target(
1818
name: "SecurityToolkit"
19-
)
19+
),
20+
.testTarget(
21+
name: "SecurityToolkitTests",
22+
dependencies: ["SecurityToolkit"],
23+
path: "Tests"
24+
)
2025
]
2126
)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ Use Async Stream API to get detected threats asynchronously:
6767

6868
- `ThreatDetectionCenter.threats: AsyncStream<Threat>`
6969

70+
## Testing
71+
72+
To run the available tests locally or in the pipeline use `xcodebuild test -scheme SecurityToolkitTests -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.0'`
73+
7074
## Roadmap
7175

7276
Next features to be implemented:

SecurityToolkitExample/SecurityToolkitExample.xcodeproj/project.pbxproj

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 56;
6+
objectVersion = 70;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -17,9 +17,20 @@
1717
42C3DCE82C5CE54B00973681 /* RswiftLibrary in Frameworks */ = {isa = PBXBuildFile; productRef = 42C3DCE72C5CE54B00973681 /* RswiftLibrary */; };
1818
42C3DCED2C5CE6F500973681 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 42C3DCEB2C5CE6F500973681 /* Localizable.strings */; };
1919
42C3DCF52C5CEFE200973681 /* SystemImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42C3DCF42C5CEFE200973681 /* SystemImage.swift */; };
20+
881894A52E71B35A00989BA6 /* SecurityToolkitExample.xctestplan in Resources */ = {isa = PBXBuildFile; fileRef = 881894A42E71B35A00989BA6 /* SecurityToolkitExample.xctestplan */; };
2021
882CEB5F2D536FF0005D7171 /* ThreatViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882CEB5D2D536FE8005D7171 /* ThreatViewModel.swift */; };
2122
/* End PBXBuildFile section */
2223

24+
/* Begin PBXContainerItemProxy section */
25+
8818949E2E71B2AA00989BA6 /* PBXContainerItemProxy */ = {
26+
isa = PBXContainerItemProxy;
27+
containerPortal = 42B973EE2C57C4380040D9BC /* Project object */;
28+
proxyType = 1;
29+
remoteGlobalIDString = 42B973F52C57C4380040D9BC;
30+
remoteInfo = SecurityToolkitExample;
31+
};
32+
/* End PBXContainerItemProxy section */
33+
2334
/* Begin PBXFileReference section */
2435
42B973F62C57C4380040D9BC /* SecurityToolkitExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SecurityToolkitExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
2536
42B973F92C57C4380040D9BC /* SecurityToolkitExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityToolkitExampleApp.swift; sourceTree = "<group>"; };
@@ -30,9 +41,15 @@
3041
42C3DCE42C5A892D00973681 /* Dimens.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dimens.swift; sourceTree = "<group>"; };
3142
42C3DCEC2C5CE6F500973681 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
3243
42C3DCF42C5CEFE200973681 /* SystemImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemImage.swift; sourceTree = "<group>"; };
44+
8818949A2E71B2AA00989BA6 /* SecurityToolkitExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SecurityToolkitExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
45+
881894A42E71B35A00989BA6 /* SecurityToolkitExample.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = SecurityToolkitExample.xctestplan; sourceTree = "<group>"; };
3346
882CEB5D2D536FE8005D7171 /* ThreatViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreatViewModel.swift; sourceTree = "<group>"; };
3447
/* End PBXFileReference section */
3548

49+
/* Begin PBXFileSystemSynchronizedRootGroup section */
50+
8818949B2E71B2AA00989BA6 /* SecurityToolkitExampleTests */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = SecurityToolkitExampleTests; sourceTree = "<group>"; };
51+
/* End PBXFileSystemSynchronizedRootGroup section */
52+
3653
/* Begin PBXFrameworksBuildPhase section */
3754
42B973F32C57C4380040D9BC /* Frameworks */ = {
3855
isa = PBXFrameworksBuildPhase;
@@ -43,6 +60,13 @@
4360
);
4461
runOnlyForDeploymentPostprocessing = 0;
4562
};
63+
881894972E71B2AA00989BA6 /* Frameworks */ = {
64+
isa = PBXFrameworksBuildPhase;
65+
buildActionMask = 2147483647;
66+
files = (
67+
);
68+
runOnlyForDeploymentPostprocessing = 0;
69+
};
4670
/* End PBXFrameworksBuildPhase section */
4771

4872
/* Begin PBXGroup section */
@@ -56,7 +80,9 @@
5680
42B973ED2C57C4380040D9BC = {
5781
isa = PBXGroup;
5882
children = (
83+
881894A42E71B35A00989BA6 /* SecurityToolkitExample.xctestplan */,
5984
42B973F82C57C4380040D9BC /* SecurityToolkitExample */,
85+
8818949B2E71B2AA00989BA6 /* SecurityToolkitExampleTests */,
6086
42B973F72C57C4380040D9BC /* Products */,
6187
424907A82C57C6A000BC1E7A /* Frameworks */,
6288
);
@@ -66,6 +92,7 @@
6692
isa = PBXGroup;
6793
children = (
6894
42B973F62C57C4380040D9BC /* SecurityToolkitExample.app */,
95+
8818949A2E71B2AA00989BA6 /* SecurityToolkitExampleTests.xctest */,
6996
);
7097
name = Products;
7198
sourceTree = "<group>";
@@ -127,19 +154,46 @@
127154
productReference = 42B973F62C57C4380040D9BC /* SecurityToolkitExample.app */;
128155
productType = "com.apple.product-type.application";
129156
};
157+
881894992E71B2AA00989BA6 /* SecurityToolkitExampleTests */ = {
158+
isa = PBXNativeTarget;
159+
buildConfigurationList = 881894A02E71B2AA00989BA6 /* Build configuration list for PBXNativeTarget "SecurityToolkitExampleTests" */;
160+
buildPhases = (
161+
881894962E71B2AA00989BA6 /* Sources */,
162+
881894972E71B2AA00989BA6 /* Frameworks */,
163+
881894982E71B2AA00989BA6 /* Resources */,
164+
);
165+
buildRules = (
166+
);
167+
dependencies = (
168+
8818949F2E71B2AA00989BA6 /* PBXTargetDependency */,
169+
);
170+
fileSystemSynchronizedGroups = (
171+
8818949B2E71B2AA00989BA6 /* SecurityToolkitExampleTests */,
172+
);
173+
name = SecurityToolkitExampleTests;
174+
packageProductDependencies = (
175+
);
176+
productName = SecurityToolkitExampleTests;
177+
productReference = 8818949A2E71B2AA00989BA6 /* SecurityToolkitExampleTests.xctest */;
178+
productType = "com.apple.product-type.bundle.unit-test";
179+
};
130180
/* End PBXNativeTarget section */
131181

132182
/* Begin PBXProject section */
133183
42B973EE2C57C4380040D9BC /* Project object */ = {
134184
isa = PBXProject;
135185
attributes = {
136186
BuildIndependentTargetsInParallel = 1;
137-
LastSwiftUpdateCheck = 1540;
187+
LastSwiftUpdateCheck = 1620;
138188
LastUpgradeCheck = 1540;
139189
TargetAttributes = {
140190
42B973F52C57C4380040D9BC = {
141191
CreatedOnToolsVersion = 15.4;
142192
};
193+
881894992E71B2AA00989BA6 = {
194+
CreatedOnToolsVersion = 16.2;
195+
TestTargetID = 42B973F52C57C4380040D9BC;
196+
};
143197
};
144198
};
145199
buildConfigurationList = 42B973F12C57C4380040D9BC /* Build configuration list for PBXProject "SecurityToolkitExample" */;
@@ -158,6 +212,7 @@
158212
projectRoot = "";
159213
targets = (
160214
42B973F52C57C4380040D9BC /* SecurityToolkitExample */,
215+
881894992E71B2AA00989BA6 /* SecurityToolkitExampleTests */,
161216
);
162217
};
163218
/* End PBXProject section */
@@ -172,6 +227,14 @@
172227
);
173228
runOnlyForDeploymentPostprocessing = 0;
174229
};
230+
881894982E71B2AA00989BA6 /* Resources */ = {
231+
isa = PBXResourcesBuildPhase;
232+
buildActionMask = 2147483647;
233+
files = (
234+
881894A52E71B35A00989BA6 /* SecurityToolkitExample.xctestplan in Resources */,
235+
);
236+
runOnlyForDeploymentPostprocessing = 0;
237+
};
175238
/* End PBXResourcesBuildPhase section */
176239

177240
/* Begin PBXSourcesBuildPhase section */
@@ -189,13 +252,25 @@
189252
);
190253
runOnlyForDeploymentPostprocessing = 0;
191254
};
255+
881894962E71B2AA00989BA6 /* Sources */ = {
256+
isa = PBXSourcesBuildPhase;
257+
buildActionMask = 2147483647;
258+
files = (
259+
);
260+
runOnlyForDeploymentPostprocessing = 0;
261+
};
192262
/* End PBXSourcesBuildPhase section */
193263

194264
/* Begin PBXTargetDependency section */
195265
42C3DCF12C5CEAD000973681 /* PBXTargetDependency */ = {
196266
isa = PBXTargetDependency;
197267
productRef = 42C3DCF02C5CEAD000973681 /* RswiftGenerateInternalResources */;
198268
};
269+
8818949F2E71B2AA00989BA6 /* PBXTargetDependency */ = {
270+
isa = PBXTargetDependency;
271+
target = 42B973F52C57C4380040D9BC /* SecurityToolkitExample */;
272+
targetProxy = 8818949E2E71B2AA00989BA6 /* PBXContainerItemProxy */;
273+
};
199274
/* End PBXTargetDependency section */
200275

201276
/* Begin PBXVariantGroup section */
@@ -400,6 +475,45 @@
400475
};
401476
name = Release;
402477
};
478+
881894A12E71B2AA00989BA6 /* Debug */ = {
479+
isa = XCBuildConfiguration;
480+
buildSettings = {
481+
BUNDLE_LOADER = "$(TEST_HOST)";
482+
CODE_SIGN_STYLE = Automatic;
483+
CURRENT_PROJECT_VERSION = 1;
484+
GENERATE_INFOPLIST_FILE = YES;
485+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
486+
MARKETING_VERSION = 1.0;
487+
PRODUCT_BUNDLE_IDENTIFIER = com.exxeta.SecurityToolkitExampleTests;
488+
PRODUCT_NAME = "$(TARGET_NAME)";
489+
SDKROOT = iphoneos;
490+
SWIFT_EMIT_LOC_STRINGS = NO;
491+
SWIFT_VERSION = 5.0;
492+
TARGETED_DEVICE_FAMILY = "1,2";
493+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SecurityToolkitExample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/SecurityToolkitExample";
494+
};
495+
name = Debug;
496+
};
497+
881894A22E71B2AA00989BA6 /* Release */ = {
498+
isa = XCBuildConfiguration;
499+
buildSettings = {
500+
BUNDLE_LOADER = "$(TEST_HOST)";
501+
CODE_SIGN_STYLE = Automatic;
502+
CURRENT_PROJECT_VERSION = 1;
503+
GENERATE_INFOPLIST_FILE = YES;
504+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
505+
MARKETING_VERSION = 1.0;
506+
PRODUCT_BUNDLE_IDENTIFIER = com.exxeta.SecurityToolkitExampleTests;
507+
PRODUCT_NAME = "$(TARGET_NAME)";
508+
SDKROOT = iphoneos;
509+
SWIFT_EMIT_LOC_STRINGS = NO;
510+
SWIFT_VERSION = 5.0;
511+
TARGETED_DEVICE_FAMILY = "1,2";
512+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SecurityToolkitExample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/SecurityToolkitExample";
513+
VALIDATE_PRODUCT = YES;
514+
};
515+
name = Release;
516+
};
403517
/* End XCBuildConfiguration section */
404518

405519
/* Begin XCConfigurationList section */
@@ -421,6 +535,15 @@
421535
defaultConfigurationIsVisible = 0;
422536
defaultConfigurationName = Release;
423537
};
538+
881894A02E71B2AA00989BA6 /* Build configuration list for PBXNativeTarget "SecurityToolkitExampleTests" */ = {
539+
isa = XCConfigurationList;
540+
buildConfigurations = (
541+
881894A12E71B2AA00989BA6 /* Debug */,
542+
881894A22E71B2AA00989BA6 /* Release */,
543+
);
544+
defaultConfigurationIsVisible = 0;
545+
defaultConfigurationName = Release;
546+
};
424547
/* End XCConfigurationList section */
425548

426549
/* Begin XCRemoteSwiftPackageReference section */

SecurityToolkitExample/SecurityToolkitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "2A48008B-945B-4FC4-B949-3BD5FEAAF6CF",
5+
"name" : "Configuration 1",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
13+
},
14+
"testTargets" : [
15+
{
16+
"target" : {
17+
"containerPath" : "container:SecurityToolkitExample\/SecurityToolkitExample.xcodeproj",
18+
"identifier" : "881894992E71B2AA00989BA6",
19+
"name" : "SecurityToolkitExampleTests"
20+
}
21+
}
22+
],
23+
"version" : 1
24+
}

0 commit comments

Comments
 (0)