Skip to content

Commit 7f87f19

Browse files
authored
Update the project to Swift 5.4 (#125)
* Update the project to Swift 5.4 - Splash now uses the Swift 5.4 toolchain. - Since Swift 5.4 now enables automatic test discovery on all supported platforms, all of the infrastructure that was previously used to maintain Linux unit testing compatibility has now been removed. * Remove LinuxMain.swift
1 parent 4df8c3e commit 7f87f19

20 files changed

+9
-431
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.4
22

33
/**
44
* Splash
@@ -19,19 +19,19 @@ let package = Package(
1919
],
2020
targets: [
2121
.target(name: "Splash"),
22-
.target(
22+
.executableTarget(
2323
name: "SplashMarkdown",
2424
dependencies: ["Splash"]
2525
),
26-
.target(
26+
.executableTarget(
2727
name: "SplashHTMLGen",
2828
dependencies: ["Splash"]
2929
),
30-
.target(
30+
.executableTarget(
3131
name: "SplashImageGen",
3232
dependencies: ["Splash"]
3333
),
34-
.target(
34+
.executableTarget(
3535
name: "SplashTokenizer",
3636
dependencies: ["Splash"]
3737
),

Tests/LinuxMain.swift

Lines changed: 0 additions & 12 deletions
This file was deleted.

Tests/SplashTests/Core/SplashTestCase.swift

Lines changed: 0 additions & 28 deletions
This file was deleted.

Tests/SplashTests/Core/SyntaxHighlighterTestCase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Splash
1010

1111
/// Test case used as an abstract base class for all tests relating to
1212
/// syntax highlighting. For all such tests, the Swift grammar is used.
13-
class SyntaxHighlighterTestCase: SplashTestCase {
13+
class SyntaxHighlighterTestCase: XCTestCase {
1414
private(set) var highlighter: SyntaxHighlighter<OutputFormatMock>!
1515
private(set) var builder: OutputBuilderMock!
1616

Tests/SplashTests/Core/TestCaseVerifier.swift

Lines changed: 0 additions & 37 deletions
This file was deleted.

Tests/SplashTests/Core/TestClosure.swift

Lines changed: 0 additions & 10 deletions
This file was deleted.

Tests/SplashTests/Core/XCTestCase+TestNames.swift

Lines changed: 0 additions & 21 deletions
This file was deleted.

Tests/SplashTests/Core/XCTestManifests.swift

Lines changed: 0 additions & 26 deletions
This file was deleted.

Tests/SplashTests/Tests/ClosureTests.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -259,28 +259,4 @@ final class ClosureTests: SyntaxHighlighterTestCase {
259259
.plainText("}")
260260
])
261261
}
262-
263-
func testAllTestsRunOnLinux() {
264-
XCTAssertTrue(TestCaseVerifier.verifyLinuxTests((type(of: self)).allTests))
265-
}
266-
}
267-
268-
extension ClosureTests {
269-
static var allTests: [(String, TestClosure<ClosureTests>)] {
270-
return [
271-
("testTrailingClosureWithArguments", testTrailingClosureWithArguments),
272-
("testTrailingClosureWithoutParanthesis", testTrailingClosureWithoutParanthesis),
273-
("testEmptyTrailingClosure", testEmptyTrailingClosure),
274-
("testClosureArgumentWithSingleArgument", testClosureArgumentWithSingleArgument),
275-
("testClosureArgumentWithMultipleArguments", testClosureArgumentWithMultipleArguments),
276-
("testEscapingClosureArgument", testEscapingClosureArgument),
277-
("testClosureWithInoutArgument", testClosureWithInoutArgument),
278-
("testPassingClosureAsArgument", testPassingClosureAsArgument),
279-
("testNestedEscapingClosure", testNestedEscapingClosure),
280-
("testClosureArgumentShorthands", testClosureArgumentShorthands),
281-
("testClosureWithWeakSelfCaptureList", testClosureWithWeakSelfCaptureList),
282-
("testClosureWithUnownedSelfCaptureList", testClosureWithUnownedSelfCaptureList),
283-
("testClosureWithSingleFunctionCall", testClosureWithSingleFunctionCall)
284-
]
285-
}
286262
}

Tests/SplashTests/Tests/CommentTests.swift

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -358,31 +358,4 @@ final class CommentTests: SyntaxHighlighterTestCase {
358358
.plainText("}")
359359
])
360360
}
361-
362-
func testAllTestsRunOnLinux() {
363-
XCTAssertTrue(TestCaseVerifier.verifyLinuxTests((type(of: self)).allTests))
364-
}
365-
}
366-
367-
extension CommentTests {
368-
static var allTests: [(String, TestClosure<CommentTests>)] {
369-
return [
370-
("testSingleLineComment", testSingleLineComment),
371-
("testMultiLineComment", testMultiLineComment),
372-
("testMultiLineCommentWithDoubleAsterisks", testMultiLineCommentWithDoubleAsterisks),
373-
("testMutliLineDocumentationComment", testMutliLineDocumentationComment),
374-
("testCommentStartingWithPunctuation", testCommentStartingWithPunctuation),
375-
("testCommentEndingWithComma", testCommentEndingWithComma),
376-
("testCommentPrecededByComma", testCommentPrecededByComma),
377-
("testCommentWithNumber", testCommentWithNumber),
378-
("testCommentWithNoWhiteSpaceToPunctuation", testCommentWithNoWhiteSpaceToPunctuation),
379-
("testCommentsNextToCurlyBrackets", testCommentsNextToCurlyBrackets),
380-
("testCommentWithinGenericTypeList", testCommentWithinGenericTypeList),
381-
("testCommentsNextToGenericTypeList", testCommentsNextToGenericTypeList),
382-
("testCommentsNextToInitialization", testCommentsNextToInitialization),
383-
("testCommentsNextToProtocolName", testCommentsNextToProtocolName),
384-
("testCommentsAfterOptionalTypes", testCommentsAfterOptionalTypes),
385-
("testCommentsAfterArrayTypes", testCommentsAfterArrayTypes)
386-
]
387-
}
388361
}

0 commit comments

Comments
 (0)