Skip to content

Commit 618a77d

Browse files
committed
[test] Mark some tests as requiring Swift Syntax
Some of the tests now depend on features provided by Swift Syntax, and will fail to pass if building without Swift Syntax support. This commits marks all the tests I know fail to pass when Swift Syntax is disabled. - swiftlang#70281 modified `ASTGen/verify-parse.swift` - swiftlang#70287 created `refactoring/SyntacticRename/operator.swift` and `SourceKit/RelatedIdents/operator.swift` - swiftlang#70389 modified `SourceKit/Refactoring/basic.swift` and indirectly modified all `refactoring/ExtractFunction/*` tests.
1 parent e8709d1 commit 618a77d

19 files changed

+25
-4
lines changed

test/ASTGen/verify-parse.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -enable-experimental-feature SwiftParser -enable-experimental-feature ParserASTGen)
88

99
// REQUIRES: executable_test
10+
// REQUIRES: swift_swift_parser
1011

1112
// -enable-experimental-feature requires an asserts build
1213
// REQUIRES: asserts

test/SourceKit/Refactoring/basic.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,4 @@ func hasCallToAsyncAlternative(c: ConvertAsync) {
275275
// CHECK-CALLASYNC: ACTIONS END
276276

277277
// REQUIRES: OS=macosx || OS=linux-gnu
278+
// REQUIRES: swift_swift_parser
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: split-file --leading-lines %s %t
33

4+
// REQUIRES: swift_swift_parser
5+
46
//--- a.swift
57

68
struct Foo {}
@@ -11,7 +13,7 @@ Foo() + Foo()
1113
//--- dummy.swift
1214

1315
// CHECK: START RANGES
14-
// CHECK: 8:6 - 1 - source.syntacticrename.definition
15-
// CHECK: 9:7 - 1 - source.syntacticrename.call
16+
// CHECK: [[# @LINE - 6 ]]:6 - 1 - source.syntacticrename.definition
17+
// CHECK: [[# @LINE - 6 ]]:7 - 1 - source.syntacticrename.call
1618
// CHECK: END RANGES
17-
// CHECK: NAME: +(_:_:)
19+
// CHECK: NAME: +(_:_:)

test/refactoring/ExtractFunction/await.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ func testThrowingClosure() async throws -> Int {
1616
// RUN: diff -u %S/Outputs/await/async2.swift.expected %t.result/async2.swift
1717
// RUN: %refactor -extract-function -source-filename %s -pos=8:1 -end-pos=8:60 >> %t.result/consumes_async.swift
1818
// RUN: diff -u %S/Outputs/await/consumes_async.swift.expected %t.result/consumes_async.swift
19+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/basic.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ func foo() -> Int{
1212
// RUN: diff -u %S/Outputs/basic/L3-5.swift.expected %t.result/L3-5.swift
1313
// RUN: %refactor -extract-function -source-filename %s -pos=3:1 -end-pos=4:26 >> %t.result/L3-4.swift
1414
// RUN: diff -u %S/Outputs/basic/L3-4.swift.expected %t.result/L3-4.swift
15+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_attributes.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ public func foo() -> Int{
1111
// RUN: %empty-directory(%t.result)
1212
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=6:26 >> %t.result/L5-6.swift
1313
// RUN: diff -u %S/Outputs/extract_attributes/L5-6.swift.expected %t.result/L5-6.swift
14+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_from_accessor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ class C {
1515

1616
// RUN: %refactor -extract-function -source-filename %s -pos=7:18 -end-pos=7:23 >> %t.result/ExplicitGetter.swift
1717
// RUN: diff -u %S/Outputs/extract_from_accessor/ExplicitGetter.swift.expected %t.result/ExplicitGetter.swift
18+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_init.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ class C {
1010
// RUN: %empty-directory(%t.result)
1111
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=6:15 >> %t.result/L5-6.swift
1212
// RUN: diff -u %S/Outputs/extract_init/L5-6.swift.expected %t.result/L5-6.swift
13+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_local.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ func returnFifteen() -> Int {
1515
// RUN: %empty-directory(%t.result)
1616
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=9:6 >> %t.result/AvoidFilePrivate.swift
1717
// RUN: diff -u %S/Outputs/extract_local/AvoidFilePrivate.swift.expected %t.result/AvoidFilePrivate.swift
18+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_subscript.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ class A {
1515
// RUN: diff -u %S/Outputs/extract_subscript/FromGetter.swift.expected %t.result/FromGetter.swift
1616
// RUN: %refactor -extract-function -source-filename %s -pos=8:1 -end-pos=8:19 >> %t.result/FromSetter.swift
1717
// RUN: diff -u %S/Outputs/extract_subscript/FromSetter.swift.expected %t.result/FromSetter.swift
18+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_sugar.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ func foo(_ a : inout [Int]) -> [Int] {
88
// RUN: %empty-directory(%t.result)
99
// RUN: %refactor -extract-function -source-filename %s -pos=2:1 -end-pos=5:11 >> %t.result/L2-5.swift
1010
// RUN: diff -u %S/Outputs/extract_sugar/L2-5.swift.expected %t.result/L2-5.swift
11+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_switch.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ func foo2(_ e : MyEnum) -> Int {
2929
// RUN: %empty-directory(%t.result)
3030
// RUN: %refactor -extract-function -source-filename %s -pos=16:1 -end-pos=23:4 >> %t.result/Int.swift
3131
// RUN: diff -u %S/Outputs/extract_switch/Int.swift.expected %t.result/Int.swift
32+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/extract_with_comments.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ public func foo() -> Int{
1414
// RUN: %empty-directory(%t.result)
1515
// RUN: %refactor -extract-function -source-filename %s -pos=6:1 -end-pos=7:26 >> %t.result/L6-7.swift
1616
// RUN: diff -u %S/Outputs/extract_with_comments/L6-7.swift.expected %t.result/L6-7.swift
17+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/name_correction.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ public func new_name3() {}
1515
// RUN: %empty-directory(%t.result)
1616
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=6:26 >> %t.result/L5-6.swift
1717
// RUN: diff -u %S/Outputs/name_correction/L5-6.swift.expected %t.result/L5-6.swift
18+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/static.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ class C {
1717
// RUN: diff -u %S/Outputs/static/L3-5.swift.expected %t.result/L3-5.swift
1818
// RUN: %refactor -extract-function -source-filename %s -pos=9:1 -end-pos=11:13 >> %t.result/L9-11.swift
1919
// RUN: diff -u %S/Outputs/static/L9-11.swift.expected %t.result/L9-11.swift
20+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/throw_errors.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ func foo2() throws {
2626
// RUN: diff -u %S/Outputs/throw_errors/L10-12.swift.expected %t.result/L10-12.swift
2727
// RUN: %refactor -extract-function -source-filename %s -pos=13:1 -end-pos=17:4 >> %t.result/L13-17.swift
2828
// RUN: diff -u %S/Outputs/throw_errors/L13-17.swift.expected %t.result/L13-17.swift
29+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/throw_errors2.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ struct RefactorExtractProblem {
1515
// RUN: %empty-directory(%t.result)
1616
// RUN: %refactor -extract-function -source-filename %s -pos=7:1 -end-pos=11:6 >> %t.result/L7-11.swift
1717
// RUN: diff -u %S/Outputs/throw_errors2/L7-11.swift.expected %t.result/L7-11.swift
18+
// REQUIRES: swift_swift_parser

test/refactoring/ExtractFunction/throw_errors3.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ func testThrowingClosure() throws {
1717
// RUN: diff -u %S/Outputs/throw_errors3/consumes_err.swift.expected %t.result/consumes_err.swift
1818
// RUN: %refactor -extract-function -source-filename %s -pos=10:1 -end-pos=12:51 >> %t.result/rethrows_err.swift
1919
// RUN: diff -u %S/Outputs/throw_errors3/rethrows_err.swift.expected %t.result/rethrows_err.swift
20+
// REQUIRES: swift_swift_parser

test/refactoring/SyntacticRename/operator.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// RUN: %empty-directory(%t)
22
// RUN: split-file %s %t
33
// RUN: %refactor -find-rename-ranges -source-filename %t/input.swift -pos="test" -old-name "+(x:y:)" -new-name "-(x:y:)" > %t/output.txt
4-
// RUN: diff -u %t/expected.swift %t/output.txt
4+
// RUN: diff -u %t/expected.swift %t/output.txt
5+
6+
// REQUIRES: swift_swift_parser
57

68
//--- input.swift
79

0 commit comments

Comments
 (0)