HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test__osx_support.cpython-37.pyc
B

��g�6�@svdZddlZddlZddlZddlZddlZddlZddlZe�	ej�
d�d�Gdd�dej��Ze
dkrre��dS)z=
Test suite for _osx_support: shared OS X support functions.
�N�darwinz
requires OS Xc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)&�Test_OSXSupportcCs`d|_d|_tj�t���|_tj�	�|_
|�|j
j�x"dD]}||j
kr>|j
�
|�q>WdS)NZbogus_program_xxxx)
�CFLAGS�LDFLAGS�CPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)ZmaxDiff�	prog_name�os�path�abspath�getcwd�
temp_path_dir�test�supportZEnvironmentVarGuard�env�
addCleanup�__exit__Zunset)�self�cv�r�2/usr/local/lib/python3.7/test/test__osx_support.py�setUps

zTest_OSXSupport.setUpcs����fdd��D��dS)Nc3s.|]&}�|�|krd|�|fVqdS)Z_OSX_SUPPORT_INITIAL_Nr)�.0�k)�config_vars�
expected_varsrr�	<genexpr>"szDTest_OSXSupport.add_expected_saved_initial_values.<locals>.<genexpr>)�update)rrrr)rrr�!add_expected_saved_initial_valuessz1Test_OSXSupport.add_expected_saved_initial_valuesc	Cs�|jdr|jdd|jd<|jdtj�|j�|jd<tj�|j�|�	t
�|j��|�tjj|j�t
|jd��}|�d�WdQRXt�|jtj�|�|jt
�|j��dS)N�PATH�:�wz#!/bin/sh
/bin/echo OK
)rrr
rrrr�unlinkrZassertIsNone�_osx_supportZ_find_executabler�open�write�chmod�stat�S_IRWXU�assertEqual)r�frrr�test__find_executable&s
z%Test_OSXSupport.test__find_executablec	Cs�|jdr|jdd|jd<|jdtj�|j�|jd<tj�|j�|�	tjj|j�t
|jd��}|�d�WdQRXt�|jt
j�|�dt�|j��dS)Nr"r#r$z##!/bin/sh
/bin/echo ExpectedOutput
ZExpectedOutput)rrr
rrrrr%rrr'r(r)r*r+r,r&Z_read_output)rr-rrr�test__read_output3s
z!Test_OSXSupport.test__read_outputcCs"t�d�}|�tj�|�d�dS)NZccz!cc not found - check xcode-select)r&Z_find_build_tool�
assertTruerr
�isfile)r�outrrr�test__find_build_tool?s
z%Test_OSXSupport.test__find_build_toolcCs |�t��d�t����dS)Nr)r0�platform�mac_ver�
startswithr&Z_get_system_version)rrrr�test__get_system_versionDsz(Test_OSXSupport.test__get_system_versioncCsLddi}ddi}d}d}t�|||�|�||�t�|�|�||�dS)Nr	zgcc-test -pthreadszclang -pthreads)r&�_save_modified_valueZassertNotEqualZ_remove_original_valuesr,)rrrr�newvaluerrr�test__remove_original_valuesHs
z,Test_OSXSupport.test__remove_original_valuescCsBddi}ddi}|�||�d}d}t�|||�|�||�dS)Nr	zgcc-test -pthreadszclang -pthreads)r!r&r8r,)rrrrr9rrr�test__save_modified_valueVsz)Test_OSXSupport.test__save_modified_valuecCs6ddi}|��}d}d}t�|||�|�||�dS)Nr	zgcc-test -pthreads)�copyr&r8r,)rrrrr9rrr�#test__save_modified_value_unchangedcsz3Test_OSXSupport.test__save_modified_value_unchangedcCsHddl}tdd�|��d�d�dd�D��}|�|dkt���dS)Nrcss|]}t|�VqdS)N)�int)r�irrrroszBTest_OSXSupport.test__supports_universal_builds.<locals>.<genexpr>�.�)�
�)r4�tupler5�splitr,r&Z_supports_universal_builds)rr4Z
mac_ver_tuplerrr�test__supports_universal_buildsms
 
z/Test_OSXSupport.test__supports_universal_buildsc
Cs�d}dddddddd	�}d
dddddd
d	�}|�||�|jdrPd|jdnd}tj�|j�||jd<x^|D]V\}}tj�|�|�	tjj|�t
|d��}|�d|�WdQRXt�|t
j�qrW|�|t�|��dS)N))zgcc-testz i686-apple-darwin11-llvm-gcc-4.2)�clangzclang version 3.1zgcc-test -pthreadsz	cc++-testz3-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  z-arch ppc -arch i386   -gz--I. -isysroot /Developer/SDKs/MacOSX10.4u.sdkz(gcc-test -bundle -arch ppc -arch i386 -gzRgcc-test -bundle -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g)r	r
rrrrrzclang -pthreadszclang++z%clang -bundle -arch ppc -arch i386 -gzOclang -bundle -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -gr"r#�r$z#!/bin/sh
/bin/echo )r!rrr
rrrrr%rr'r(r)r*r+r,r&Z_find_appropriate_compiler)rZ	compilersrr�suffix�c_nameZc_outputr-rrr�test__find_appropriate_compilerts6z/Test_OSXSupport.test__find_appropriate_compilercCsBdddddd�}ddd	d
dd�}|�||�|�|t�|��dS)Nz3-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  z-arch ppc -arch i386   -gz--I. -isysroot /Developer/SDKs/MacOSX10.4u.sdkz(gcc-4.0 -bundle  -arch ppc -arch i386 -gzRgcc-4.0 -bundle  -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g)rrrrrz -fno-strict-aliasing  -g -O3    z    -gz-I.  zgcc-4.0 -bundle    -gzgcc-4.0 -bundle      -g)r!r,r&�_remove_universal_flags)rrrrrr�test__remove_universal_flags�sz,Test_OSXSupport.test__remove_universal_flagscCsBdddddd�}ddd	d
dd�}|�||�|�|t�|��dS)Nz3-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  z-arch ppc -arch i386   -gz,-I. -isysroot/Developer/SDKs/MacOSX10.4u.sdkz(gcc-4.0 -bundle  -arch ppc -arch i386 -gzQgcc-4.0 -bundle  -arch ppc -arch i386 -isysroot/Developer/SDKs/MacOSX10.4u.sdk -g)rrrrrz -fno-strict-aliasing  -g -O3    z    -gz-I.  zgcc-4.0 -bundle    -gzgcc-4.0 -bundle      -g)r!r,r&rL)rrrrrr�&test__remove_universal_flags_alternate�sz6Test_OSXSupport.test__remove_universal_flags_alternatec	Cs�ddddddd�}ddd	dd
dd�}|�||�|jdrHd
|jdnd}tj�|j�||jd<d}tj�|�|�	tjj|�t
|d��}|�d�WdQRXt�|t
j�|�|t�|��dS)NrGz3-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  z-arch ppc -arch i386   -gz--I. -isysroot /Developer/SDKs/MacOSX10.4u.sdkz(gcc-4.0 -bundle  -arch ppc -arch i386 -gzRgcc-4.0 -bundle  -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g)r	rrrrrz*-fno-strict-aliasing  -g -O3  -arch i386  z -arch i386   -gzgcc-4.0 -bundle   -arch i386 -gzIgcc-4.0 -bundle   -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -gr"r#rHr$z#!/bin/sh
exit 255)r!rrr
rrrrr%rr'r(r)r*r+r,r&Z_remove_unsupported_archs)rrrrIrJr-rrr�test__remove_unsupported_archs�s0z.Test_OSXSupport.test__remove_unsupported_archscCsPd|jd<ddddddd	�}dd
dddd
d	�}|�||�|�|t�|��dS)Nz-arch x86_64Z	ARCHFLAGSrGz3-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  z-arch ppc -arch i386   -gz--I. -isysroot /Developer/SDKs/MacOSX10.4u.sdkz(gcc-4.0 -bundle  -arch ppc -arch i386 -gzQgcc-4.0 -bundle -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g)r	rrrrrz--fno-strict-aliasing  -g -O3     -arch x86_64z    -g -arch x86_64z"gcc-4.0 -bundle    -g -arch x86_64zKgcc-4.0 -bundle   -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -arch x86_64)rr!r,r&Z_override_all_archs)rrrrrr�test__override_all_archs�s"
z(Test_OSXSupport.test__override_all_archscCsFddddddd�}dddd	dd
d�}|�||�|�|t�|��dS)NrGz[-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  -isysroot /Developer/SDKs/MacOSX10.1.sdkz-arch ppc -arch i386   -gz,-I. -isysroot /Developer/SDKs/MacOSX10.1.sdkz(gcc-4.0 -bundle  -arch ppc -arch i386 -gzQgcc-4.0 -bundle  -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.1.sdk -g)r	rrrrrz4-fno-strict-aliasing  -g -O3 -arch ppc -arch i386   z-I.  z)gcc-4.0 -bundle  -arch ppc -arch i386  -g)r!r,r&�_check_for_unavailable_sdk)rrrrrr�test__check_for_unavailable_sdks z/Test_OSXSupport.test__check_for_unavailable_sdkcCsFddddddd�}dddd	dd
d�}|�||�|�|t�|��dS)NrGzZ-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  -isysroot/Developer/SDKs/MacOSX10.1.sdkz-arch ppc -arch i386   -gz+-I. -isysroot/Developer/SDKs/MacOSX10.1.sdkz(gcc-4.0 -bundle  -arch ppc -arch i386 -gzPgcc-4.0 -bundle  -arch ppc -arch i386 -isysroot/Developer/SDKs/MacOSX10.1.sdk -g)r	rrrrrz4-fno-strict-aliasing  -g -O3 -arch ppc -arch i386   z-I.  z)gcc-4.0 -bundle  -arch ppc -arch i386  -g)r!r,r&rQ)rrrrrr�)test__check_for_unavailable_sdk_alternates z9Test_OSXSupport.test__check_for_unavailable_sdk_alternatecCs*ddd�}t�|ddd�}|�d|�dS)Nz[-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  -isysroot /Developer/SDKs/MacOSX10.1.sdkz10.6)rZMACOSX_DEPLOYMENT_TARGET� )Zmacosxz10.6Zfat)r&Zget_platform_osxr,)rr�resultrrr�test_get_platform_osx;sz%Test_OSXSupport.test_get_platform_osxN)�__name__�
__module__�__qualname__rr!r.r/r3r7r:r;r=rFrKrMrNrOrPrRrSrVrrrrrs$



'"r�__main__)�__doc__rr4r*�sysZunittestZtest.supportrr&Z
skipUnlessr6ZTestCaserrW�mainrrrr�<module>s
8