
    i                        d Z ddlmZ ddlZddlmZ ddlmZ ddl	m
Z
 ddlmZmZ ddlmZ dd	lmZmZmZmZmZmZ dd
lmZ dgZ G d de          ZdS )z+Test cases for capsule dependency analysis.    )annotationsN)CompileError)test_temp_dir)DataDrivenTestCase)find_class_dependenciesfind_implicit_op_dependencies)CompilerOptions)ICODE_GEN_BUILTINSMypycDataSuiteassert_test_outputbuild_ir_for_single_file2%infer_ir_build_options_from_test_nameuse_custom_builtins)lower_irzcapsule-deps.testc                      e Zd ZeZeZddZdS )TestCapsuleDepstestcaser   returnNonec                   t          |j                  }|d S t          t          j                            | j        t                    |          5  	 t          |j	        |          \  }}}}t                      }|j        D ]X}t                      }t          ||           t          |          }|r'|D ]$}	|                    t!          |	                     %Y|j        D ]:}
t%          |
          }|r'|D ]$}	|                    t!          |	                     %;|rt'          |          ndg}n# t(          $ r}|j        }Y d }~nd }~ww xY wt-          ||d|j                   d d d            d S # 1 swxY w Y   d S )NzNo depszInvalid test output)r   namer   ospathjoindata_prefixr
   r   inputset	functionsr	   r   r   addreprclassesr   sortedr   messagesr   output)selfr   options	module_ir_all_depsfncompiler_optionsdepsdepclactuales                [/root/projects/qq-shell/venv/lib64/python3.11/site-packages/mypyc/test/test_capsule_deps.pyrun_casezTestCapsuleDeps.run_case   s
   7FF?F d.>@R!S!SU]^^ 	Y 	YG%>x~w%W%W"	1a &)UU#- 4 4B'6'8'8$R!12228<<D 4#' 4 4C$LLc3333#+ 4 4B2266D 4#' 4 4C$LLc3333-5F)))I;!   $ $ $$$ x1FXXX+	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Ys=   E4D2-CE42
E<EE4EE44E8;E8N)r   r   r   r   )__name__
__module____qualname__filesr   	base_pathr2        r1   r   r      s8        EIY Y Y Y Y Yr9   r   )__doc__
__future__r   os.pathr   mypy.errorsr   mypy.test.configr   mypy.test.datar   mypyc.analysis.capsule_depsr   r   mypyc.optionsr	   mypyc.test.testutilr
   r   r   r   r   r   mypyc.transform.lowerr   r6   r   r8   r9   r1   <module>rD      s0   1 1 " " " " " "  $ $ $ $ $ $ * * * * * * - - - - - - ^ ^ ^ ^ ^ ^ ^ ^ ) ) ) ) ) )                + * * * * *	Y Y Y Y Yn Y Y Y Y Yr9   