diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e44689..a85df60 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2 jobs: build: macos: - xcode: "10.2.0" + xcode: "11.2.1" steps: - checkout diff --git a/.sourcery-templates/LinuxMain.stencil b/.sourcery-templates/LinuxMain.stencil deleted file mode 100644 index 9701fc5..0000000 --- a/.sourcery-templates/LinuxMain.stencil +++ /dev/null @@ -1,16 +0,0 @@ -import XCTest - -{{ argument.testimports }} -{% for type in types.classes|based:"XCTestCase" %} -{% if not type.annotations.disableTests %}extension {{ type.name }} { - static var allTests: [(String, ({{ type.name }}) -> () throws -> Void)] = [ - {% for method in type.methods %}{% if method.parameters.count == 0 and method.shortName|hasPrefix:"test" %} ("{{ method.shortName }}", {{ method.shortName }}){% if not forloop.last %},{% endif %} - {% endif %}{% endfor %}] -} -{% endif %}{% endfor %} - -// swiftlint:disable trailing_comma -XCTMain([ -{% for type in types.classes|based:"XCTestCase" %}{% if not type.annotations.disableTests %} testCase({{ type.name }}.allTests), -{% endif %}{% endfor %}]) -// swiftlint:enable trailing_comma diff --git a/.swift-version b/.swift-version index 84702b3..61fcc87 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-10-a +5.1.2 diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Dockerfile b/Dockerfile index ca0a778..2166946 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM norionomura/swift:swift-5.0-branch +FROM swift:5.1 WORKDIR /package diff --git a/Makefile b/Makefile index 82b048b..c7f9585 100644 --- a/Makefile +++ b/Makefile @@ -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 . \ @@ -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: diff --git a/Package.swift b/Package.swift index 1e5a791..79fc51c 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:4.2 +// swift-tools-version:5.1 import Foundation import PackageDescription @@ -20,8 +20,8 @@ var package = Package( .testTarget(name: "TaggedTimeTests", dependencies: ["TaggedTime"]), ], swiftLanguageVersions: [ - .version("5"), .v4_2, + .v5 ] ) diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index a1429a9..85207dd 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -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) diff --git a/Tests/TaggedMoneyTests/XCTestManifests.swift b/Tests/TaggedMoneyTests/XCTestManifests.swift new file mode 100644 index 0000000..f62c91c --- /dev/null +++ b/Tests/TaggedMoneyTests/XCTestManifests.swift @@ -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 diff --git a/Tests/TaggedTests/XCTestManifests.swift b/Tests/TaggedTests/XCTestManifests.swift new file mode 100644 index 0000000..b0fe485 --- /dev/null +++ b/Tests/TaggedTests/XCTestManifests.swift @@ -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 diff --git a/Tests/TaggedTimeTests/XCTestManifests.swift b/Tests/TaggedTimeTests/XCTestManifests.swift new file mode 100644 index 0000000..01f7e45 --- /dev/null +++ b/Tests/TaggedTimeTests/XCTestManifests.swift @@ -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