Files
swift-collections/Tests/_CollectionsTestSupport/AssertionContexts/CollectionTestCase.swift
T
Karoy Lorentey f17cf642c1 Add support building with COLLECTIONS_SINGLE_MODULE
- Sources/_CollectionsTestSupport → Tests/_CollectionsTestSupport
- Refactor Package.swift to allow switching between the default
   polymodule and the new monomodule product configurations
   (by editing the manifest file).
- Fix build errors in the monomodule variant.
2023-03-22 21:44:23 -07:00

45 lines
1.2 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import XCTest
open class CollectionTestCase: XCTestCase {
internal var _context: TestContext?
public var context: TestContext { _context! }
open var isAvailable: Bool { true }
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
open override func invokeTest() {
guard isAvailable else {
print("\(Self.self) unavailable; skipping")
return
}
return super.invokeTest()
}
#endif
open override func setUp() {
super.setUp()
_context = TestContext.pushNew()
}
open override func tearDown() {
if let context = _context {
TestContext.pop(context)
_context = nil
}
super.tearDown()
}
}