@@ -717,26 +717,82 @@ def collect_test_socket(info_add):
717
717
copy_attributes (info_add , test_socket , 'test_socket.%s' , attributes )
718
718
719
719
720
- def collect_test_support (info_add ):
720
+ def collect_support (info_add ):
721
721
try :
722
722
from test import support
723
723
except ImportError :
724
724
return
725
725
726
- attributes = ('IPV6_ENABLED' ,)
727
- copy_attributes (info_add , support , 'test_support.%s' , attributes )
726
+ attributes = (
727
+ 'has_fork_support' ,
728
+ 'has_socket_support' ,
729
+ 'has_strftime_extensions' ,
730
+ 'has_subprocess_support' ,
731
+ 'is_android' ,
732
+ 'is_emscripten' ,
733
+ 'is_jython' ,
734
+ 'is_wasi' ,
735
+ )
736
+ copy_attributes (info_add , support , 'support.%s' , attributes )
728
737
729
- call_func (info_add , 'test_support ._is_gui_available' , support , '_is_gui_available' )
730
- call_func (info_add , 'test_support .python_is_optimized' , support , 'python_is_optimized' )
738
+ call_func (info_add , 'support ._is_gui_available' , support , '_is_gui_available' )
739
+ call_func (info_add , 'support .python_is_optimized' , support , 'python_is_optimized' )
731
740
732
- info_add ('test_support .check_sanitizer(address=True)' ,
741
+ info_add ('support .check_sanitizer(address=True)' ,
733
742
support .check_sanitizer (address = True ))
734
- info_add ('test_support .check_sanitizer(memory=True)' ,
743
+ info_add ('support .check_sanitizer(memory=True)' ,
735
744
support .check_sanitizer (memory = True ))
736
- info_add ('test_support .check_sanitizer(ub=True)' ,
745
+ info_add ('support .check_sanitizer(ub=True)' ,
737
746
support .check_sanitizer (ub = True ))
738
747
739
748
749
+ def collect_support_os_helper (info_add ):
750
+ try :
751
+ from test .support import os_helper
752
+ except ImportError :
753
+ return
754
+
755
+ for name in (
756
+ 'can_symlink' ,
757
+ 'can_xattr' ,
758
+ 'can_chmod' ,
759
+ 'can_dac_override' ,
760
+ ):
761
+ func = getattr (os_helper , name )
762
+ info_add (f'support_os_helper.{ name } ' , func ())
763
+
764
+
765
+ def collect_support_socket_helper (info_add ):
766
+ try :
767
+ from test .support import socket_helper
768
+ except ImportError :
769
+ return
770
+
771
+ attributes = (
772
+ 'IPV6_ENABLED' ,
773
+ 'has_gethostname' ,
774
+ )
775
+ copy_attributes (info_add , socket_helper , 'support_socket_helper.%s' , attributes )
776
+
777
+ for name in (
778
+ 'tcp_blackhole' ,
779
+ ):
780
+ func = getattr (socket_helper , name )
781
+ info_add (f'support_socket_helper.{ name } ' , func ())
782
+
783
+
784
+ def collect_support_threading_helper (info_add ):
785
+ try :
786
+ from test .support import threading_helper
787
+ except ImportError :
788
+ return
789
+
790
+ attributes = (
791
+ 'can_start_thread' ,
792
+ )
793
+ copy_attributes (info_add , threading_helper , 'support_threading_helper.%s' , attributes )
794
+
795
+
740
796
def collect_cc (info_add ):
741
797
import subprocess
742
798
import sysconfig
@@ -938,7 +994,10 @@ def collect_info(info):
938
994
939
995
# Collecting from tests should be last as they have side effects.
940
996
collect_test_socket ,
941
- collect_test_support ,
997
+ collect_support ,
998
+ collect_support_os_helper ,
999
+ collect_support_socket_helper ,
1000
+ collect_support_threading_helper ,
942
1001
):
943
1002
try :
944
1003
collect_func (info_add )
0 commit comments