tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
O\¬Qc@s¬ddlZddlZddlZddlZddlZddlZddlZddlmZddl    Z    de    j
fd„ƒYZ d„Z e dkr¨e ƒndS(iÿÿÿÿN(t test_supporttCompileallTestscBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs¿tjƒ|_tjj|jdƒ|_|jtr<dnd|_t    |jdƒ}|j
dƒWdQXtjj|jdƒ|_ |j tr›dnd|_ t j|j|j ƒdS(Ns_test.pytctotwsx = 123
s    _test2.py(ttempfiletmkdtempt    directorytostpathtjoint source_patht    __debug__tbc_pathtopentwritet source_path2tbc_path2tshutiltcopyfile(tselftfile((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pytsetUpscCstj|jƒdS(N(RtrmtreeR(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyttearDownscCsjt|jdƒ}|jdƒ}WdQXttj|jƒjƒ}tj    dt
j ƒ|ƒ}||fS(Ntrbis<4sl( RR treadtintRtstatR tst_mtimetstructtpacktimpt    get_magic(RRtdatatmtimetcompare((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyR"s
cCsâttdƒsdStj|jƒ|j|jƒŒt|jdƒ}|j    ƒt
|ƒ}WdQXt|jdƒ!}|j |ƒ|j |ƒWdQX|j |jƒŒt j|jdtdtƒ|j|jƒŒdS(sOCheck that compileall recreates bytecode when the new metadata is
        used.RNRtwbtforcetquiet(thasattrRt
py_compiletcompileR t assertEqualR"RR RtlenRtassertNotEqualt
compileallt compile_dirRtFalsetTruet
assertTrue(RtmetadataRtbc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pytrecreation_check"s cCs&|jtjdtjƒdƒƒdS(Ns<4sli(R5RRR R!(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyt
test_mtime2scCs|jdƒdS(Nt(R5(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyttest_magic_number6scCsx5|j|jfD]!}ytj|ƒWqqXqWtj|jdtdtƒ|j    tj
j |jƒo‚tj
j |jƒ ƒtj|jƒtj |j dtdtƒ|j    tj
j |jƒoßtj
j |jƒƒtj|jƒtj|jƒdS(NR&R'(R RRtunlinkR.t compile_fileR R0R1R2R    tisfileR/R(Rtfn((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyttest_compile_files:s(    t__name__t
__module__RRR"R5R6R8R=(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyR s    
                   cCstjtƒdS(N(Rt run_unittestR(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyt    test_mainKst__main__(R.R RR)RRRttestRtunittesttTestCaseRRAR>(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compileall.pyt<module>s        ?