Skip to content

Commit

Permalink
Make all Swift PM tests succeed
Browse files Browse the repository at this point in the history
  • Loading branch information
karimhm committed Dec 30, 2020
1 parent 6a2fca0 commit ad0d8eb
Show file tree
Hide file tree
Showing 4 changed files with 245 additions and 193 deletions.
157 changes: 157 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/XMPPFramework-Package.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFramework_XMPPFramework"
BuildableName = "XMPPFramework_XMPPFramework"
BlueprintName = "XMPPFramework_XMPPFramework"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFramework"
BuildableName = "XMPPFramework"
BlueprintName = "XMPPFramework"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFrameworkSwift"
BuildableName = "XMPPFrameworkSwift"
BlueprintName = "XMPPFrameworkSwift"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFrameworkSwiftTests"
BuildableName = "XMPPFrameworkSwiftTests"
BlueprintName = "XMPPFrameworkSwiftTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFrameworkTests"
BuildableName = "XMPPFrameworkTests"
BlueprintName = "XMPPFrameworkTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFrameworkTestsShared"
BuildableName = "XMPPFrameworkTestsShared"
BlueprintName = "XMPPFrameworkTestsShared"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFrameworkSwiftTests"
BuildableName = "XMPPFrameworkSwiftTests"
BlueprintName = "XMPPFrameworkSwiftTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFrameworkTests"
BuildableName = "XMPPFrameworkTests"
BlueprintName = "XMPPFrameworkTests"
ReferencedContainer = "container:">
</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">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XMPPFramework_XMPPFramework"
BuildableName = "XMPPFramework_XMPPFramework"
BlueprintName = "XMPPFramework_XMPPFramework"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ language: objective-c
jobs:
include:
- stage: Swift PM
osx_image: xcode12u
osx_image: xcode12.2
script:
# Build the project using Swift PM
- swift build
# Test the project using Swift PM
- swift test
# Remove the Xcode project so `xcodebuild` would be able to test the Swift PM project.
- rm -rf *.xcodeproj
# Test the Swift PM project using `xcodebuild`.
# The test is performed using `xcodebuild` rather than `swift test` due to this bug:
# https://bugs.swift.org/browse/SR-13560
- xcodebuild -scheme SPM_XMPPFramework-Package -destination "name=iPhone 11 Pro" test

- stage: Xcode Tests
osx_image: xcode9.3
Expand Down
87 changes: 81 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// swift-tools-version:5.2
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "XMPPFramework",
defaultLocalization: "en",
platforms: [
.macOS(.v10_10),
.iOS(.v8),
.iOS(.v9),
.tvOS(.v9)
],
products: [
Expand Down Expand Up @@ -37,6 +38,22 @@ let package = Package(
exclude: [
"Swift",
"Xcode",
"README.md",
"copying.txt",
"Cartfile.resolved",
"xmppframework.png",
"Cartfile",
"Core/Info.plist",
"XMPPFramework.podspec"
],
resources: [
.process("Extensions/Roster/CoreDataStorage/XMPPRoster.xcdatamodel"),
.process("Extensions/XEP-0045/CoreDataStorage/XMPPRoom.xcdatamodeld"),
.process("Extensions/XEP-0045/HybridStorage/XMPPRoomHybrid.xcdatamodeld"),
.process("Extensions/XEP-0054/CoreDataStorage/XMPPvCard.xcdatamodeld"),
.process("Extensions/XEP-0115/CoreDataStorage/XMPPCapabilities.xcdatamodel"),
.process("Extensions/XEP-0136/CoreDataStorage/XMPPMessageArchiving.xcdatamodeld"),
.process("Extensions/XMPPMUCLight/CoreDataStorage/XMPPRoomLight.xcdatamodel")
],
publicHeadersPath: "include/XMPPFramework",
linkerSettings: [
Expand All @@ -50,14 +67,45 @@ let package = Package(
"XMPPFramework",
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack")
],
path: "Swift"
path: "Swift",
exclude: [
"XMPPFrameworkSwift-Info.plist",
"XMPPFrameworkSwift.h"
]
),
.target(
name: "XMPPFrameworkTestsShared",
dependencies: [
"XMPPFramework"
],
path: "Xcode/Testing-Shared",
exclude: [
"Info.plist",
"XMPPvCardTests.m",
"XMPPStanzaIdTests.swift",
"OMEMOServerTests.m",
"XMPPDelayedDeliveryTests.m",
"XMPPMessageDeliveryReceiptsTests.m",
"XMPPHTTPFileUploadTests.m",
"XMPPRoomLightTests.m",
"OMEMOModuleTests.m",
"XMPPPushTests.swift",
"EncodeDecodeTest.m",
"XMPPOutOfBandResourceMessagingTests.m",
"XMPPRoomLightCoreDataStorageTests.m",
"XMPPMessageArchiveManagementTests.m",
"CapabilitiesHashingTest.m",
"XMPPMUCLightTests.m",
"OMEMOElementTests.m",
"XMPPURITests.m",
"XMPPSwift.swift",
"XMPPBookmarksTests.swift",
"XMPPOneToOneChatTests.m",
"OMEMOTestStorage.m",
"XMPPManagedMessagingTests.m",
"XMPPStorageHintTests.m",
"XMPPPubSubTests.m"
],
sources: [
"XMPPMockStream.m"
],
Expand All @@ -71,9 +119,8 @@ let package = Package(
],
path: "Xcode/Testing-Shared",
exclude: [
"Info.plist",
"XMPPMockStream.m",
"XMPPvCardTests.m",
"XMPPRoomLightCoreDataStorageTests.m",
"XMPPBookmarksTests.swift",
"XMPPPushTests.swift",
"XMPPStanzaIdTests.swift",
Expand All @@ -89,7 +136,35 @@ let package = Package(
],
path: "Xcode",
exclude: [
"XMPPFrameworkTests-Bridging-Header.h"
"Gemfile",
"Gemfile.lock",
"Examples",
"Testing-Carthage",
"Testing-iOS",
"Testing-macOS",
"Testing-Shared/OMEMOTestStorage.m",
"Testing-Shared/Info.plist",
"Testing-Shared/XMPPManagedMessagingTests.m",
"Testing-Shared/XMPPMessageArchiveManagementTests.m",
"Testing-Shared/XMPPOutOfBandResourceMessagingTests.m",
"Testing-Shared/XMPPRoomLightCoreDataStorageTests.m",
"Testing-Shared/XMPPRoomLightTests.m",
"Testing-Shared/XMPPMessageDeliveryReceiptsTests.m",
"Testing-Shared/OMEMOServerTests.m",
"Testing-Shared/CapabilitiesHashingTest.m",
"Testing-Shared/XMPPOneToOneChatTests.m",
"Testing-Shared/XMPPDelayedDeliveryTests.m",
"Testing-Shared/XMPPMockStream.m",
"Testing-Shared/XMPPPubSubTests.m",
"Testing-Shared/XMPPHTTPFileUploadTests.m",
"Testing-Shared/XMPPvCardTests.m",
"Testing-Shared/OMEMOElementTests.m",
"Testing-Shared/OMEMOModuleTests.m",
"Testing-Shared/EncodeDecodeTest.m",
"Testing-Shared/XMPPStorageHintTests.m",
"Testing-Shared/XMPPURITests.m",
"Testing-Shared/XMPPMUCLightTests.m",
"Testing-Shared/XMPPFrameworkTests-Bridging-Header.h"
],
sources: [
"Testing-Shared/XMPPBookmarksTests.swift",
Expand Down
Loading

0 comments on commit ad0d8eb

Please sign in to comment.