Skip to content

Commit

Permalink
Improve Test Coverage (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer authored Aug 2, 2023
1 parent 77666f5 commit f940006
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ only_rules:
- implicitly_unwrapped_optional
# Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status
- inclusive_language
# If defer is at the end of its parent scope, it will be executed right where it is anyway.
- inert_defer
# Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty.
- is_disjoint
# Discouraged explicit usage of the default separator.
Expand Down Expand Up @@ -329,8 +327,6 @@ only_rules:
- unowned_variable_capture
# Catch statements should not declare error variables without type casting.
- untyped_error_in_catch
# Unused reference in a capture list should be removed.
- unused_capture_list
# Unused parameter in a closure should be replaced with _.
- unused_closure_parameter
# Unused control flow label should be removed.
Expand Down Expand Up @@ -371,16 +367,18 @@ only_rules:
# The variable should be placed on the left, the constant on the right of a comparison operator.
- yoda_condition

attributes:
attributes_with_arguments_always_on_line_above: false

deployment_target: # Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.
iOSApplicationExtension_deployment_target: 16.0
iOS_deployment_target: 16.0

attributes:
attributes_with_arguments_always_on_line_above: false

excluded: # paths to ignore during linting. Takes precedence over `included`.
- .build
- .swiftpm
- .deriveddata
- Tests/UITests/.deriveddata

closure_body_length: # Closure bodies should not span too many lines.
- 35 # warning - default: 20
Expand Down
14 changes: 14 additions & 0 deletions Tests/UITests/TestApp.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
}
],
"defaultOptions" : {
"codeCoverage" : {
"targets" : [
{
"containerPath" : "container:..\/..",
"identifier" : "SpeziLocalStorage",
"name" : "SpeziLocalStorage"
},
{
"containerPath" : "container:..\/..",
"identifier" : "SpeziSecureStorage",
"name" : "SpeziSecureStorage"
}
]
},
"targetForVariableExpansion" : {
"containerPath" : "container:UITests.xcodeproj",
"identifier" : "2F6D139128F5F384007C25D6",
Expand Down
22 changes: 22 additions & 0 deletions Tests/UITests/UITests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
2F6D138E28F5F384007C25D6 /* Sources */,
2F6D138F28F5F384007C25D6 /* Frameworks */,
2F6D139028F5F384007C25D6 /* Resources */,
2F7CC6072A79D80300F42D90 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -243,6 +244,27 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
2F7CC6072A79D80300F42D90 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
2F6D138E28F5F384007C25D6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SpeziSecureStorage"
BuildableName = "SpeziSecureStorage"
BlueprintName = "SpeziSecureStorage"
ReferencedContainer = "container:../..">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SpeziLocalStorage"
BuildableName = "SpeziLocalStorage"
BlueprintName = "SpeziLocalStorage"
ReferencedContainer = "container:../..">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
BuildableName = "TestApp.app"
BlueprintName = "TestApp"
ReferencedContainer = "container:UITests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Test"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:TestApp.xctestplan">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F6D13AB28F5F386007C25D6"
BuildableName = "TestAppUITests.xctest"
BlueprintName = "TestAppUITests"
ReferencedContainer = "container:UITests.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
BuildableName = "TestApp.app"
BlueprintName = "TestApp"
ReferencedContainer = "container:UITests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
BuildableName = "TestApp.app"
BlueprintName = "TestApp"
ReferencedContainer = "container:UITests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

0 comments on commit f940006

Please sign in to comment.