Skip to content

Commit f61ec82

Browse files
committed
Run swift test --generate-linuxmain
1 parent c6adb3d commit f61ec82

17 files changed

+197
-112
lines changed

Tests/LinuxMain.swift

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
11
import XCTest
2+
23
import SwiftSyntaxTest
34

4-
XCTMain({ () -> [XCTestCaseEntry] in
5-
var testCases: [XCTestCaseEntry] = [
6-
testCase(AbsolutePositionTestCase.allTests),
7-
testCase(ClassificationTests.allTests),
8-
testCase(DiagnosticTestCase.allTests),
9-
testCase(IncrementalParsingTestCase.allTests),
10-
testCase(MultithreadingTestCase.allTests),
11-
testCase(ParseFileTestCase.allTests),
12-
testCase(SyntaxChildrenAPITestCase.allTests),
13-
testCase(SyntaxCollectionsAPITestCase.allTests),
14-
testCase(SyntaxFactoryAPITestCase.allTests),
15-
testCase(SyntaxAPITestCase.allTests),
16-
testCase(SyntaxVisitorTestCase.allTests),
17-
testCase(TokenSyntaxTestCase.allTests),
18-
testCase(SyntaxTreeModifierTests.allTests),
19-
testCase(TriviaTests.allTests),
20-
testCase(CustomReflectableTests.allTests),
21-
]
22-
return testCases
23-
}())
5+
var tests = [XCTestCaseEntry]()
6+
tests += SwiftSyntaxTest.__allTests()
7+
8+
XCTMain(tests)

Tests/SwiftSyntaxTest/AbsolutePositionTests.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ fileprivate class FuncRenamer: SyntaxRewriter {
1010

1111
public class AbsolutePositionTests: XCTestCase {
1212

13-
public static let allTests = [
14-
("testVisitor", testVisitor),
15-
("testClosure", testClosure),
16-
("testRename", testRename),
17-
("testCurrentFile", testCurrentFile),
18-
("testRecursion", testRecursion),
19-
("testTrivias", testTrivias),
20-
("testImplicit", testImplicit),
21-
("testWithoutSourceFileRoot", testWithoutSourceFileRoot),
22-
("testSourceLocation", testSourceLocation),
23-
]
24-
2513
public func testVisitor() {
2614
XCTAssertNoThrow(try {
2715
let source = try String(contentsOf: getInput("visitor.swift"))

Tests/SwiftSyntaxTest/ClassificationTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import XCTest
22
import SwiftSyntax
33

44
public class ClassificationTests: XCTestCase {
5-
public static let allTests = [
6-
("testClassification", testClassification),
7-
("testTokenClassification", testTokenClassification),
8-
]
95

106
public func testClassification() {
117
let source = "// blah.\nlet x/*yo*/ = 0"

Tests/SwiftSyntaxTest/CustomReflecatbleTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import SwiftSyntax
33

44

55
public class CustomReflectableTests: XCTestCase {
6-
public static let allTests = [
7-
("testDump", testDump),
8-
("testConformanceToCustomReflectable", testConformanceToCustomReflectable),
9-
]
10-
116

127
public func testDump() {
138
struct TestCase {

Tests/SwiftSyntaxTest/DiagnosticTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ fileprivate extension Diagnostic.Message {
2929

3030
public class DiagnosticTests: XCTestCase {
3131

32-
public static let allTests = [
33-
("testDiagnosticEmission", testDiagnosticEmission),
34-
("testSourceLocations", testSourceLocations),
35-
]
36-
3732
public func testDiagnosticEmission() {
3833
let startLoc = loc()
3934
let fixLoc = loc()

Tests/SwiftSyntaxTest/IncrementalParsingTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import SwiftSyntax
33

44
public class IncrementalParsingTests: XCTestCase {
55

6-
public static let allTests = [
7-
("testIncrementalInvalid", testIncrementalInvalid),
8-
("testReusedNode", testReusedNode),
9-
]
10-
116
public func testIncrementalInvalid() {
127
let original = "struct A { func f() {"
138
let step: (String, (Int, Int, String)) =

Tests/SwiftSyntaxTest/MultithreadingTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import SwiftSyntax
33

44
public class MultithreadingTests: XCTestCase {
55

6-
public static let allTests = [
7-
("testPathological", testPathological),
8-
("testTwoAccesses", testTwoAccesses),
9-
]
10-
116
public func testPathological() {
127
let tuple = SyntaxFactory.makeVoidTupleType()
138

Tests/SwiftSyntaxTest/ParseFileTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ enum Animal {
2525

2626
public class ParseFileTests: XCTestCase {
2727

28-
public static let allTests = [
29-
("testParseSingleFile", testParseSingleFile),
30-
("testEnumCaseStructure", testEnumCaseStructure)
31-
]
32-
3328
public func testParseSingleFile() {
3429
let currentFile = URL(fileURLWithPath: #file)
3530
XCTAssertNoThrow(try {

Tests/SwiftSyntaxTest/SyntaxChildrenTests.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ import SwiftSyntax
33

44
public class SyntaxChildrenTests: XCTestCase {
55

6-
public static let allTests = [
7-
("testIterateWithAllPresent", testIterateWithAllPresent),
8-
("testIterateWithSomeMissing", testIterateWithSomeMissing),
9-
("testIterateWithAllMissing", testIterateWithAllMissing),
10-
]
11-
126
public func testIterateWithAllPresent() {
137
let returnStmt = SyntaxFactory.makeReturnStmt(
148
returnKeyword: SyntaxFactory.makeReturnKeyword(),

Tests/SwiftSyntaxTest/SyntaxCollectionsTests.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ fileprivate func integerLiteralElement(_ int: Int) -> ArrayElementSyntax {
1010

1111
public class SyntaxCollectionsTests: XCTestCase {
1212

13-
public static let allTests = [
14-
("testAppendingElement", testAppendingElement),
15-
("testInsertingElement", testInsertingElement),
16-
("testPrependingElement", testPrependingElement),
17-
("testRemovingFirstElement", testRemovingFirstElement),
18-
("testRemovingLastElement", testRemovingLastElement),
19-
("testRemovingElement", testRemovingElement),
20-
("testReplacingElement", testReplacingElement),
21-
("testIteration", testIteration),
22-
]
23-
2413
public func testAppendingElement() {
2514
let arrayElementList = SyntaxFactory.makeArrayElementList([
2615
integerLiteralElement(0)

0 commit comments

Comments
 (0)