mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport This aligns more generally with the cleanup that the Swift Package Manager has already done in their automated XCTest-plumbing tool in apple/swift-package-manager#1826.
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
// RUN: %target-run-simple-swift
|
||||
// REQUIRES: executable_test
|
||||
//
|
||||
// REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchos || OS=linux-androideabi || OS=linux-android || OS=linux-gnu
|
||||
//// REQUIRES: VENDOR=apple || OS=linux-androideabi || OS=linux-android || OS=linux-gnu
|
||||
|
||||
import Swift
|
||||
import StdlibUnittest
|
||||
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
#if canImport(Darwin)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
#elseif canImport(Glibc)
|
||||
import Glibc
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
@@ -16,7 +15,7 @@ import StdlibUnittest
|
||||
|
||||
var POSIXErrorCodeTestSuite = TestSuite("POSIXErrorCode")
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
#if canImport(Darwin)
|
||||
|
||||
POSIXErrorCodeTestSuite.test("Darwin POSIX error codes constants") {
|
||||
expectEqual(EPERM, POSIXErrorCode.EPERM.rawValue)
|
||||
|
||||
Reference in New Issue
Block a user