diff --git a/Package.swift b/Package.swift index 7697984..87d8675 100644 --- a/Package.swift +++ b/Package.swift @@ -17,11 +17,11 @@ let package = Package( sources: [ "src" ], publicHeadersPath: "include", cSettings: [ - .define("OLMLIB_VERSION_MAJOR", to: String(version.major)), - .define("OLMLIB_VERSION_MINOR", to: String(version.minor)), - .define("OLMLIB_VERSION_PATCH", to: String(version.patch)), - .headerSearchPath("lib"), - .unsafeFlags([ "-Wall", "-Werror" ]) + .define("OLMLIB_VERSION_MAJOR", to: String(version.major)), + .define("OLMLIB_VERSION_MINOR", to: String(version.minor)), + .define("OLMLIB_VERSION_PATCH", to: String(version.patch)), + .headerSearchPath("lib"), + .unsafeFlags([ "-Wall", "-Werror" ]) ] ), .target( @@ -32,11 +32,19 @@ let package = Package( sources: [ "OLMKit" ], publicHeadersPath: "OLMKit", cSettings: [ - .headerSearchPath("."), - .unsafeFlags([ - "-Wno-unused-command-line-argument", - "-fmodules", "-fcxx-modules" - ]) + .headerSearchPath("."), + .unsafeFlags([ + "-Wno-unused-command-line-argument", + "-fmodules", "-fcxx-modules" + ]) + ] + ), + .testTarget( + name: "OLMKitTests", + dependencies: [ "OLMKit", "libolm" ], + path: "xcode/OLMKitTests", + cSettings: [ + .headerSearchPath(".."), ] ) ], diff --git a/xcode/OLMKitTests/OLMKitGroupTests.m b/xcode/OLMKitTests/OLMKitGroupTests.mm similarity index 96% rename from xcode/OLMKitTests/OLMKitGroupTests.m rename to xcode/OLMKitTests/OLMKitGroupTests.mm index 39ad400..66a204c 100644 --- a/xcode/OLMKitTests/OLMKitGroupTests.m +++ b/xcode/OLMKitTests/OLMKitGroupTests.mm @@ -119,16 +119,16 @@ XCTAssertEqual(messageIndex, 0); // export the keys - NSString *export = [session1 exportSessionAtMessageIndex:0 error:&error]; + NSString *cexport = [session1 exportSessionAtMessageIndex:0 error:&error]; XCTAssertNil(error); - XCTAssertGreaterThan(export.length, 0); + XCTAssertGreaterThan(cexport.length, 0); // free the old session to check there is no shared data session1 = nil; // import the keys into another inbound group session - OLMInboundGroupSession *session2 = [[OLMInboundGroupSession alloc] initInboundGroupSessionWithImportedSession:export error:&error]; + OLMInboundGroupSession *session2 = [[OLMInboundGroupSession alloc] initInboundGroupSessionWithImportedSession:cexport error:&error]; XCTAssertNil(error); XCTAssert(session2); diff --git a/xcode/OLMKitTests/OLMKitPkTests.m b/xcode/OLMKitTests/OLMKitPkTests.mm similarity index 100% rename from xcode/OLMKitTests/OLMKitPkTests.m rename to xcode/OLMKitTests/OLMKitPkTests.mm diff --git a/xcode/OLMKitTests/OLMKitSASTests.m b/xcode/OLMKitTests/OLMKitSASTests.mm similarity index 100% rename from xcode/OLMKitTests/OLMKitSASTests.m rename to xcode/OLMKitTests/OLMKitSASTests.mm diff --git a/xcode/OLMKitTests/OLMKitTests.m b/xcode/OLMKitTests/OLMKitTests.mm similarity index 100% rename from xcode/OLMKitTests/OLMKitTests.m rename to xcode/OLMKitTests/OLMKitTests.mm