Skip to content

Commit

Permalink
Disable test registration outside of CMake builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lorentey committed Mar 18, 2023
1 parent 6fcf644 commit 12cc95b
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Tests/AtomicsTests/AtomicLazyReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AtomicLazyReferenceTests: XCTestCase {
XCTAssertEqual(LifetimeTracked.instances, 0)
}

#if !SWIFT_PACKAGE
#if !SWIFT_PACKAGE && CMAKE
public static var allTests = [
("test_unsafe_create_destroy", test_unsafe_create_destroy),
("test_unsafe_storeIfNilThenLoad", test_unsafe_storeIfNilThenLoad),
Expand Down
5 changes: 3 additions & 2 deletions Tests/AtomicsTests/Basics.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2023 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
Expand Down Expand Up @@ -377,7 +377,7 @@ class BasicAtomic${label}Tests: XCTestCase {
% end
% end


#if !SWIFT_PACKAGE && CMAKE
public static var allTests: [(String, (BasicAtomic${label}Tests) -> () -> ())] = [
("test_create_destroy", test_create_destroy),
% for (order, _) in loadOrderings:
Expand Down Expand Up @@ -424,5 +424,6 @@ class BasicAtomic${label}Tests: XCTestCase {
% end
% end
]
#endif
}
% end
4 changes: 2 additions & 2 deletions Tests/AtomicsTests/DoubleWord.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2023 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
Expand Down Expand Up @@ -87,7 +87,7 @@ class DoubleWordTests: XCTestCase {
#endif
}

#if !SWIFT_PACKAGE
#if !SWIFT_PACKAGE && CMAKE
public static var allTests = [
("testMemoryLayout", testMemoryLayout),
("testFirstSecondInitializer", testFirstSecondInitializer),
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicsTests/LockFreeQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2023 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
Expand Down Expand Up @@ -184,7 +184,7 @@ class QueueTests: XCTestCase {
check(readers: 16, writers: 16, count: iterations)
}

#if !SWIFT_PACKAGE
#if !SWIFT_PACKAGE && CMAKE
public static var allTests = [
("test01_10", test01_10),
("test02_10", test02_10),
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicsTests/LockFreeSingleConsumerStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2023 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
Expand Down Expand Up @@ -143,7 +143,7 @@ class LockFreeSingleConsumerStackTests: XCTestCase {
}
}

#if !SWIFT_PACKAGE
#if !SWIFT_PACKAGE && CMAKE
public static var allTests = [
("test_Basics", test_Basics),
("test_ConcurrentPushes", test_ConcurrentPushes),
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicsTests/StrongReferenceRace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2023 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
Expand Down Expand Up @@ -233,7 +233,7 @@ class StrongReferenceRace: XCTestCase {
func testLifetimes_08() { checkLifetimes(count: 8, iterations: iterations) }
func testLifetimes_16() { checkLifetimes(count: 16, iterations: iterations) }

#if !SWIFT_PACKAGE
#if !SWIFT_PACKAGE && CMAKE
public static var allTests = [
("testLoad1", testLoad1),
("testLoad2", testLoad2),
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicsTests/StrongReferenceShuffle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2023 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
Expand Down Expand Up @@ -264,7 +264,7 @@ class StrongReferenceShuffleTests: XCTestCase {
func test_sink_04_08() { checkSink(writers: 4, readers: 8, iterations: iterations) }
func test_sink_08_08() { checkSink(writers: 8, readers: 8, iterations: iterations) }

#if !SWIFT_PACKAGE
#if !SWIFT_PACKAGE && CMAKE
public static var allTests = [
("test_sink_01_00", test_sink_01_00),
("test_sink_02_00", test_sink_02_00),
Expand Down
Loading

0 comments on commit 12cc95b

Please sign in to comment.