File tree Expand file tree Collapse file tree 3 files changed +27
-7
lines changed
CodeGeneration/Tests/ValidateSyntaxNodes
SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,8 @@ class ValidateSyntaxNodes: XCTestCase {
515
515
ValidationFailure ( node: . differentiabilityArguments, message: " could conform to trait 'Parenthesized' but does not " ) ,
516
516
ValidationFailure ( node: . editorPlaceholderDecl, message: " could conform to trait 'MissingNode' but does not " ) ,
517
517
ValidationFailure ( node: . editorPlaceholderExpr, message: " could conform to trait 'MissingNode' but does not " ) ,
518
+ ValidationFailure ( node: . editorPlaceholderPattern, message: " could conform to trait 'MissingNode' but does not " ) ,
519
+ ValidationFailure ( node: . editorPlaceholderType, message: " could conform to trait 'MissingNode' but does not " ) ,
518
520
ValidationFailure ( node: . enumCaseElement, message: " could conform to trait 'NamedDecl' but does not " ) ,
519
521
ValidationFailure ( node: . genericParameter, message: " could conform to trait 'NamedDecl' but does not " ) ,
520
522
ValidationFailure ( node: . precedenceGroupDecl, message: " could conform to trait 'Braced' but does not " ) ,
Original file line number Diff line number Diff line change @@ -24,9 +24,8 @@ struct Test: ParsableCommand, BuildCommand {
24
24
var arguments : BuildArguments
25
25
26
26
func run( ) throws {
27
- try buildExample ( exampleName: " ExamplePlugin " )
28
-
29
27
try runTests ( )
28
+ try runCodeGenerationTests ( )
30
29
31
30
logSection ( " All tests passed " )
32
31
}
@@ -71,6 +70,30 @@ struct Test: ParsableCommand, BuildCommand {
71
70
)
72
71
}
73
72
73
+ private func runCodeGenerationTests( ) throws {
74
+ logSection ( " Running CodeGeneration Tests " )
75
+ var swiftpmCallArguments : [ String ] = [ ]
76
+
77
+ if arguments. verbose {
78
+ swiftpmCallArguments += [ " --verbose " ]
79
+ }
80
+
81
+ let additionalEnvironment : [ String : String ] = [
82
+ " SWIFT_BUILD_SCRIPT_ENVIRONMENT " : " 1 " ,
83
+ " SWIFTSYNTAX_ENABLE_RAWSYNTAX_VALIDATION " : " 1 " ,
84
+ " SWIFTPARSER_ENABLE_ALTERNATE_TOKEN_INTROSPECTION " : " 1 " ,
85
+ ]
86
+
87
+ try invokeSwiftPM (
88
+ action: " test " ,
89
+ packageDir: Paths . codeGenerationDir,
90
+ additionalArguments: swiftpmCallArguments,
91
+ additionalEnvironment: additionalEnvironment,
92
+ captureStdout: false ,
93
+ captureStderr: false
94
+ )
95
+ }
96
+
74
97
private func findSwiftpmBinPath( packageDir: URL ) throws -> String {
75
98
return try invokeSwiftPM (
76
99
action: " build " ,
Original file line number Diff line number Diff line change @@ -27,11 +27,6 @@ extension BuildCommand {
27
27
try build ( packageDir: packageDir, name: targetName, isProduct: false )
28
28
}
29
29
30
- func buildExample( exampleName: String ) throws {
31
- logSection ( " Building example " + exampleName)
32
- try build ( packageDir: Paths . examplesDir, name: exampleName, isProduct: true )
33
- }
34
-
35
30
@discardableResult
36
31
func invokeSwiftPM(
37
32
action: String ,
You can’t perform that action at this time.
0 commit comments