@@ -26,11 +26,6 @@ struct SectionBounds: Sendable {
2626 enum Kind : Equatable , Hashable , CaseIterable {
2727 /// The test content metadata section.
2828 case testContent
29-
30- #if !SWT_NO_LEGACY_TEST_DISCOVERY
31- /// The type metadata section.
32- case typeMetadata
33- #endif
3429 }
3530
3631 /// All section bounds of the given kind found in the current process.
@@ -62,10 +57,6 @@ extension SectionBounds.Kind {
6257 switch self {
6358 case . testContent:
6459 ( " __DATA_CONST " , " __swift5_tests " )
65- #if !SWT_NO_LEGACY_TEST_DISCOVERY
66- case . typeMetadata:
67- ( " __TEXT " , " __swift5_types " )
68- #endif
6960 }
7061 }
7162}
@@ -190,10 +181,6 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<Section
190181 let range = switch context. pointee. kind {
191182 case . testContent:
192183 sections. swift5_tests
193- #if !SWT_NO_LEGACY_TEST_DISCOVERY
194- case . typeMetadata:
195- sections. swift5_type_metadata
196- #endif
197184 }
198185 let start = UnsafeRawPointer ( bitPattern: range. start)
199186 let size = Int ( clamping: range. length)
@@ -282,10 +269,6 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<Section
282269 let sectionName = switch kind {
283270 case . testContent:
284271 " .sw5test "
285- #if !SWT_NO_LEGACY_TEST_DISCOVERY
286- case . typeMetadata:
287- " .sw5tymd "
288- #endif
289272 }
290273 return HMODULE . all. lazy. compactMap { _findSection ( named: sectionName, in: $0) }
291274}
@@ -315,25 +298,13 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<Section
315298#if SWT_TARGET_OS_APPLE
316299@_silgen_name ( raw: " section$start$__DATA_CONST$__swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionBegin : CChar
317300@_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
322301#elseif os(WASI)
323302@_silgen_name ( raw: " __start_swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionBegin : CChar
324303@_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
329304#else
330305#warning("Platform-specific implementation missing: Runtime test discovery unavailable (static)")
331306private nonisolated ( unsafe) var _testContentSectionBegin : Void
332307private 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
337308
338309extension UnsafeRawBufferPointer {
339310 /// Construct an empty buffer.
@@ -360,16 +331,12 @@ extension UnsafeRawBufferPointer {
360331/// - Parameters:
361332/// - kind: Which kind of metadata section to return.
362333///
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.
365336private func _sectionBounds( _ kind: SectionBounds . Kind ) -> some Sequence < SectionBounds > {
366337 let buffer = switch kind {
367338 case . testContent:
368339 UnsafeRawBufferPointer ( sectionBegin: & _testContentSectionBegin, sectionEnd: & _testContentSectionEnd)
369- #if !SWT_NO_LEGACY_TEST_DISCOVERY
370- case . typeMetadata:
371- UnsafeRawBufferPointer ( sectionBegin: & _typeMetadataSectionBegin, sectionEnd: & _typeMetadataSectionEnd)
372- #endif
373340 }
374341 let sb = SectionBounds ( imageAddress: nil , buffer: buffer)
375342 return CollectionOfOne ( sb)
0 commit comments