Skip to content

Commit fdf2754

Browse files
authored
Remove swt_copyABIEntryPoint_v0(). (swiftlang#1240)
1 parent 5fecefc commit fdf2754

File tree

2 files changed

+0
-106
lines changed

2 files changed

+0
-106
lines changed

Sources/Testing/ABI/EntryPoints/ABIEntryPoint.swift

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -75,46 +75,4 @@ extension ABI.v0 {
7575
@usableFromInline func abiv0_getEntryPoint() -> UnsafeRawPointer {
7676
unsafeBitCast(ABI.v0.entryPoint, to: UnsafeRawPointer.self)
7777
}
78-
79-
#if !SWT_NO_SNAPSHOT_TYPES
80-
// MARK: - Xcode 16 compatibility
81-
82-
extension ABI.Xcode16 {
83-
/// An older signature for ``ABI/v0/EntryPoint-swift.typealias`` used by
84-
/// Xcode 16.
85-
///
86-
/// - Warning: This type will be removed in a future update.
87-
@available(*, deprecated, message: "Use ABI.v0.EntryPoint instead.")
88-
typealias EntryPoint = @Sendable (
89-
_ argumentsJSON: UnsafeRawBufferPointer?,
90-
_ recordHandler: @escaping @Sendable (_ recordJSON: UnsafeRawBufferPointer) -> Void
91-
) async throws -> CInt
92-
}
93-
94-
/// An older signature for ``ABI/v0/entryPoint-swift.type.property`` used by
95-
/// Xcode 16.
96-
///
97-
/// - Warning: This function will be removed in a future update.
98-
@available(*, deprecated, message: "Use ABI.v0.entryPoint (swt_abiv0_getEntryPoint()) instead.")
99-
@_cdecl("swt_copyABIEntryPoint_v0")
100-
@usableFromInline func copyABIEntryPoint_v0() -> UnsafeMutableRawPointer {
101-
let result = UnsafeMutablePointer<ABI.Xcode16.EntryPoint>.allocate(capacity: 1)
102-
result.initialize { configurationJSON, recordHandler in
103-
var args = try configurationJSON.map { configurationJSON in
104-
try JSON.decode(__CommandLineArguments_v0.self, from: configurationJSON)
105-
}
106-
if args?.eventStreamVersion == nil {
107-
args?.eventStreamVersion = ABI.Xcode16.versionNumber
108-
}
109-
let eventHandler = try eventHandlerForStreamingEvents(version: args?.eventStreamVersion, encodeAsJSONLines: false, forwardingTo: recordHandler)
110-
111-
var exitCode = await Testing.entryPoint(passing: args, eventHandler: eventHandler)
112-
if exitCode == EXIT_NO_TESTS_FOUND {
113-
exitCode = EXIT_SUCCESS
114-
}
115-
return exitCode
116-
}
117-
return .init(result)
118-
}
119-
#endif
12078
#endif

Tests/TestingTests/ABIEntryPointTests.swift

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,70 +18,6 @@ private import _TestingInternals
1818

1919
@Suite("ABI entry point tests")
2020
struct ABIEntryPointTests {
21-
#if !SWT_NO_SNAPSHOT_TYPES
22-
@available(*, deprecated)
23-
@Test func v0_experimental() async throws {
24-
var arguments = __CommandLineArguments_v0()
25-
arguments.filter = ["NonExistentTestThatMatchesNothingHopefully"]
26-
arguments.eventStreamVersion = 0
27-
arguments.verbosity = .min
28-
29-
let result = try await _invokeEntryPointV0Experimental(passing: arguments) { recordJSON in
30-
let record = try! JSON.decode(ABI.Record<ABI.v0>.self, from: recordJSON)
31-
_ = record.kind
32-
}
33-
34-
#expect(result == EXIT_SUCCESS)
35-
}
36-
37-
@available(*, deprecated)
38-
@Test("v0 experimental entry point with a large number of filter arguments")
39-
func v0_experimental_manyFilters() async throws {
40-
var arguments = __CommandLineArguments_v0()
41-
arguments.filter = (1...100).map { "NonExistentTestThatMatchesNothingHopefully_\($0)" }
42-
arguments.eventStreamVersion = 0
43-
arguments.verbosity = .min
44-
45-
let result = try await _invokeEntryPointV0Experimental(passing: arguments)
46-
47-
#expect(result == EXIT_SUCCESS)
48-
}
49-
50-
@available(*, deprecated)
51-
private func _invokeEntryPointV0Experimental(
52-
passing arguments: __CommandLineArguments_v0,
53-
recordHandler: @escaping @Sendable (_ recordJSON: UnsafeRawBufferPointer) -> Void = { _ in }
54-
) async throws -> CInt {
55-
#if !SWT_NO_DYNAMIC_LINKING
56-
// Get the ABI entry point by dynamically looking it up at runtime.
57-
let copyABIEntryPoint_v0 = try withTestingLibraryImageAddress { testingLibrary in
58-
try #require(
59-
symbol(in: testingLibrary, named: "swt_copyABIEntryPoint_v0").map {
60-
castCFunction(at: $0, to: (@convention(c) () -> UnsafeMutableRawPointer).self)
61-
}
62-
)
63-
}
64-
#endif
65-
let abiEntryPoint = copyABIEntryPoint_v0().assumingMemoryBound(to: ABI.Xcode16.EntryPoint.self)
66-
defer {
67-
abiEntryPoint.deinitialize(count: 1)
68-
abiEntryPoint.deallocate()
69-
}
70-
71-
let argumentsJSON = try JSON.withEncoding(of: arguments) { argumentsJSON in
72-
let result = UnsafeMutableRawBufferPointer.allocate(byteCount: argumentsJSON.count, alignment: 1)
73-
result.copyMemory(from: argumentsJSON)
74-
return result
75-
}
76-
defer {
77-
argumentsJSON.deallocate()
78-
}
79-
80-
// Call the entry point function.
81-
return try await abiEntryPoint.pointee(.init(argumentsJSON), recordHandler)
82-
}
83-
#endif
84-
8521
@Test func v0() async throws {
8622
var arguments = __CommandLineArguments_v0()
8723
arguments.filter = ["NonExistentTestThatMatchesNothingHopefully"]

0 commit comments

Comments
 (0)