Skip to content

Commit 7a3ed15

Browse files
authored
Exclude/fix certain tests for swift-evolve (#21276)
* Add swift_evolve feature and disable several tests This change adds a swift_evolve feature to our lit configuration and uses it to mark several tests as unsupported by swift_evolve. One of these—test/api-digester/stability-stdlib-abi.swift—is actually pretty bad; we would really like to have it. But the digester has known issues exposed by swift-evolve. * Remove order dependency in another test * Tweaks from Jordan’s review * Distinguish between tests which are intentionally unsupported and temporarily disabled. * Add an explanation for one unsupproted test. * Code nitpick.
1 parent cb6fa8d commit 7a3ed15

File tree

6 files changed

+29
-7
lines changed

6 files changed

+29
-7
lines changed

test/SIL/Parser/array_roundtrip.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
// RUN: %target-swift-frontend %s -emit-sil -Ounchecked | %target-sil-opt -assume-parsing-unqualified-ownership-sil
2+
3+
// Fails if the positions of the two Collection subscript requirements are
4+
// reversed. rdar://problem/46650834
5+
// XFAIL: swift_evolve
6+
27
var W = [UInt32](repeating: 0, count: 16)

test/SourceKit/DocSupport/doc_clang_module.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// REQUIRES: objc_interop
22

3+
// SourceKit is expected to produce documentation in source order.
4+
// UNSUPPORTED: swift_evolve
5+
36
// FIXME: the test output we're comparing to is specific to macOS.
47
// REQUIRES-ANY: OS=macosx
58

test/SourceKit/InterfaceGen/gen_stdlib.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ var x: Int
88

99
// Just check a small part, mainly to make sure we can print the interface of the stdlib.
1010
// CHECK-STDLIB-NOT: extension _SwiftNSOperatingSystemVersion
11-
// CHECK-STDLIB: struct Int : FixedWidthInteger, SignedInteger {
12-
// CHECK-STDLIB: static var bitWidth: Int { get }
13-
// CHECK-STDLIB: var nonzeroBitCount: Int { get }
11+
// CHECK-STDLIB-LABEL: struct Int : FixedWidthInteger, SignedInteger {
12+
// CHECK-STDLIB-DAG: static var bitWidth: Int { get }
13+
// CHECK-STDLIB-DAG: var nonzeroBitCount: Int { get }
1414
// CHECK-STDLIB: }
1515

1616
// Check that extensions of nested decls are showing up.
1717
// CHECK-STDLIB-LABEL: extension String.Index {
18-
// CHECK-STDLIB: func samePosition(in utf8: String.UTF8View) -> String.UTF8View.Index?
19-
// CHECK-STDLIB: func samePosition(in characters: String) -> String.Index?
20-
// CHECK-STDLIB: func samePosition(in unicodeScalars: String.UnicodeScalarView) -> String.UnicodeScalarIndex?
21-
// CHECK-STDLIB-NEXT: }
18+
// CHECK-STDLIB-DAG: func samePosition(in utf8: String.UTF8View) -> String.UTF8View.Index?
19+
// CHECK-STDLIB-DAG: func samePosition(in characters: String) -> String.Index?
20+
// CHECK-STDLIB-DAG: func samePosition(in unicodeScalars: String.UnicodeScalarView) -> String.UnicodeScalarIndex?
21+
// CHECK-STDLIB: }
2222

2323
// CHECK-MUTATING-ATTR: mutating func
2424

test/api-digester/dump-module.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@
1313
// RUN: diff -u %S/Outputs/cake.json %t.dump.json
1414
// RUN: %api-digester -deserialize-sdk --input-paths %S/Outputs/cake-abi.json -o %t.dump.json
1515
// RUN: diff -u %S/Outputs/cake-abi.json %t.dump.json
16+
17+
// The input JSON files need to be modified when standard library declarations
18+
// are reordered. This is expected behavior and we simply shouldn't run the test
19+
// when automatically evolving the standard library.
20+
// UNSUPPORTED: swift_evolve

test/api-digester/stability-stdlib-abi.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@
66
// RUN: %clang -E -P -x c %S/Outputs/stability-stdlib-abi.swift.expected -o - | sed '/^\s*$/d' | sort > %t.tmp/stability-stdlib-abi.swift.expected
77
// RUN: %clang -E -P -x c %t.tmp/changes.txt -o - | sed '/^\s*$/d' | sort > %t.tmp/changes.txt.tmp
88
// RUN: diff -u %t.tmp/stability-stdlib-abi.swift.expected %t.tmp/changes.txt.tmp
9+
10+
// The digester hasn't learned that we've stopped baking non-stored class member
11+
// order into the ABI. rdar://problem/46617463
12+
// The digester can incorrectly register a generic signature change when
13+
// declarations are shuffled. rdar://problem/46618883
14+
// XFAIL: swift_evolve

test/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ elif swift_test_subset == 'only_stress':
540540
else:
541541
lit_config.fatal("Unknown test mode %r" % swift_test_subset)
542542

543+
if 'swift_evolve' in lit_config.params:
544+
config.available_features.add("swift_evolve")
545+
543546
# Enable benchmark testing when the binary is found (has fully qualified path).
544547
if config.benchmark_o != 'Benchmark_O':
545548
config.available_features.add('benchmark')

0 commit comments

Comments
 (0)