Skip to content

Commit f940006

Browse files
Improve Test Coverage (#10)
1 parent 77666f5 commit f940006

File tree

4 files changed

+163
-7
lines changed

4 files changed

+163
-7
lines changed

.swiftlint.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ only_rules:
141141
- implicitly_unwrapped_optional
142142
# Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status
143143
- inclusive_language
144-
# If defer is at the end of its parent scope, it will be executed right where it is anyway.
145-
- inert_defer
146144
# Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty.
147145
- is_disjoint
148146
# Discouraged explicit usage of the default separator.
@@ -329,8 +327,6 @@ only_rules:
329327
- unowned_variable_capture
330328
# Catch statements should not declare error variables without type casting.
331329
- untyped_error_in_catch
332-
# Unused reference in a capture list should be removed.
333-
- unused_capture_list
334330
# Unused parameter in a closure should be replaced with _.
335331
- unused_closure_parameter
336332
# Unused control flow label should be removed.
@@ -371,16 +367,18 @@ only_rules:
371367
# The variable should be placed on the left, the constant on the right of a comparison operator.
372368
- yoda_condition
373369

370+
attributes:
371+
attributes_with_arguments_always_on_line_above: false
372+
374373
deployment_target: # Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.
375374
iOSApplicationExtension_deployment_target: 16.0
376375
iOS_deployment_target: 16.0
377376

378-
attributes:
379-
attributes_with_arguments_always_on_line_above: false
380-
381377
excluded: # paths to ignore during linting. Takes precedence over `included`.
382378
- .build
383379
- .swiftpm
380+
- .deriveddata
381+
- Tests/UITests/.deriveddata
384382

385383
closure_body_length: # Closure bodies should not span too many lines.
386384
- 35 # warning - default: 20

Tests/UITests/TestApp.xctestplan

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
}
1010
],
1111
"defaultOptions" : {
12+
"codeCoverage" : {
13+
"targets" : [
14+
{
15+
"containerPath" : "container:..\/..",
16+
"identifier" : "SpeziLocalStorage",
17+
"name" : "SpeziLocalStorage"
18+
},
19+
{
20+
"containerPath" : "container:..\/..",
21+
"identifier" : "SpeziSecureStorage",
22+
"name" : "SpeziSecureStorage"
23+
}
24+
]
25+
},
1226
"targetForVariableExpansion" : {
1327
"containerPath" : "container:UITests.xcodeproj",
1428
"identifier" : "2F6D139128F5F384007C25D6",

Tests/UITests/UITests.xcodeproj/project.pbxproj

+22
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
2F6D138E28F5F384007C25D6 /* Sources */,
149149
2F6D138F28F5F384007C25D6 /* Frameworks */,
150150
2F6D139028F5F384007C25D6 /* Resources */,
151+
2F7CC6072A79D80300F42D90 /* ShellScript */,
151152
);
152153
buildRules = (
153154
);
@@ -243,6 +244,27 @@
243244
};
244245
/* End PBXResourcesBuildPhase section */
245246

247+
/* Begin PBXShellScriptBuildPhase section */
248+
2F7CC6072A79D80300F42D90 /* ShellScript */ = {
249+
isa = PBXShellScriptBuildPhase;
250+
alwaysOutOfDate = 1;
251+
buildActionMask = 2147483647;
252+
files = (
253+
);
254+
inputFileListPaths = (
255+
);
256+
inputPaths = (
257+
);
258+
outputFileListPaths = (
259+
);
260+
outputPaths = (
261+
);
262+
runOnlyForDeploymentPostprocessing = 0;
263+
shellPath = /bin/sh;
264+
shellScript = "if [ \"${CONFIGURATION}\" = \"Debug\" ]; then\n export PATH=\"$PATH:/opt/homebrew/bin\"\n if which swiftlint > /dev/null; then\n cd ../../ && swiftlint\n else\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\n fi\nfi\n";
265+
};
266+
/* End PBXShellScriptBuildPhase section */
267+
246268
/* Begin PBXSourcesBuildPhase section */
247269
2F6D138E28F5F384007C25D6 /* Sources */ = {
248270
isa = PBXSourcesBuildPhase;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1500"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "NO"
12+
buildForProfiling = "NO"
13+
buildForArchiving = "NO"
14+
buildForAnalyzing = "NO">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "SpeziSecureStorage"
18+
BuildableName = "SpeziSecureStorage"
19+
BlueprintName = "SpeziSecureStorage"
20+
ReferencedContainer = "container:../..">
21+
</BuildableReference>
22+
</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 = "SpeziLocalStorage"
32+
BuildableName = "SpeziLocalStorage"
33+
BlueprintName = "SpeziLocalStorage"
34+
ReferencedContainer = "container:../..">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "YES"
41+
buildForArchiving = "YES"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
46+
BuildableName = "TestApp.app"
47+
BlueprintName = "TestApp"
48+
ReferencedContainer = "container:UITests.xcodeproj">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
</BuildActionEntries>
52+
</BuildAction>
53+
<TestAction
54+
buildConfiguration = "Test"
55+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57+
shouldUseLaunchSchemeArgsEnv = "YES">
58+
<TestPlans>
59+
<TestPlanReference
60+
reference = "container:TestApp.xctestplan">
61+
</TestPlanReference>
62+
</TestPlans>
63+
<Testables>
64+
<TestableReference
65+
skipped = "NO"
66+
parallelizable = "YES">
67+
<BuildableReference
68+
BuildableIdentifier = "primary"
69+
BlueprintIdentifier = "2F6D13AB28F5F386007C25D6"
70+
BuildableName = "TestAppUITests.xctest"
71+
BlueprintName = "TestAppUITests"
72+
ReferencedContainer = "container:UITests.xcodeproj">
73+
</BuildableReference>
74+
</TestableReference>
75+
</Testables>
76+
</TestAction>
77+
<LaunchAction
78+
buildConfiguration = "Debug"
79+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
80+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
81+
launchStyle = "0"
82+
useCustomWorkingDirectory = "NO"
83+
ignoresPersistentStateOnLaunch = "NO"
84+
debugDocumentVersioning = "YES"
85+
debugServiceExtension = "internal"
86+
allowLocationSimulation = "YES">
87+
<BuildableProductRunnable
88+
runnableDebuggingMode = "0">
89+
<BuildableReference
90+
BuildableIdentifier = "primary"
91+
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
92+
BuildableName = "TestApp.app"
93+
BlueprintName = "TestApp"
94+
ReferencedContainer = "container:UITests.xcodeproj">
95+
</BuildableReference>
96+
</BuildableProductRunnable>
97+
</LaunchAction>
98+
<ProfileAction
99+
buildConfiguration = "Release"
100+
shouldUseLaunchSchemeArgsEnv = "YES"
101+
savedToolIdentifier = ""
102+
useCustomWorkingDirectory = "NO"
103+
debugDocumentVersioning = "YES">
104+
<BuildableProductRunnable
105+
runnableDebuggingMode = "0">
106+
<BuildableReference
107+
BuildableIdentifier = "primary"
108+
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
109+
BuildableName = "TestApp.app"
110+
BlueprintName = "TestApp"
111+
ReferencedContainer = "container:UITests.xcodeproj">
112+
</BuildableReference>
113+
</BuildableProductRunnable>
114+
</ProfileAction>
115+
<AnalyzeAction
116+
buildConfiguration = "Debug">
117+
</AnalyzeAction>
118+
<ArchiveAction
119+
buildConfiguration = "Release"
120+
revealArchiveInOrganizer = "YES">
121+
</ArchiveAction>
122+
</Scheme>

0 commit comments

Comments
 (0)