Split Basics.swift.gyb up into 26 different files

The original autogenerated swift file is so humongous that it causes problems for some folks.

Split it up into one file per XCTestCase.
This commit is contained in:
Karoy Lorentey committed 2023-03-18 01:27:16 -07:00
1 parent 45772d95ff
commit 8ca2dee2bf
57 files changed
+52661 -49886

No files matched your search

+26 -1
View File
@@ -44,7 +44,32 @@ let package = Package(
dependencies: ["Atomics"],
exclude: [
"main.swift",
"Basics.swift.gyb"
"Basics/BasicTests.gyb-template",
"Basics/BasicAtomicBoolTests.swift.gyb",
"Basics/BasicAtomicDoubleWordTests.swift.gyb",
"Basics/BasicAtomicInt16Tests.swift.gyb",
"Basics/BasicAtomicInt32Tests.swift.gyb",
"Basics/BasicAtomicInt64Tests.swift.gyb",
"Basics/BasicAtomicInt8Tests.swift.gyb",
"Basics/BasicAtomicIntTests.swift.gyb",
"Basics/BasicAtomicMutablePointerTests.swift.gyb",
"Basics/BasicAtomicMutableRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalMutablePointerTests.swift.gyb",
"Basics/BasicAtomicOptionalMutableRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalReferenceTests.swift.gyb",
"Basics/BasicAtomicOptionalUnmanagedTests.swift.gyb",
"Basics/BasicAtomicPointerTests.swift.gyb",
"Basics/BasicAtomicRawPointerTests.swift.gyb",
"Basics/BasicAtomicRawRepresentableTests.swift.gyb",
"Basics/BasicAtomicReferenceTests.swift.gyb",
"Basics/BasicAtomicUInt16Tests.swift.gyb",
"Basics/BasicAtomicUInt32Tests.swift.gyb",
"Basics/BasicAtomicUInt64Tests.swift.gyb",
"Basics/BasicAtomicUInt8Tests.swift.gyb",
"Basics/BasicAtomicUIntTests.swift.gyb",
"Basics/BasicAtomicUnmanagedTests.swift.gyb",
]
),
]
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Bool", "Bool", "true", "false"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("DoubleWord", "DoubleWord", "DoubleWord(high: 100, low: 64)", "DoubleWord(high: 50, low: 32)"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Int16", "Int16", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Int32", "Int32", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Int64", "Int64", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Int8", "Int8", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Int", "Int", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("MutablePointer", "UnsafeMutablePointer<Foo>", "_mfoo1", "_mfoo2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("MutableRawPointer", "UnsafeMutableRawPointer", "_mraw1", "_mraw2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("OptionalMutablePointer", "UnsafeMutablePointer<Foo>?", "nil", "_mfoo2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("OptionalMutableRawPointer", "UnsafeMutableRawPointer?", "nil", "_mraw2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("OptionalPointer", "UnsafePointer<Foo>?", "nil", "_foo2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("OptionalRawPointer", "UnsafeRawPointer?", "nil", "_raw2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("OptionalReference", "Baz?", "nil", "_baz2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("OptionalUnmanaged", "Unmanaged<Bar>?", "nil", "_bar2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Pointer", "UnsafePointer<Foo>", "_foo1", "_foo2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("RawPointer", "UnsafeRawPointer", "_raw1", "_raw2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("RawRepresentable", "Fred", "Fred.one", "Fred.two"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Reference", "Baz", "_baz1", "_baz2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("UInt16", "UInt16", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,22 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("UInt32", "UInt32", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("UInt64", "UInt64", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("UInt8", "UInt8", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("UInt", "UInt", "12", "23"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
from gyb import expand
types = [
# Label Type a b
("Unmanaged", "Unmanaged<Bar>", "_bar1", "_bar2"),
]
}%
${expand("BasicTests.gyb-template", line_directive='', types=types)}
@@ -0,0 +1,48 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import Atomics
extension Unmanaged: Equatable { // FIXME: This is terrible
public static func ==(left: Self, right: Self) -> Bool {
left.toOpaque() == right.toOpaque()
}
}
struct Foo: Equatable, CustomStringConvertible {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Foo(\(value))" }
}
class Bar: Equatable, CustomStringConvertible {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Bar(\(value))" }
static func ==(left: Bar, right: Bar) -> Bool {
left === right
}
}
final class Baz: Equatable, CustomStringConvertible, AtomicReference {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Bar(\(value))" }
static func ==(left: Baz, right: Baz) -> Bool {
left === right
}
}
enum Fred: Int, AtomicValue {
case one
case two
}
@@ -1,95 +1,25 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
%{
#===----------------------------------------------------------------------===
#
# This source file is part of the Swift Atomics open source project
#
# 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
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
#===----------------------------------------------------------------------===
from gyb_utils import (
autogenerated_warning, loadOrderings, storeOrderings, updateOrderings,
boolOperations, integerOperations, lowerFirst, argLabel)
types = [
("Int", "Int", "12", "23"),
("Int8", "Int8", "12", "23"),
("Int16", "Int16", "12", "23"),
("Int32", "Int32", "12", "23"),
("Int64", "Int64", "12", "23"),
("UInt", "UInt", "12", "23"),
("UInt8", "UInt8", "12", "23"),
("UInt16", "UInt16", "12", "23"),
("UInt32", "UInt32", "12", "23"),
("UInt64", "UInt64", "12", "23"),
("Bool", "Bool", "true", "false"),
("Pointer", "UnsafePointer<Foo>", "_foo1", "_foo2"),
("OptionalPointer", "UnsafePointer<Foo>?", "nil", "_foo2"),
("MutablePointer", "UnsafeMutablePointer<Foo>", "_mfoo1", "_mfoo2"),
("OptionalMutablePointer", "UnsafeMutablePointer<Foo>?", "nil", "_mfoo2"),
("RawPointer", "UnsafeRawPointer", "_raw1", "_raw2"),
("OptionalRawPointer", "UnsafeRawPointer?", "nil", "_raw2"),
("MutableRawPointer", "UnsafeMutableRawPointer", "_mraw1", "_mraw2"),
("OptionalMutableRawPointer", "UnsafeMutableRawPointer?", "nil", "_mraw2"),
("Unmanaged", "Unmanaged<Bar>", "_bar1", "_bar2"),
("OptionalUnmanaged", "Unmanaged<Bar>?", "nil", "_bar2"),
("RawRepresentable", "Fred", "Fred.one", "Fred.two"),
("DoubleWord", "DoubleWord", "DoubleWord(high: 100, low: 64)", "DoubleWord(high: 50, low: 32)"),
("Reference", "Baz", "_baz1", "_baz2"),
("OptionalReference", "Baz?", "nil", "_baz2"),
]
}%
${autogenerated_warning()}
import XCTest
import Atomics
extension Unmanaged: Equatable { // FIXME: This is terrible
public static func ==(left: Self, right: Self) -> Bool {
left.toOpaque() == right.toOpaque()
}
}
private struct Foo: Equatable, CustomStringConvertible {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Foo(\(value))" }
}
private class Bar: Equatable, CustomStringConvertible {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Bar(\(value))" }
static func ==(left: Bar, right: Bar) -> Bool {
left === right
}
}
private final class Baz: Equatable, CustomStringConvertible, AtomicReference {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Bar(\(value))" }
static func ==(left: Baz, right: Baz) -> Bool {
left === right
}
}
private enum Fred: Int, AtomicValue {
case one
case two
}
% for label, type, a, b in types:
/// Exercises all operations in a single-threaded context, verifying
/// they provide the expected results.
@@ -160,6 +90,7 @@ class BasicAtomic${label}Tests: XCTestCase {
defer { w.destroy() }
XCTAssertEqual(w.load(ordering: .${order}), ${b})
}
% end
% for (order, _) in storeOrderings:
@@ -174,6 +105,7 @@ class BasicAtomic${label}Tests: XCTestCase {
w.store(${a}, ordering: .${order})
XCTAssertEqual(w.load(ordering: .relaxed), ${a})
}
% end
% for (order, _, _) in updateOrderings:
@@ -190,6 +122,7 @@ class BasicAtomic${label}Tests: XCTestCase {
XCTAssertEqual(v.exchange(${b}, ordering: .${order}), ${b})
XCTAssertEqual(v.load(ordering: .relaxed), ${b})
}
% end
% for (order, _, _) in updateOrderings:
@@ -229,6 +162,7 @@ class BasicAtomic${label}Tests: XCTestCase {
XCTAssertEqual(original, ${a})
XCTAssertEqual(v.load(ordering: .relaxed), ${a})
}
% end
% for operation in ["compareExchange", "weakCompareExchange"]:
@@ -274,6 +208,7 @@ class BasicAtomic${label}Tests: XCTestCase {
XCTAssertEqual(original, ${a})
XCTAssertEqual(v.load(ordering: .relaxed), ${a})
}
% end
% end
% end
@@ -300,6 +235,7 @@ class BasicAtomic${label}Tests: XCTestCase {
}
}
}
% end
% end
@@ -324,6 +260,7 @@ class BasicAtomic${label}Tests: XCTestCase {
}
}
}
% end
% end
% end
@@ -350,6 +287,7 @@ class BasicAtomic${label}Tests: XCTestCase {
XCTAssertEqual(old2, result1)
XCTAssertEqual(v.load(ordering: .relaxed), result2)
}
% end
% end
@@ -373,6 +311,7 @@ class BasicAtomic${label}Tests: XCTestCase {
XCTAssertEqual(new2, result2)
XCTAssertEqual(v.load(ordering: .relaxed), result2)
}
% end
% end
% end
@@ -427,3 +366,8 @@ class BasicAtomic${label}Tests: XCTestCase {
#endif
}
% end
%{
# Local Variables:
# mode: swift
# End:
}%
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+18 -32
View File
@@ -15,51 +15,37 @@ import XCTest
var testCases = [
// Basics
testCase(BasicAtomicIntTests.allTests),
testCase(BasicAtomicInt8Tests.allTests),
testCase(BasicAtomicBoolTests.allTests),
testCase(BasicAtomicDoubleWordTests.allTests),
testCase(BasicAtomicInt16Tests.allTests),
testCase(BasicAtomicInt32Tests.allTests),
testCase(BasicAtomicInt64Tests.allTests),
testCase(BasicAtomicUIntTests.allTests),
testCase(BasicAtomicUInt8Tests.allTests),
testCase(BasicAtomicInt8Tests.allTests),
testCase(BasicAtomicIntTests.allTests),
testCase(BasicAtomicMutablePointerTests.allTests),
testCase(BasicAtomicMutableRawPointerTests.allTests),
testCase(BasicAtomicOptionalMutablePointerTests.allTests),
testCase(BasicAtomicOptionalMutableRawPointerTests.allTests),
testCase(BasicAtomicOptionalPointerTests.allTests),
testCase(BasicAtomicOptionalRawPointerTests.allTests),
testCase(BasicAtomicOptionalReferenceTests.allTests),
testCase(BasicAtomicOptionalUnmanagedTests.allTests),
testCase(BasicAtomicPointerTests.allTests),
testCase(BasicAtomicRawPointerTests.allTests),
testCase(BasicAtomicRawRepresentableTests.allTests),
testCase(BasicAtomicReferenceTests.allTests),
testCase(BasicAtomicUInt16Tests.allTests),
testCase(BasicAtomicUInt32Tests.allTests),
testCase(BasicAtomicUInt64Tests.allTests),
testCase(BasicAtomicBoolTests.allTests),
testCase(BasicAtomicPointerTests.allTests),
testCase(BasicAtomicOptionalPointerTests.allTests),
testCase(BasicAtomicMutablePointerTests.allTests),
testCase(BasicAtomicOptionalMutablePointerTests.allTests),
testCase(BasicAtomicRawPointerTests.allTests),
testCase(BasicAtomicOptionalRawPointerTests.allTests),
testCase(BasicAtomicMutableRawPointerTests.allTests),
testCase(BasicAtomicOptionalMutableRawPointerTests.allTests),
testCase(BasicAtomicUInt8Tests.allTests),
testCase(BasicAtomicUIntTests.allTests),
testCase(BasicAtomicUnmanagedTests.allTests),
testCase(BasicAtomicOptionalUnmanagedTests.allTests),
testCase(BasicAtomicRawRepresentableTests.allTests),
// LockFreeSingleConsumerStackTests
testCase(LockFreeSingleConsumerStackTests.allTests),
// DoubleWord
testCase(DoubleWordTests.allTests),
// AtomicLazyReference
testCase(AtomicLazyReferenceTests.allTests),
]
testCases += [
testCase(BasicAtomicDoubleWordTests.allTests),
testCase(BasicAtomicReferenceTests.allTests),
testCase(BasicAtomicOptionalReferenceTests.allTests),
// LockFreeQueue
testCase(QueueTests.allTests),
// StrongReferenceRace
testCase(StrongReferenceRace.allTests),
// StrongReferenceShuffle
testCase(StrongReferenceShuffleTests.allTests),
]
+27 -3
View File
@@ -14,14 +14,38 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) # FIXME Hook this up on Darwin
add_executable(AtomicsTestBundle
AtomicsTests/main.swift
AtomicsTests/autogenerated/Basics.swift
AtomicsTests/Basics/BasicTestSupport.swift
AtomicsTests/Basics/autogenerated/BasicAtomicBoolTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicDoubleWordTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicInt16Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicInt32Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicInt64Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicInt8Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicIntTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicMutablePointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicMutableRawPointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicOptionalMutablePointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicOptionalMutableRawPointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicOptionalPointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicOptionalRawPointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicOptionalReferenceTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicOptionalUnmanagedTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicPointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicRawPointerTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicRawRepresentableTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicReferenceTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicUInt16Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicUInt32Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicUInt64Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicUInt8Tests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicUIntTests.swift
AtomicsTests/Basics/autogenerated/BasicAtomicUnmanagedTests.swift
AtomicsTests/DoubleWord.swift
AtomicsTests/LifetimeTracked.swift
AtomicsTests/LockFreeQueue.swift
AtomicsTests/LockFreeSingleConsumerStack.swift
AtomicsTests/StrongReferenceRace.swift
AtomicsTests/StrongReferenceShuffle.swift
AtomicsTests/UnsafeAtomicLazyReference.swift)
AtomicsTests/StrongReferenceShuffle.swift)
target_compile_options(AtomicsTestBundle PRIVATE "-DMANUAL_TEST_DISCOVERY")
+1 -1
View File
@@ -34,7 +34,7 @@ trap "rm -rf \"$tmpdir\"" EXIT
# Run gyb on each gyb file in the source tree and put results in
# subdirectories named 'autogenerated'.
for input in ./Sources/*/*.gyb ./Tests/*/*.gyb; do
find ./Sources ./Tests -name "*.gyb" | while read input; do
basename="$(basename "$input")"
targetdir="$(dirname "$input")/autogenerated"
output="$targetdir/"${basename%.gyb}