Skip to content

update conditional compilation flags #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/XCTest/Private/PerformanceMeter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Measures the performance of a block of code and reports the results.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// Describes a type that is capable of measuring some aspect of code performance
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Private/PrintObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Prints test progress to stdout.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// Prints textual representations of each XCTestObservation event to stdout.
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Private/TestListing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Implementation of the mode for printing the list of tests.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

internal struct TestListing {
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Private/WallClockTimeMetric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Performance metric measuring how long it takes code to execute
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// This metric uses the system uptime to keep track of how much time passes
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Private/XCPredicateExpectation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Expectations with a specified predicate and object to evaluate.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

internal class XCPredicateExpectation: XCTestExpectation {
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Private/XCTestCaseSuite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// A test suite associated with a particular test case class.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// A test suite which is associated with a particular test case class. It will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// observed.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// A block to be invoked when a notification specified by the expectation is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// evaluated with a given object.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// A block to be invoked when evaluating the predicate against the object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Methods on XCTestCase for testing asynchronous operations
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

public extension XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
// XCTestCase+NotificationExpectation.swift
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

public extension XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
// XCTestCase+PredicateExpectation.swift
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

public extension XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// fulfilled times out.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// A block to be invoked when a call to wait times out or has had all
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Public/XCTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Base class for test cases
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// This is a compound type used by `XCTMain` to represent tests to run. It combines an
Expand Down
13 changes: 8 additions & 5 deletions Sources/XCTest/Public/XCTestMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
// for running tests and some infrastructure for running them.
//

#if os(Linux) || os(FreeBSD)
import Glibc
import Foundation
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

#if os(macOS)
import Darwin
import SwiftFoundation
#elseif os(Linux) || os(FreeBSD)
import Glibc
#endif

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

6 changes: 3 additions & 3 deletions Sources/XCTest/Public/XCTestObservation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Hooks for being notified about progress during a test run.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// `XCTestObservation` provides hooks for being notified about progress during a
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Public/XCTestObservationCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Notification center for test run progress events.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// Provides a registry for objects wishing to be informed about progress
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Public/XCTestRun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// A test run collects information about the execution of a test.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// A test run collects information about the execution of a test. Failures in
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Public/XCTestSuiteRun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// A test run for an `XCTestSuite`.
//

#if os(Linux) || os(FreeBSD)
import Foundation
#else
#if os(macOS)
import SwiftFoundation
#else
import Foundation
#endif

/// A test run for an `XCTestSuite`.
Expand Down
10 changes: 5 additions & 5 deletions Tests/Functional/Asynchronous/Expectations/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// RUN: %T/Asynchronous > %t || true
// RUN: %{xctest_checker} %t %s

#if os(Linux) || os(FreeBSD)
import XCTest
import Foundation
#else
import SwiftXCTest
#if os(macOS)
import SwiftFoundation
import SwiftXCTest
#else
import Foundation
import XCTest
#endif

// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+
Expand Down
10 changes: 5 additions & 5 deletions Tests/Functional/Asynchronous/Handler/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// RUN: %T/Handler > %t || true
// RUN: %{xctest_checker} %t %s

#if os(Linux) || os(FreeBSD)
import XCTest
import Foundation
#else
import SwiftXCTest
#if os(macOS)
import SwiftFoundation
import SwiftXCTest
#else
import Foundation
import XCTest
#endif

// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+
Expand Down
6 changes: 3 additions & 3 deletions Tests/Functional/Asynchronous/Misuse/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// RUN: %T/Misuse > %t || true
// RUN: %{xctest_checker} %t %s

#if os(Linux) || os(FreeBSD)
import XCTest
#else
#if os(macOS)
import SwiftXCTest
#else
import XCTest
#endif

// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
// RUN: %T/Asynchronous-Notifications > %t || true
// RUN: %{xctest_checker} %t %s

#if os(Linux) || os(FreeBSD)
import XCTest
import Foundation
#else
import SwiftXCTest
#if os(macOS)
import SwiftFoundation
import SwiftXCTest
#else
import Foundation
import XCTest
#endif


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

Expand Down
10 changes: 5 additions & 5 deletions Tests/Functional/Asynchronous/Notifications/Handler/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// RUN: %T/Asynchronous-Notifications-Handler > %t || true
// RUN: %{xctest_checker} %t %s

#if os(Linux) || os(FreeBSD)
import XCTest
import Foundation
#else
import SwiftXCTest
#if os(macOS)
import SwiftFoundation
import SwiftXCTest
#else
import Foundation
import XCTest
#endif

// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+
Expand Down
10 changes: 5 additions & 5 deletions Tests/Functional/Asynchronous/Predicates/Expectations/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// RUN: %T/Asynchronous-Predicates > %t || true
// RUN: %{xctest_checker} %t %s

#if os(Linux) || os(FreeBSD)
import XCTest
import Foundation
#else
import SwiftXCTest
#if os(macOS)
import SwiftFoundation
import SwiftXCTest
#else
import Foundation
import XCTest
#endif

// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+
Expand Down
10 changes: 5 additions & 5 deletions Tests/Functional/Asynchronous/Predicates/Handler/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// RUN: %T/Asynchronous-Predicates-Handler > %t || true
// RUN: %{xctest_checker} %t %s

#if os(Linux) || os(FreeBSD)
import XCTest
import Foundation
#else
import SwiftXCTest
#if os(macOS)
import SwiftFoundation
import SwiftXCTest
#else
import Foundation
import XCTest
#endif

// CHECK: Test Suite 'All tests' started at \d+:\d+:\d+\.\d+
Expand Down
Loading