qQc@sdZddlZddlZddlZddlmZddlmZddlm Z dZ dZ dZ ej d krdd lmZed krdZqd Znd ZejedkedejejfdYZdZedkre endS(s"Tests for distutils.msvc9compiler.iN(tDistutilsPlatformError(tsupport(t run_unittests s s twin32(tget_build_versiong @s)These tests are only for MSVC8.0 or abovesThese tests are only for win32tmsvc9compilerTestCasecBs,eZdZdZdZdZRS(cCscddlm}d}ddlm}|j}||_z|jt|dWd||_XdS(Ni(tquery_vcvarsallcSsdS(N(tNone(tversion((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt_find_vcvarsallos(t msvc9compilerswont find this version(tdistutils.msvc9compilerRt distutilsR tfind_vcvarsallt assertRaisesR(tselfRR R told_find_vcvarsall((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyttest_no_compilerjs     cCsddlm}|jt|jddd}|j|d}|j|d kddl}|j}|j|d }|j |d|j|d }|jd |kdS( Ni(tRegtxxxsControl Panel\Desktopudragfullwindowsu0u1u2txxxxs Control PaneltDesktop(u0u1u2( R RRtKeyErrort get_valuet assertTruet_winregtHKEY_CURRENT_USERt read_keyst assertEqualR(RRtpathtvRtHKCUtkeys((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyttest_reg_class{s  cCsddlm}|j}tjj|d}t|d}z|jtWd|j X|}|j |t|}z2djg|j D]}|j ^q}Wd|j X|j |tdS(Ni(t MSVCCompilertmanifesttws (R R"tmkdtemptosRtjointopentwritet"_MANIFEST_WITH_MULTIPLE_REFERENCEStcloset_remove_visual_c_reft readlinestrstripRt_CLEANED_MANIFEST(RR"ttempdirR#tftcompilertlinetcontent((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyttest_remove_visual_c_refs     2 cCsddlm}|j}tjj|d}t|d}z|jtWd|j X|}|j |}|j |ddS(Ni(R"R#R$( R R"R%R&RR'R(R)t"_MANIFEST_WITH_ONLY_MSVC_REFERENCER+R,tassertIsR(RR"R0R#R1R2tgot((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyttest_remove_entire_manifests   (t__name__t __module__RR!R5R9(((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyRfs   cCs tjtS(N(tunittestt makeSuiteR(((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt test_suitest__main__(t__doc__tsysR<R&tdistutils.errorsRtdistutils.testsRttest.test_supportRR6R*R/tplatformtdistutils.msvccompilerRRt SKIP_MESSAGEt skipUnlesstTempdirManagertTestCaseRR>R:(((s8/sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyts*      L