NL i dZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZddlmZmZdgZej&j)ej&j+ed d Zej0ZGd d eZy) zTest cases for invoking mypyc on the command line. These are slow -- do not add test cases unless you have a very good reason to do so. ) annotationsN) test_temp_dir)DataDrivenTestCase)normalize_error_messages)MypycDataSuiteassert_test_outputzcommandline.testz..c eZdZeZeZdZddZy)TestCommandLineTcdj|j}tjd|}|Jd|j dj }d|j z}tjjt|}t|d5}|j|dddtjj}t|d<d} tj t"j$d d g|tj&tj(d | } d |j vs| j*dk7r| | j,z } n2d|j vr$| j,j/d\} } } | | z } | j*dk(r | tj0t2|gd z } t"j4dk(rdnd} t7j6d| d}|D]}tj8| |j:Dcgc]}|j=dd}}t?| jAjC}tE||d|y#1swYxYw#t"j4dk(rdnd} t7j6d| d}|D]}tj8|wxYwcc}w)N z # *cmd: *(.*)z*Test case missing "# cmd: " sectionz_%s.pyw PYTHONPATHz-mmypyctmp)stdoutstderrcwdenv ErrorOutputr WarningOutputsrunning build_ext)rwin32pydsoz tmp/**/*.T) recursiveztmp/zInvalid output)expected)#joininputresearchgroupsplitnameospathropenwriteenvironcopy base_path subprocessrunsys executablePIPESTDOUT returncoder partition check_output python3_pathplatformglobremoveoutputreplacerdecode splitlinesr)selftestcasetextmargsprogram program_pathfroutcmdmessages_suffixso_pathsr'xractuals a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypyc/test/test_commandline.pyrun_casezTestCommandLine.run_case!sVyy( II& -}JJJ}wwqz!X]]*ww||M7; , $  GGDM jjoo%L ..w66!!(( C -11Dszz! HMM1"%!5!56J!K!Qx~~"z.. g/FERR!llg5U4Fyy9VH!5FH   $ 4N)r?rreturnNone)__name__ __module__ __qualname__filesrr, optional_outrOrrNr r s EIL1Rrr )__doc__ __future__rr8r&os.pathr!r-r/mypy.test.configrmypy.test.datarmypy.test.helpersrmypyc.test.testutilrrrUr'rdirname__file__r,r0r6r rWrrNrasq #   *-6B  GGLL2D$ ? ~~ 6Rn6Rr