@@ -18,70 +18,6 @@ private import _TestingInternals
18
18
19
19
@Suite ( " ABI entry point tests " )
20
20
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
-
85
21
@Test func v0( ) async throws {
86
22
var arguments = __CommandLineArguments_v0 ( )
87
23
arguments. filter = [ " NonExistentTestThatMatchesNothingHopefully " ]
0 commit comments