-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathMetalKit.swift
46 lines (36 loc) · 1.23 KB
/
MetalKit.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -o %t/a.out4 -swift-version 4 && %target-codesign %t/a.out4 && %target-run %t/a.out4
// REQUIRES: objc_interop
// UNSUPPORTED: OS=watchos
// REQUIRES: executable_test
import StdlibUnittest
import Metal
import MetalKit
var MetalKitTests = TestSuite("MetalKit")
// Call each overlay to ensure nothing explodes
if #available(macOS 10.12, iOS 10.0, tvOS 10.0, *) {
MetalKitTests.test("Globals") {
do {
let _ = try MTKModelIOVertexDescriptorFromMetalWithError(MTLVertexDescriptor())
} catch _ {
expectUnreachable("MTKModelIOVertexDescriptorFromMetalWithError has thrown an unexpected error")
}
do {
let _ = try MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor())
} catch _ {
expectUnreachable("MTKMetalVertexDescriptorFromModelIOWithError has thrown an unexpected error")
}
}
}
if #available(macOS 10.11, iOS 9.0, tvOS 9.0, *) {
MetalKitTests.test("MTKMesh") {
func apiAvailabilityTest(device: MTLDevice) {
do {
let _ = try MTKMesh.newMeshes(asset: MDLAsset(), device: device)
} catch _ {
expectUnreachable("MTKMesh.newMeshes has thrown an unexpected error")
}
}
}
}
runAllTests()