@@ -26,11 +26,6 @@ struct SectionBounds: Sendable {
26
26
enum Kind : Equatable , Hashable , CaseIterable {
27
27
/// The test content metadata section.
28
28
case testContent
29
-
30
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
31
- /// The type metadata section.
32
- case typeMetadata
33
- #endif
34
29
}
35
30
36
31
/// All section bounds of the given kind found in the current process.
@@ -62,10 +57,6 @@ extension SectionBounds.Kind {
62
57
switch self {
63
58
case . testContent:
64
59
( " __DATA_CONST " , " __swift5_tests " )
65
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
66
- case . typeMetadata:
67
- ( " __TEXT " , " __swift5_types " )
68
- #endif
69
60
}
70
61
}
71
62
}
@@ -190,10 +181,6 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<Section
190
181
let range = switch context. pointee. kind {
191
182
case . testContent:
192
183
sections. swift5_tests
193
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
194
- case . typeMetadata:
195
- sections. swift5_type_metadata
196
- #endif
197
184
}
198
185
let start = UnsafeRawPointer ( bitPattern: range. start)
199
186
let size = Int ( clamping: range. length)
@@ -282,10 +269,6 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<Section
282
269
let sectionName = switch kind {
283
270
case . testContent:
284
271
" .sw5test "
285
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
286
- case . typeMetadata:
287
- " .sw5tymd "
288
- #endif
289
272
}
290
273
return HMODULE . all. lazy. compactMap { _findSection ( named: sectionName, in: $0) }
291
274
}
@@ -315,25 +298,13 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<Section
315
298
#if SWT_TARGET_OS_APPLE
316
299
@_silgen_name ( raw: " section$start$__DATA_CONST$__swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionBegin : CChar
317
300
@_silgen_name ( raw: " section$end$__DATA_CONST$__swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionEnd: CChar
318
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
319
- @_silgen_name ( raw: " section$start$__TEXT$__swift5_types " ) private nonisolated ( unsafe) var _typeMetadataSectionBegin : CChar
320
- @_silgen_name ( raw: " section$end$__TEXT$__swift5_types " ) private nonisolated ( unsafe) var _typeMetadataSectionEnd: CChar
321
- #endif
322
301
#elseif os(WASI)
323
302
@_silgen_name ( raw: " __start_swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionBegin : CChar
324
303
@_silgen_name ( raw: " __stop_swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionEnd: CChar
325
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
326
- @_silgen_name ( raw: " __start_swift5_type_metadata " ) private nonisolated ( unsafe) var _typeMetadataSectionBegin : CChar
327
- @_silgen_name ( raw: " __stop_swift5_type_metadata " ) private nonisolated ( unsafe) var _typeMetadataSectionEnd: CChar
328
- #endif
329
304
#else
330
305
#warning("Platform-specific implementation missing: Runtime test discovery unavailable (static)")
331
306
private nonisolated ( unsafe) var _testContentSectionBegin : Void
332
307
private nonisolated ( unsafe) var _testContentSectionEnd: Void
333
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
334
- private nonisolated ( unsafe) var _typeMetadataSectionBegin : Void
335
- private nonisolated ( unsafe) var _typeMetadataSectionEnd: Void
336
- #endif
337
308
338
309
extension UnsafeRawBufferPointer {
339
310
/// Construct an empty buffer.
@@ -360,16 +331,12 @@ extension UnsafeRawBufferPointer {
360
331
/// - Parameters:
361
332
/// - kind: Which kind of metadata section to return.
362
333
///
363
- /// - Returns: A structure describing the bounds of the type metadata section
364
- /// contained in the same image as the testing library itself.
334
+ /// - Returns: A structure describing the bounds of the given section contained
335
+ /// in the same image as the testing library itself.
365
336
private func _sectionBounds( _ kind: SectionBounds . Kind ) -> some Sequence < SectionBounds > {
366
337
let buffer = switch kind {
367
338
case . testContent:
368
339
UnsafeRawBufferPointer ( sectionBegin: & _testContentSectionBegin, sectionEnd: & _testContentSectionEnd)
369
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
370
- case . typeMetadata:
371
- UnsafeRawBufferPointer ( sectionBegin: & _typeMetadataSectionBegin, sectionEnd: & _typeMetadataSectionEnd)
372
- #endif
373
340
}
374
341
let sb = SectionBounds ( imageAddress: nil , buffer: buffer)
375
342
return CollectionOfOne ( sb)
0 commit comments