Skip to content

Commit 8090cca

Browse files
kitasukeahoppen
authored andcommitted
Generate LinuxMain
1 parent bbd78f9 commit 8090cca

18 files changed

+282
-113
lines changed

Tests/LinuxMain.swift

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
import XCTest
2+
3+
import SwiftSyntaxBuilderTest
24
import SwiftSyntaxTest
35

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-
}())
6+
var tests = [XCTestCaseEntry]()
7+
tests += SwiftSyntaxBuilderTest.__allTests()
8+
tests += SwiftSyntaxTest.__allTests()
9+
10+
XCTMain(tests)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#if !canImport(ObjectiveC)
2+
import XCTest
3+
4+
extension FormatTests {
5+
// DO NOT MODIFY: This is autogenerated, use:
6+
// `swift test --generate-linuxmain`
7+
// to regenerate.
8+
static let __allTests__FormatTests = [
9+
("test_makeIndented", test_makeIndented),
10+
]
11+
}
12+
13+
extension ImportTests {
14+
// DO NOT MODIFY: This is autogenerated, use:
15+
// `swift test --generate-linuxmain`
16+
// to regenerate.
17+
static let __allTests__ImportTests = [
18+
("testImport", testImport),
19+
]
20+
}
21+
22+
extension IntegerLiteralTests {
23+
// DO NOT MODIFY: This is autogenerated, use:
24+
// `swift test --generate-linuxmain`
25+
// to regenerate.
26+
static let __allTests__IntegerLiteralTests = [
27+
("testIntegerLiteral", testIntegerLiteral),
28+
]
29+
}
30+
31+
extension SourceFileTests {
32+
// DO NOT MODIFY: This is autogenerated, use:
33+
// `swift test --generate-linuxmain`
34+
// to regenerate.
35+
static let __allTests__SourceFileTests = [
36+
("testSourceFile", testSourceFile),
37+
]
38+
}
39+
40+
extension StringLiteralTests {
41+
// DO NOT MODIFY: This is autogenerated, use:
42+
// `swift test --generate-linuxmain`
43+
// to regenerate.
44+
static let __allTests__StringLiteralTests = [
45+
("testStringLiteral", testStringLiteral),
46+
]
47+
}
48+
49+
extension StructTests {
50+
// DO NOT MODIFY: This is autogenerated, use:
51+
// `swift test --generate-linuxmain`
52+
// to regenerate.
53+
static let __allTests__StructTests = [
54+
("testEmptyStruct", testEmptyStruct),
55+
("testNestedStruct", testNestedStruct),
56+
("testStructWithIndent", testStructWithIndent),
57+
("testStructWithMember", testStructWithMember),
58+
]
59+
}
60+
61+
extension VariableTests {
62+
// DO NOT MODIFY: This is autogenerated, use:
63+
// `swift test --generate-linuxmain`
64+
// to regenerate.
65+
static let __allTests__VariableTests = [
66+
("testLet", testLet),
67+
("testVar", testVar),
68+
]
69+
}
70+
71+
public func __allTests() -> [XCTestCaseEntry] {
72+
return [
73+
testCase(FormatTests.__allTests__FormatTests),
74+
testCase(ImportTests.__allTests__ImportTests),
75+
testCase(IntegerLiteralTests.__allTests__IntegerLiteralTests),
76+
testCase(SourceFileTests.__allTests__SourceFileTests),
77+
testCase(StringLiteralTests.__allTests__StringLiteralTests),
78+
testCase(StructTests.__allTests__StructTests),
79+
testCase(VariableTests.__allTests__VariableTests),
80+
]
81+
}
82+
#endif

Tests/SwiftSyntaxTest/AbsolutePositionTests.swift

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

1313
public class AbsolutePositionTests: XCTestCase {
1414

15-
public static let allTests = [
16-
("testVisitor", testVisitor),
17-
("testClosure", testClosure),
18-
("testRename", testRename),
19-
("testCurrentFile", testCurrentFile),
20-
("testRecursion", testRecursion),
21-
("testTrivias", testTrivias),
22-
("testImplicit", testImplicit),
23-
("testWithoutSourceFileRoot", testWithoutSourceFileRoot),
24-
("testSourceLocation", testSourceLocation),
25-
]
26-
2715
public func testVisitor() {
2816
XCTAssertNoThrow(try {
2917
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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import SwiftSyntax
33

44

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

117
public func testDump() {
128
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(),

0 commit comments

Comments
 (0)