Skip to content

Commit ab67a77

Browse files
committed
update conditional compilation flags
1 parent 7b33730 commit ab67a77

37 files changed

+136
-134
lines changed

Sources/XCTest/Private/PerformanceMeter.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Measures the performance of a block of code and reports the results.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// Describes a type that is capable of measuring some aspect of code performance

Sources/XCTest/Private/PrintObserver.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Prints test progress to stdout.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// Prints textual representations of each XCTestObservation event to stdout.

Sources/XCTest/Private/TestListing.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Implementation of the mode for printing the list of tests.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
internal struct TestListing {

Sources/XCTest/Private/WallClockTimeMetric.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Performance metric measuring how long it takes code to execute
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// This metric uses the system uptime to keep track of how much time passes

Sources/XCTest/Private/XCPredicateExpectation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Expectations with a specified predicate and object to evaluate.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
internal class XCPredicateExpectation: XCTestExpectation {

Sources/XCTest/Private/XCTestCaseSuite.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// A test suite associated with a particular test case class.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// A test suite which is associated with a particular test case class. It will

Sources/XCTest/Public/Asynchronous/XCNotificationExpectationHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// observed.
1313
//
1414

15-
#if os(Linux) || os(FreeBSD)
16-
import Foundation
17-
#else
15+
#if os(macOS)
1816
import SwiftFoundation
17+
#else
18+
import Foundation
1919
#endif
2020

2121
/// A block to be invoked when a notification specified by the expectation is

Sources/XCTest/Public/Asynchronous/XCPredicateExpectationHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// evaluated with a given object.
1313
//
1414

15-
#if os(Linux) || os(FreeBSD)
16-
import Foundation
17-
#else
15+
#if os(macOS)
1816
import SwiftFoundation
17+
#else
18+
import Foundation
1919
#endif
2020

2121
/// A block to be invoked when evaluating the predicate against the object

Sources/XCTest/Public/Asynchronous/XCTestCase+Asynchronous.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Methods on XCTestCase for testing asynchronous operations
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
public extension XCTestCase {

Sources/XCTest/Public/Asynchronous/XCTestCase+NotificationExpectation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
// XCTestCase+NotificationExpectation.swift
1111
//
1212

13-
#if os(Linux) || os(FreeBSD)
14-
import Foundation
15-
#else
13+
#if os(macOS)
1614
import SwiftFoundation
15+
#else
16+
import Foundation
1717
#endif
1818

1919
public extension XCTestCase {

Sources/XCTest/Public/Asynchronous/XCTestCase+PredicateExpectation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
// XCTestCase+PredicateExpectation.swift
1111
//
1212

13-
#if os(Linux) || os(FreeBSD)
14-
import Foundation
15-
#else
13+
#if os(macOS)
1614
import SwiftFoundation
15+
#else
16+
import Foundation
1717
#endif
1818

1919
public extension XCTestCase {

Sources/XCTest/Public/Asynchronous/XCWaitCompletionHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// fulfilled times out.
1313
//
1414

15-
#if os(Linux) || os(FreeBSD)
16-
import Foundation
17-
#else
15+
#if os(macOS)
1816
import SwiftFoundation
17+
#else
18+
import Foundation
1919
#endif
2020

2121
/// A block to be invoked when a call to wait times out or has had all

Sources/XCTest/Public/XCTestCase.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Base class for test cases
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// This is a compound type used by `XCTMain` to represent tests to run. It combines an

Sources/XCTest/Public/XCTestMain.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
// for running tests and some infrastructure for running them.
1313
//
1414

15-
#if os(Linux) || os(FreeBSD)
16-
import Glibc
17-
import Foundation
15+
#if os(macOS)
16+
import SwiftFoundation
1817
#else
18+
import Foundation
19+
#endif
20+
21+
#if os(macOS)
1922
import Darwin
20-
import SwiftFoundation
23+
#elseif os(Linux) || os(FreeBSD)
24+
import Glibc
2125
#endif
2226

2327
/// Starts a test run for the specified test cases.
@@ -93,4 +97,3 @@ public func XCTMain(_ testCases: [XCTestCaseEntry]) -> Never {
9397
exit(rootTestSuite.testRun!.totalFailureCount == 0 ? 0 : 1)
9498
}
9599
}
96-

Sources/XCTest/Public/XCTestObservation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Hooks for being notified about progress during a test run.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// `XCTestObservation` provides hooks for being notified about progress during a

Sources/XCTest/Public/XCTestObservationCenter.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Notification center for test run progress events.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// Provides a registry for objects wishing to be informed about progress

Sources/XCTest/Public/XCTestRun.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// A test run collects information about the execution of a test.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// A test run collects information about the execution of a test. Failures in

Sources/XCTest/Public/XCTestSuiteRun.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// A test run for an `XCTestSuite`.
1212
//
1313

14-
#if os(Linux) || os(FreeBSD)
15-
import Foundation
16-
#else
14+
#if os(macOS)
1715
import SwiftFoundation
16+
#else
17+
import Foundation
1818
#endif
1919

2020
/// A test run for an `XCTestSuite`.

Tests/Functional/Asynchronous/Expectations/main.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// RUN: %T/Asynchronous > %t || true
33
// RUN: %{xctest_checker} %t %s
44

5-
#if os(Linux) || os(FreeBSD)
6-
import XCTest
7-
import Foundation
8-
#else
9-
import SwiftXCTest
5+
#if os(macOS)
106
import SwiftFoundation
7+
import SwiftXCTest
8+
#else
9+
import Foundation
10+
import XCTest
1111
#endif
1212

1313
// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+

Tests/Functional/Asynchronous/Handler/main.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// RUN: %T/Handler > %t || true
33
// RUN: %{xctest_checker} %t %s
44

5-
#if os(Linux) || os(FreeBSD)
6-
import XCTest
7-
import Foundation
8-
#else
9-
import SwiftXCTest
5+
#if os(macOS)
106
import SwiftFoundation
7+
import SwiftXCTest
8+
#else
9+
import Foundation
10+
import XCTest
1111
#endif
1212

1313
// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+

Tests/Functional/Asynchronous/Misuse/main.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// RUN: %T/Misuse > %t || true
33
// RUN: %{xctest_checker} %t %s
44

5-
#if os(Linux) || os(FreeBSD)
6-
import XCTest
7-
#else
5+
#if os(macOS)
86
import SwiftXCTest
7+
#else
8+
import XCTest
99
#endif
1010

1111
// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+

Tests/Functional/Asynchronous/Notifications/Expectations/main.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
// RUN: %T/Asynchronous-Notifications > %t || true
33
// RUN: %{xctest_checker} %t %s
44

5-
#if os(Linux) || os(FreeBSD)
6-
import XCTest
7-
import Foundation
8-
#else
9-
import SwiftXCTest
5+
#if os(macOS)
106
import SwiftFoundation
7+
import SwiftXCTest
8+
#else
9+
import Foundation
10+
import XCTest
1111
#endif
1212

13-
1413
// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+
1514
// CHECK: Test Suite '.*\.xctest' started at \d+:\d+:\d+\.\d+
1615

Tests/Functional/Asynchronous/Notifications/Handler/main.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// RUN: %T/Asynchronous-Notifications-Handler > %t || true
33
// RUN: %{xctest_checker} %t %s
44

5-
#if os(Linux) || os(FreeBSD)
6-
import XCTest
7-
import Foundation
8-
#else
9-
import SwiftXCTest
5+
#if os(macOS)
106
import SwiftFoundation
7+
import SwiftXCTest
8+
#else
9+
import Foundation
10+
import XCTest
1111
#endif
1212

1313
// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+

Tests/Functional/Asynchronous/Predicates/Expectations/main.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// RUN: %T/Asynchronous-Predicates > %t || true
33
// RUN: %{xctest_checker} %t %s
44

5-
#if os(Linux) || os(FreeBSD)
6-
import XCTest
7-
import Foundation
8-
#else
9-
import SwiftXCTest
5+
#if os(macOS)
106
import SwiftFoundation
7+
import SwiftXCTest
8+
#else
9+
import Foundation
10+
import XCTest
1111
#endif
1212

1313
// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+

Tests/Functional/Asynchronous/Predicates/Handler/main.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// RUN: %T/Asynchronous-Predicates-Handler > %t || true
33
// RUN: %{xctest_checker} %t %s
44

5-
#if os(Linux) || os(FreeBSD)
6-
import XCTest
7-
import Foundation
8-
#else
9-
import SwiftXCTest
5+
#if os(macOS)
106
import SwiftFoundation
7+
import SwiftXCTest
8+
#else
9+
import Foundation
10+
import XCTest
1111
#endif
1212

1313
// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+

0 commit comments

Comments
 (0)