Skip to content

Commit f8e3c40

Browse files
authored
Merge pull request #31965 from DougGregor/generalize-attr-tests
2 parents 1f85c04 + 4057e7e commit f8e3c40

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

test/attr/ApplicationMain/attr_main_throws_prints_error.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -parse-as-library %s -o %t/main
33
// RUN: %target-codesign %t/main
4-
// RUN: not --crash %t/main 2>&1 | %FileCheck %s
4+
// RUN: %target-run %t/main > %t/log 2>&1 || true
5+
// RUN: %FileCheck %s < %t/log
6+
57
// REQUIRES: executable_test
6-
// REQUIRES: OS=macosx
8+
// REQUIRES: OS=macosx || OS=ios
79

810
enum Err : Error { case or }
911

test/attr/Inputs/SymbolMove/LowLevel.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
@available(OSX 10.7, *)
2-
@_originallyDefinedIn(module: "HighLevel", OSX 10.9)
1+
@available(OSX 10.7, iOS 7.0, *)
2+
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
33
public func printMessageMoved() {
44
print("Hello from LowLevel")
55
}
66

7-
@available(OSX 10.7, *)
8-
@_originallyDefinedIn(module: "HighLevel", OSX 10.9)
7+
@available(OSX 10.7, iOS 7.0, *)
8+
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
99
public struct Entity {
1010
public let value = "LowLevel"
1111
public init() {}
1212
public func location() -> String { return "Entity from " + value }
1313
}
1414

1515
// =================== Move protocol =================================//
16-
@available(OSX 10.7, *)
17-
@_originallyDefinedIn(module: "HighLevel", OSX 10.9)
16+
@available(OSX 10.7, iOS 7.0, *)
17+
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
1818
public protocol Box {
1919
associatedtype Item
2020
var ItemKind: String { get }
2121
func getItem() -> Item
2222
func shape() -> String
2323
}
2424

25-
@available(OSX 10.7, *)
26-
@_originallyDefinedIn(module: "HighLevel", OSX 10.9)
25+
@available(OSX 10.7, iOS 7.0, *)
26+
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
2727
extension Box {
2828
public func shape() -> String { return "round"}
2929
}
3030

31-
@available(OSX 10.7, *)
32-
@_originallyDefinedIn(module: "HighLevel", OSX 10.9)
31+
@available(OSX 10.7, iOS 7.0, *)
32+
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
3333
public struct Candy {
3434
public var kind = "candy"
3535
public init() {}
3636
}
3737

3838
// =================== Move enum ============================ //
39-
@available(OSX 10.7, *)
40-
@_originallyDefinedIn(module: "HighLevel", OSX 10.9)
39+
@available(OSX 10.7, iOS 7.0, *)
40+
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
4141
public enum LanguageKind: Int {
4242
case Cpp = 1
4343
case Swift = 2
4444
case ObjC = 3
4545
}
4646

4747
// =================== Move class ============================ //
48-
@available(OSX 10.7, *)
49-
@_originallyDefinedIn(module: "HighLevel", OSX 10.9)
48+
@available(OSX 10.7, iOS 7.0, *)
49+
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
5050
open class Vehicle {
5151
public init() {}
5252
public var currentSpeed = 40.0

test/attr/attr_originally_definedin_backward_compatibility.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// REQUIRES: OS=macosx
21
// REQUIRES: executable_test
2+
// REQUIRES: OS=macosx || OS=ios
33
//
44
// RUN: %empty-directory(%t)
55
//
@@ -16,10 +16,10 @@
1616

1717
// --- Build an executable using the original high level framework
1818
// RUN: %target-build-swift -emit-executable %s -g -o %t/HighlevelRunner -F %t/SDK/Frameworks/ -framework HighLevel \
19-
// RUN: -Xlinker -rpath -Xlinker %t/SDK/Frameworks
19+
// RUN: %target-rpath(@executable_path/SDK/Frameworks)
2020

2121
// --- Run the executable
22-
// RUN: %t/HighlevelRunner | %FileCheck %s -check-prefix=BEFORE_MOVE
22+
// RUN: %target-run %t/HighlevelRunner %t/SDK/Frameworks/HighLevel.framework/HighLevel | %FileCheck %s -check-prefix=BEFORE_MOVE
2323

2424
// --- Build low level framework.
2525
// RUN: mkdir -p %t/SDK/Frameworks/LowLevel.framework/Modules/LowLevel.swiftmodule
@@ -34,7 +34,7 @@
3434
// RUN: %S/Inputs/SymbolMove/HighLevel.swift -F %t/SDK/Frameworks -Xlinker -reexport_framework -Xlinker LowLevel -enable-library-evolution
3535

3636
// --- Run the executable
37-
// RUN: %t/HighlevelRunner | %FileCheck %s -check-prefix=AFTER_MOVE
37+
// RUN: %target-run %t/HighlevelRunner %t/SDK/Frameworks/HighLevel.framework/HighLevel %t/SDK/Frameworks/LowLevel.framework/LowLevel | %FileCheck %s -check-prefix=AFTER_MOVE
3838

3939
import HighLevel
4040

0 commit comments

Comments
 (0)