Skip to content

Commit fbff3f3

Browse files
committed
Add visionOS test
1 parent 6bc3f96 commit fbff3f3

6 files changed

Lines changed: 59 additions & 1 deletion

File tree

.github/workflows/checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@ jobs:
273273
codecov: false
274274
action: test
275275
warnings-as-errors: false
276+
- platform: visionOS
277+
xcode: ^15
278+
codecov: false
279+
action: test
280+
warnings-as-errors: false
276281
steps:
277282
- uses: actions/checkout@v3
278283
- uses: ./

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
required: false
1515
platform:
1616
description: |
17-
Either `iOS`, `tvOS`, `macOS`, `watchOS` or (more rarely)
17+
Either `iOS`, `tvOS`, `macOS`, `watchOS`, `visionOS` or (more rarely)
1818
`mac-catalyst`
1919
Leave unset and `xcodebuild` decides itself.
2020
required: false

fixtures/visionOS/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
xcuserdata/
6+
DerivedData/
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

fixtures/visionOS/Package.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// swift-tools-version:5.0
2+
3+
import PackageDescription
4+
5+
let name = "my-fixture"
6+
7+
let pkg = Package(
8+
name: name,
9+
products: [
10+
.library(name: name, targets: [name]),
11+
],
12+
targets: [
13+
.target(name: name, path: ".", sources: ["code.swift"]),
14+
.testTarget(name: "\(name)Tests", path: ".", sources: ["test.swift"]),
15+
]
16+
)
17+
18+
pkg.platforms = [
19+
.macOS(.v10_10),
20+
.iOS(.v9),
21+
.tvOS(.v9),
22+
.watchOS(.v3)
23+
]

fixtures/visionOS/code.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#if !os(visionOS)
2+
#error("!os(visionOS)")
3+
#endif

fixtures/visionOS/test.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#if !os(visionOS)
2+
#error("!os(visionOS)")
3+
#endif
4+
5+
func foo() -> Int {
6+
return 5
7+
}
8+
9+
func bar() {
10+
// deliberate warning
11+
foo()
12+
}
13+
14+
import XCTest
15+
16+
class Test: XCTestCase {
17+
func test() {
18+
XCTAssertEqual(1, 1)
19+
}
20+
}

0 commit comments

Comments
 (0)