
    X-Ph                        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 ddlmZ dd	lmZmZmZmZmZmZmZmZ dd
lmZ ddlmZ dgZ G d de          ZdS )zTest runner for reference count opcode insertion transform test cases.

The transform inserts needed reference count increment/decrement
operations to IR.
    )annotationsN)CompileError)test_temp_dir)DataDrivenTestCase)TOP_LEVEL_NAME)format_func)ICODE_GEN_BUILTINSMypycDataSuiteassert_test_outputbuild_ir_for_single_file%infer_ir_build_options_from_test_nameremove_comment_linesreplace_word_sizeuse_custom_builtins)insert_ref_count_opcodes)insert_uninit_checkszrefcount.testc                  "    e Zd ZeZeZdZddZdS )	TestRefCountTransformTtestcaser   returnNonec                   t          |j                  }|dS t          t          j                            | j        t                    |          5  t          |j	                  }t          |          }	 t          |j        |          }g }|D ]m}|j        t          k    r|j                            d          s-t          |           t!          |           |                    t%          |                     nn# t&          $ r}|j        }Y d}~nd}~ww xY wt+          ||d|           ddd           dS # 1 swxY w Y   dS )z4Perform a runtime checking transformation test case.N	_toplevelzInvalid source code output)r   namer   ospathjoindata_prefixr	   r   outputr   r   inputr   endswithr   r   extendr   r   messagesr   )selfr   optionsexpected_outputiractualfnes           X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mypyc/test/test_refcount.pyrun_casezTestRefCountTransform.run_case%   s   7FF?F d.>@R!S!SU]^^ 	` 	`28?CCO/@@O3-hngFF  3 3Bw.009O9OP[9\9\0 (,,,,R000MM+b//22223	   $ $ $$ x1M___!	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	` 	`s=   $D;6C>A3D;>
DDD;DD;;D?D?N)r   r   r   r   )__name__
__module____qualname__filesr   	base_pathoptional_outr,        r+   r   r       s=        EIL` ` ` ` ` `r4   r   )__doc__
__future__r   os.pathr   mypy.errorsr   mypy.test.configr   mypy.test.datar   mypyc.commonr   mypyc.ir.pprintr   mypyc.test.testutilr	   r
   r   r   r   r   r   r   mypyc.transform.refcountr   mypyc.transform.uninitr   r0   r   r3   r4   r+   <module>r@      sV    # " " " " "  $ $ $ $ $ $ * * * * * * - - - - - - ' ' ' ' ' ' ' ' ' ' ' '	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 > = = = = = 7 7 7 7 7 7	` ` ` ` `N ` ` ` ` `r4   