
    sh                     j    S r SSKrSSKJr  SSKJr  SSKJrJr  SSK	r	 " S S\R                  5      rg)z'Tests for distutils.command.build_clib.    N)
build_clib)DistutilsSetupError)missing_compiler_executablesupportc                   n    \ rS rSrS rS rS rS r\R                  R                  S5      S 5       rSrg	)
TestBuildCLib   c                 <   U R                  5       u  p[        U5      n[        R                  " [        5         UR                  S5        S S S 5        [        R                  " [        5         UR                  SS/5        S S S 5        [        R                  " [        5         UR                  SS/5        S S S 5        [        R                  " [        5         UR                  SS/5        S S S 5        [        R                  " [        5         UR                  S0 4S	/5        S S S 5        S0 4SS
S04/nUR                  U5        g ! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       No= f)Nfoofoo1foo2)   r   )namer   )r   r   )zanother/namer   r   )anotherr   okgood)create_distr   pytestraisesr   check_library_list)selfpkg_dirdistcmdlibss        /Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/setuptools/_distutils/tests/test_build_clib.pytest_check_library_dist%TestBuildCLib.test_check_library_dist   s;   ((* ]]./""5) 0 ]]./""FF#34 0
 ]]./""K1A#BC 0 ]]./""!#;< 0 ]]./"""23 0 vf~67t$5 0/ 0/
 0/ 0/ 0/s;   E,E"E+E<F
E
E(+
E9<
F

Fc                 d   U R                  5       u  p[        U5      nS0 4/Ul        [        R                  " [
        5         UR                  5         S S S 5        SSS04/Ul        [        R                  " [
        5         UR                  5         S S S 5        SSSS/04/Ul        UR                  5       SS/:X  d   eSSS04/Ul        UR                  5       SS/:X  d   eSSS04SSSS	/04/Ul        UR                  5       / S
Q:X  d   eg ! , (       d  f       N= f! , (       d  f       N= f)Nr   sourcesr   ab)r!   r"   name2cd)r!   r"   r$   r%   )r   r   	librariesr   r   r   get_source_filesr   r   r   r   s       r   test_get_source_files#TestBuildCLib.test_get_source_files-   s5   ((* !"]]./  " 0 !9a.12]]./  " 0 !9sCj"9:;##%#s333 9j"9:;##%#s333 i,-y3*-.
 ##%)====# 0/ 0/s   DD!
D!
D/c                    U R                  5       u  p[        U5      n " S S5      nU" 5       Ul        SSS04/n[        R                  " [
        5         UR                  U5        S S S 5        SS[        5       04/nUR                  U5        SS[        5       04/nUR                  U5        g ! , (       d  f       NO= f)Nc                       \ rS rSrS r\rSrg)8TestBuildCLib.test_build_libraries.<locals>.FakeCompilerK   c                      g )N )argskws     r   compile@TestBuildCLib.test_build_libraries.<locals>.FakeCompiler.compileL   s        r0   N)__name__
__module____qualname____firstlineno__r3   create_static_lib__static_attributes__r0   r5   r   FakeCompilerr-   K   s     !(r5   r<   r   r    notvalid)	r   r   compilerr   r   r   build_librarieslisttuple)r   r   r   r   r<   libs         r   test_build_libraries"TestBuildCLib.test_build_librariesG   s    ((*	( 	( $~ J/01]]./$ 0 DF+,-C EG,-.C  0/s   B00
B>c                    U R                  5       u  p[        U5      nSUl        UR                  5         UR                  S/:X  d   eS Ul        UR                  5         UR                  / :X  d   eSUR                  l        [        R                  " [        5         UR                  5         S S S 5        g ! , (       d  f       g = f)Nzone-dirWONTWORK)	r   r   include_dirsfinalize_optionsdistributionr&   r   r   r   r(   s       r   test_finalize_options#TestBuildCLib.test_finalize_options^   s    ((*$I;...2%%%%/"]]./  " 0//s   B66
Czplatform.system() == "Windows"c                    U R                  5       u  p[        U5      n[        R                  R	                  US5      nU R                  US5        SSU/04/Ul        [        R                  R	                  US5      n[        R                  " U5        XSl        XSl        [        5       nUb  U R                  SU< S35        UR                  5         S[        R                  " U5      ;   d   eg )	Nzfoo.czint main(void) { return 1;}
r   r    buildzThe z command is not foundzlibfoo.a)r   r   ospathjoin
write_filer&   mkdir
build_tempr   skipTestrunlistdir)r   r   r   r   foo_crS   ccmds          r   test_runTestBuildCLib.test_runn   s    ((*Wg.>?)eW!567WW\\'73

## +,MMD(=>? 		 RZZ
3333r5   r0   N)r6   r7   r8   r9   r   r)   rC   rJ   r   markskipifrY   r;   r0   r5   r   r   r      s;    %B>4!.#  [[894 :4r5   r   )__doc__rN   distutils.command.build_clibr   distutils.errorsr   distutils.testsr   r   r   TempdirManagerr   r0   r5   r   <module>rb      s+    - 	 3 0 @ {4G** {4r5   