Skip to content

Commit

Permalink
Merge pull request #33 from AirHelp/feature/spm-support
Browse files Browse the repository at this point in the history
Add Swift Package Manager support
  • Loading branch information
paweldudek committed Dec 10, 2019
2 parents 9a58313 + 2c5dd2f commit a3b04eb
Show file tree
Hide file tree
Showing 40 changed files with 422 additions and 169 deletions.
326 changes: 171 additions & 155 deletions Mimus.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions Mimus.xcodeproj/xcshareddata/xcschemes/MimusExamples.xcscheme
Expand Up @@ -23,8 +23,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -36,8 +34,6 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
8 changes: 2 additions & 6 deletions Mimus.xcodeproj/xcshareddata/xcschemes/MimusTests.xcscheme
Expand Up @@ -26,8 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,8 +40,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -62,8 +60,6 @@
ReferencedContainer = "container:Mimus.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
23 changes: 23 additions & 0 deletions Package.swift
@@ -0,0 +1,23 @@
// swift-tools-version:5.1
import PackageDescription

let package = Package(
name: "Mimus",
products: [
.library(
name: "Mimus",
targets: ["Mimus"]),
],
dependencies: [],
targets: [
.target(
name: "Mimus",
dependencies: []),
.testTarget(
name: "MimusTests",
dependencies: ["Mimus"]),
.testTarget(
name: "MimusExamples",
dependencies: ["Mimus"]),
]
)
25 changes: 25 additions & 0 deletions README.md
Expand Up @@ -55,6 +55,31 @@ github "Airhelp/Mimus"

and then link it with your test target.

### Swift Package Manager

Mimus is available through [Swift Package Manager](https://swift.org/package-manager/).

- When added as a package dependency:
```
dependencies: [
.package(
url: "https://github.com/AirHelp/Mimus.git",
from: "1.1.4"
)
]
```

- When added as an Application dependency:
```
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL.
```
```
You can also navigate to your target’s General pane, and in the “Frameworks, Libraries, and Embedded Content” section, click the + button.
```
```
In the “Choose frameworks and libraries to add” dialog, select Add Other, and choose Add Package Dependency.
```

## Authors

Mimus is an AirHelp open source project, designed and implemented by
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions Tests/LinuxMain.swift
@@ -0,0 +1,10 @@
import XCTest

import MimusExamples
import MimusTests

var tests = [XCTestCaseEntry]()
tests += MimusExamples.__allTests()
tests += MimusTests.__allTests()

XCTMain(tests)
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions Tests/MimusExamples/XCTestManifests.swift
@@ -0,0 +1,22 @@
#if !canImport(ObjectiveC)
import XCTest

extension AuthenticationCoordinatorTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__AuthenticationCoordinatorTests = [
("testAnyMatcher", testAnyMatcher),
("testCaptureArgument", testCaptureArgument),
("testInstanceOf", testInstanceOf),
("testLogin", testLogin),
("testSetup", testSetup),
]
}

public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(AuthenticationCoordinatorTests.__allTests__AuthenticationCoordinatorTests),
]
}
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -128,17 +128,17 @@ class FoundationMatcherTests: XCTestCase {

func testIndexPathPassingInvocation() {
let result = matcher.match(
expected: [IndexPath(row: 42, section: 43)],
actual: [IndexPath(row: 42, section: 43)]
expected: [IndexPath(arrayLiteral: 42, 43)],
actual: [IndexPath(arrayLiteral: 42, 43)]
)
XCTAssertTrue(result.matching, "Expected index paths to match")
XCTAssertEqual(result.mismatchedComparisons.count, 0, "Expected no mismatched results")
}

func testIndexPathFailingInvocation() {
let result = matcher.match(
expected: [IndexPath(row: 42, section: 43)],
actual: [IndexPath(row: 44, section: 43)]
expected: [IndexPath(arrayLiteral: 42, 43)],
actual: [IndexPath(arrayLiteral: 44, 43)]
)
XCTAssertFalse(result.matching, "Expected index paths not to match")
}
Expand Down
File renamed without changes.
165 changes: 165 additions & 0 deletions Tests/MimusTests/XCTestManifests.swift
@@ -0,0 +1,165 @@
#if !canImport(ObjectiveC)
import XCTest

extension FoundationMatcherTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__FoundationMatcherTests = [
("testAnyInvocation", testAnyInvocation),
("testAnyNoArgumentsInvocation", testAnyNoArgumentsInvocation),
("testArrayFailingInvocation", testArrayFailingInvocation),
("testArrayPassingInvocation", testArrayPassingInvocation),
("testArrayWithComparedWithDifferentType", testArrayWithComparedWithDifferentType),
("testBoolFailingInvocation", testBoolFailingInvocation),
("testBoolPassingInvocation", testBoolPassingInvocation),
("testDictionaryComparedWithDifferentType", testDictionaryComparedWithDifferentType),
("testDictionaryFailingInvocationDifferentKeys", testDictionaryFailingInvocationDifferentKeys),
("testDictionaryFailingInvocationDifferentValues", testDictionaryFailingInvocationDifferentValues),
("testDictionaryPassingInvocation", testDictionaryPassingInvocation),
("testDictionaryWithDifferentAmountOfValues", testDictionaryWithDifferentAmountOfValues),
("testDoubleFailingInvocation", testDoubleFailingInvocation),
("testDoublePassingInvocation", testDoublePassingInvocation),
("testFailingInvocation", testFailingInvocation),
("testFloatFailingInvocation", testFloatFailingInvocation),
("testFloatPassingInvocation", testFloatPassingInvocation),
("testIncompatibleSizesArrayFailingInvocation", testIncompatibleSizesArrayFailingInvocation),
("testIncorrectTypes", testIncorrectTypes),
("testIndexPathFailingInvocation", testIndexPathFailingInvocation),
("testIndexPathPassingInvocation", testIndexPathPassingInvocation),
("testIntFailingInvocation", testIntFailingInvocation),
("testIntPassingInvocation", testIntPassingInvocation),
("testNestedArraysFailingInvocation", testNestedArraysFailingInvocation),
("testNestedArraysPassingInvocation", testNestedArraysPassingInvocation),
("testNilFailingInvocation", testNilFailingInvocation),
("testNilPassingInvocation", testNilPassingInvocation),
("testNilValues", testNilValues),
("testNoneInvocation", testNoneInvocation),
("testNoneNoArgumentsInvocation", testNoneNoArgumentsInvocation),
("testPassingInvocation", testPassingInvocation),
("testStaticStringFailingInvocation", testStaticStringFailingInvocation),
("testStaticStringPassingInvocation", testStaticStringPassingInvocation),
("testStaticStringWithStringFailingInvocation", testStaticStringWithStringFailingInvocation),
("testStaticStringWithStringPassingInvocation", testStaticStringWithStringPassingInvocation),
("testStringFailingInvocation", testStringFailingInvocation),
("testStringPassingInvocation", testStringPassingInvocation),
("testUIntFailingInvocation", testUIntFailingInvocation),
("testUIntPassingInvocation", testUIntPassingInvocation),
("testUrlCrossTypePassingInvocation", testUrlCrossTypePassingInvocation),
("testUrlFailingInvocation", testUrlFailingInvocation),
("testUrlPassingInvocation", testUrlPassingInvocation),
]
}

extension MatcherExtensionsTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__MatcherExtensionsTests = [
("testFailingMatcher", testFailingMatcher),
("testPassingMatcher", testPassingMatcher),
]
}

extension MatcherTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__MatcherTests = [
("testDataTypeFailingInvocation", testDataTypeFailingInvocation),
("testDataTypePassingInvocation", testDataTypePassingInvocation),
("testFailingInvocation", testFailingInvocation),
("testIncompatibleSizesNSArrayFailingInvocation", testIncompatibleSizesNSArrayFailingInvocation),
("testIncompatibleSizesNSDictionaryFailingInvocation", testIncompatibleSizesNSDictionaryFailingInvocation),
("testNestedNSArrayFailingInvocation", testNestedNSArrayFailingInvocation),
("testNestedNSArrayPassingInvocation", testNestedNSArrayPassingInvocation),
("testNestedNSDictionaryFailingInvocation", testNestedNSDictionaryFailingInvocation),
("testNestedNSDictionaryPassingInvocation", testNestedNSDictionaryPassingInvocation),
("testNSArrayFailingInvocation", testNSArrayFailingInvocation),
("testNSArrayPassingInvocation", testNSArrayPassingInvocation),
("testNSDictionaryFailingInvocation", testNSDictionaryFailingInvocation),
("testNSDictionaryPassingInvocation", testNSDictionaryPassingInvocation),
("testNSErrorFailingInvocation", testNSErrorFailingInvocation),
("testNSErrorPassingInvocation", testNSErrorPassingInvocation),
("testNSNumberFailingInvocation", testNSNumberFailingInvocation),
("testNSNumberPassingInvocation", testNSNumberPassingInvocation),
("testNSStringPassingInvocation", testNSStringPassingInvocation),
("testNSURLFailingInvocation", testNSURLFailingInvocation),
("testNSURLPassingInvocation", testNSURLPassingInvocation),
("testPassingInvocation", testPassingInvocation),
("testStaticStringFailingInvocation", testStaticStringFailingInvocation),
("testStaticStringWithNSStringFailingInvocation", testStaticStringWithNSStringFailingInvocation),
("testStaticStringWithNSStringPassingInvocation", testStaticStringWithNSStringPassingInvocation),
("testStringWithNSStringFailingInvocation", testStringWithNSStringFailingInvocation),
("testStringWithNSStringPassingInvocation", testStringWithNSStringPassingInvocation),
("testURLRequestFailingInvocation", testURLRequestFailingInvocation),
("testURLRequestPassingInvocation", testURLRequestPassingInvocation),
]
}

extension MismatchMessageBuilderTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__MismatchMessageBuilderTests = [
("testComparisonWithObjectsImplementingCustomStringConvertible", testComparisonWithObjectsImplementingCustomStringConvertible),
("testComparisonWithStructs", testComparisonWithStructs),
("testMultipleComparisonsInOneResult", testMultipleComparisonsInOneResult),
("testNoMatchResultsProvided", testNoMatchResultsProvided),
("testOneComparisonInMultipleResults", testOneComparisonInMultipleResults),
("testOneComparisonWithActualNil", testOneComparisonWithActualNil),
("testOneComparisonWithExpectedAndActualValues", testOneComparisonWithExpectedAndActualValues),
("testOneComparisonWithExpectedNil", testOneComparisonWithExpectedNil),
("testResultWithoutComparisons", testResultWithoutComparisons),
]
}

extension MockTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__MockTests = [
("testArrayEqual", testArrayEqual),
("testBaseVerificationMode", testBaseVerificationMode),
("testCaptureArgument", testCaptureArgument),
("testClosureFailure", testClosureFailure),
("testClosureFailureIncorrectTypeCast", testClosureFailureIncorrectTypeCast),
("testClosureShorthandSuccess", testClosureShorthandSuccess),
("testClosureSuccess", testClosureSuccess),
("testClosureSuccessWithNil", testClosureSuccessWithNil),
("testCorrectFileLocation", testCorrectFileLocation),
("testCorrectNumberOfMatches", testCorrectNumberOfMatches),
("testCorrectNumberOfMatchesWithArguments", testCorrectNumberOfMatchesWithArguments),
("testCorrectNumberOfMismatchedArguments", testCorrectNumberOfMismatchedArguments),
("testCustomVerificationMode", testCustomVerificationMode),
("testEqual", testEqual),
("testEqualFailure", testEqualFailure),
("testEqualFailureDifferentObjects", testEqualFailureDifferentObjects),
("testEqualNilObjectFailure", testEqualNilObjectFailure),
("testEqualNilObjectInMatcherFailure", testEqualNilObjectInMatcherFailure),
("testEqualNilObjects", testEqualNilObjects),
("testIdentical", testIdentical),
("testIdenticalFailure", testIdenticalFailure),
("testIdenticalFailureDifferentObject", testIdenticalFailureDifferentObject),
("testIdenticalNilObjectFailure", testIdenticalNilObjectFailure),
("testIdenticalNilObjectInMatcherFailure", testIdenticalNilObjectInMatcherFailure),
("testIdenticalNilObjects", testIdenticalNilObjects),
("testInstanceOf", testInstanceOf),
("testInstanceOfFailure", testInstanceOfFailure),
("testInstanceOfShorthand", testInstanceOfShorthand),
("testNoRecorderInvocations", testNoRecorderInvocations),
("testNotFailure", testNotFailure),
("testNotSuccess", testNotSuccess),
]
}

public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(FoundationMatcherTests.__allTests__FoundationMatcherTests),
testCase(MatcherExtensionsTests.__allTests__MatcherExtensionsTests),
testCase(MatcherTests.__allTests__MatcherTests),
testCase(MismatchMessageBuilderTests.__allTests__MismatchMessageBuilderTests),
testCase(MockTests.__allTests__MockTests),
]
}
#endif

0 comments on commit a3b04eb

Please sign in to comment.