Skip to content

Commit

Permalink
Upgrade to Swift 5.1 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored and stephencelis committed Dec 6, 2019
1 parent 07aaa93 commit 7e3076f
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
macos:
xcode: "10.2.0"
xcode: "11.2.1"

steps:
- checkout
Expand Down
16 changes: 0 additions & 16 deletions .sourcery-templates/LinuxMain.stencil

This file was deleted.

2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-10-a
5.1.2
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM norionomura/swift:swift-5.0-branch
FROM swift:5.1

WORKDIR /package

Expand Down
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
imports = \
@testable import TaggedTests;

xcodeproj:
PF_DEVELOP=1 swift run xcodegen

linux-main:
sourcery \
--sources ./Tests/ \
--templates ./.sourcery-templates/ \
--output ./Tests/ \
--args testimports='$(imports)' \
&& mv ./Tests/LinuxMain.generated.swift ./Tests/LinuxMain.swift
swift test --generate-linuxmain

test-linux: linux-main
docker build --tag tagged-testing . \
Expand All @@ -28,7 +20,7 @@ test-ios:
set -o pipefail && \
xcodebuild test \
-scheme Tagged_iOS \
-destination platform="iOS Simulator,name=iPhone XR,OS=12.2" \
-destination platform="iOS Simulator,name=iPhone 11 Pro Max,OS=13.2.2" \
| xcpretty

test-swift:
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.2
// swift-tools-version:5.1
import Foundation
import PackageDescription

Expand All @@ -20,8 +20,8 @@ var package = Package(
.testTarget(name: "TaggedTimeTests", dependencies: ["TaggedTime"]),
],
swiftLanguageVersions: [
.version("5"),
.v4_2,
.v5
]
)

Expand Down
37 changes: 9 additions & 28 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
// Generated using Sourcery 0.10.1 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import XCTest

@testable import TaggedTests;
extension TaggedTests {
static var allTests: [(String, (TaggedTests) -> () throws -> Void)] = [
("testCustomStringConvertible", testCustomStringConvertible),
("testComparable", testComparable),
("testDecodable", testDecodable),
("testEncodable", testEncodable),
("testEquatable", testEquatable),
("testError", testError),
("testLocalizedError", testLocalizedError),
("testExpressibleByBooleanLiteral", testExpressibleByBooleanLiteral),
("testExpressibleByFloatLiteral", testExpressibleByFloatLiteral),
("testExpressibleByIntegerLiteral", testExpressibleByIntegerLiteral),
("testExpressibleByStringLiteral", testExpressibleByStringLiteral),
("testLosslessStringConvertible", testLosslessStringConvertible),
("testNumeric", testNumeric),
("testHashable", testHashable),
("testSignedNumeric", testSignedNumeric)
]
}
import TaggedMoneyTests
import TaggedTests
import TaggedTimeTests

var tests = [XCTestCaseEntry]()
tests += TaggedMoneyTests.__allTests()
tests += TaggedTests.__allTests()
tests += TaggedTimeTests.__allTests()

// swiftlint:disable trailing_comma
XCTMain([
testCase(TaggedTests.allTests),
])
// swiftlint:enable trailing_comma
XCTMain(tests)
19 changes: 19 additions & 0 deletions Tests/TaggedMoneyTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#if !canImport(ObjectiveC)
import XCTest

extension TaggedTimeTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__TaggedTimeTests = [
("testCentsToDollars", testCentsToDollars),
("testDollarsToCents", testDollarsToCents),
]
}

public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(TaggedTimeTests.__allTests__TaggedTimeTests),
]
}
#endif
38 changes: 38 additions & 0 deletions Tests/TaggedTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#if !canImport(ObjectiveC)
import XCTest

extension TaggedTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__TaggedTests = [
("testCoerce", testCoerce),
("testComparable", testComparable),
("testCustomStringConvertible", testCustomStringConvertible),
("testDecodable", testDecodable),
("testDecodableCustomDates", testDecodableCustomDates),
("testEncodable", testEncodable),
("testEncodableCustomDates", testEncodableCustomDates),
("testEquatable", testEquatable),
("testError", testError),
("testExpressibleByBooleanLiteral", testExpressibleByBooleanLiteral),
("testExpressibleByFloatLiteral", testExpressibleByFloatLiteral),
("testExpressibleByIntegerLiteral", testExpressibleByIntegerLiteral),
("testExpressibleByStringLiteral", testExpressibleByStringLiteral),
("testHashable", testHashable),
("testLocalizedError", testLocalizedError),
("testLosslessStringConvertible", testLosslessStringConvertible),
("testMap", testMap),
("testNumeric", testNumeric),
("testOptionalRawTypeAndNilValueDecodesCorrectly", testOptionalRawTypeAndNilValueDecodesCorrectly),
("testOptionalRawTypeAndNilValueEncodesCorrectly", testOptionalRawTypeAndNilValueEncodesCorrectly),
("testSignedNumeric", testSignedNumeric),
]
}

public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(TaggedTests.__allTests__TaggedTests),
]
}
#endif
25 changes: 25 additions & 0 deletions Tests/TaggedTimeTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#if !canImport(ObjectiveC)
import XCTest

extension TaggedTimeTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__TaggedTimeTests = [
("testDate", testDate),
("testLossyMillisecondsToSeconds", testLossyMillisecondsToSeconds),
("testMillisecondsSince", testMillisecondsSince),
("testMillisecondsToDate", testMillisecondsToDate),
("testMillisecondsToSeconds", testMillisecondsToSeconds),
("testMillisecondsToTimeInterval", testMillisecondsToTimeInterval),
("testSecondsSince", testSecondsSince),
("testSecondsToMilliseconds", testSecondsToMilliseconds),
]
}

public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(TaggedTimeTests.__allTests__TaggedTimeTests),
]
}
#endif

0 comments on commit 7e3076f

Please sign in to comment.