Skip to content

Commit

Permalink
Allow to run tests in OiAPS
Browse files Browse the repository at this point in the history
Change the config to allow to run OiAPS tests and submodules.
Add a fileStorage test for OiAPS

(cherry picked from commit 8a4739f)
  • Loading branch information
avouspierre authored and bjornoleh committed Mar 23, 2024
1 parent b8f68ee commit 40c19b7
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 6 deletions.
4 changes: 2 additions & 2 deletions FreeAPS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3175,7 +3175,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "$(DEVELOPER_TEAM)";
INFOPLIST_FILE = FreeAPSTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -3196,7 +3196,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "$(DEVELOPER_TEAM)";
INFOPLIST_FILE = FreeAPSTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
86 changes: 83 additions & 3 deletions FreeAPS.xcodeproj/xcshareddata/xcschemes/FreeAPS X.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -248,6 +248,86 @@
ReferencedContainer = "container:FreeAPS.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "43CABDFC1C3506F100005705"
BuildableName = "CGMBLEKitTests.xctest"
BlueprintName = "CGMBLEKitTests"
ReferencedContainer = "container:CGMBLEKit/CGMBLEKit.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C17F50CD291EAC3800555EB5"
BuildableName = "G7SensorKitTests.xctest"
BlueprintName = "G7SensorKitTests"
ReferencedContainer = "container:G7SensorKit/G7SensorKit.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "43D8FDD41C728FDF0073BE78"
BuildableName = "LoopKitTests.xctest"
BlueprintName = "LoopKitTests"
ReferencedContainer = "container:LoopKit/LoopKit.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B4CEE2DF257129780093111B"
BuildableName = "MockKitTests.xctest"
BlueprintName = "MockKitTests"
ReferencedContainer = "container:LoopKit/LoopKit.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C13CC34029C7B73A007F25DE"
BuildableName = "MinimedKitTests.xctest"
BlueprintName = "MinimedKitTests"
ReferencedContainer = "container:MinimedKit/MinimedKit.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84752E8A26ED0FFE009FD801"
BuildableName = "OmniBLETests.xctest"
BlueprintName = "OmniBLETests"
ReferencedContainer = "container:OmniBLE/OmniBLE.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C12ED9C929C7DBA900435701"
BuildableName = "OmniKitTests.xctest"
BlueprintName = "OmniKitTests"
ReferencedContainer = "container:OmniKit/OmniKit.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "431CE7761F98564200255374"
BuildableName = "RileyLinkBLEKitTests.xctest"
BlueprintName = "RileyLinkBLEKitTests"
ReferencedContainer = "container:RileyLinkKit/RileyLinkKit.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
9 changes: 8 additions & 1 deletion FreeAPSTests/FileStorageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import XCTest
class FileStorageTests: XCTestCase {
let fileStorage = BaseFileStorage()

struct DummyObject: JSON {
struct DummyObject: JSON, Equatable {
let id: String
let value: Decimal
}

func testFileStorageOiAPS() {
let dummyObject = DummyObject(id: "21342Z", value: 78.2)
fileStorage.save(dummyObject, as: "dummyObject")
let dummyObjectRetrieve = fileStorage.retrieve("dummyObject", as: DummyObject.self)
XCTAssertTrue(dummyObject == dummyObjectRetrieve)
}

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
Expand Down

0 comments on commit 40c19b7

Please sign in to comment.