ó n”þfc@sÑdZddlZddlZddlZddlZddlZejjejj e ƒƒZ da d„Zd„Ze edd„Zeedd„ZedkrÍdgej_ejjeƒŒndS( sß Use this module to get and run all tk tests. Tkinter tests should live in a package inside the directory where this file lives, like test_tkinter. Extensions also should live in packages following the same rule as above. iÿÿÿÿNc sFtd kr*tatjdkrêddlm}m‰m}m }ddl m }|j |dƒƒ}|j ƒdkrƒdaq'd|f‡fd †ƒY}|ƒ}||ƒ}|j|ƒdksÞ|j|ƒdkr'd aq'q*dd l}y|jƒWq*|jk r&} d | aq*XntrBtjtƒ‚nd S( s)Check that Tk is installed and available.tdarwiniÿÿÿÿ(tcdlltc_inttpointert Structure(t find_librarytApplicationServicesis&cannot run without OS X window managertProcessSerialNumbercs eZdˆfdˆfgZRS(t highLongOfPSNt lowLongOfPSN(t__name__t __module__t_fields_((R(s./usr/lib64/python2.7/lib-tk/test/runtktests.pyR(s s#cannot run without OS X gui processNstk not available: %s(t_tk_unavailabletNonetFalsetsystplatformtctypesRRRRt ctypes.utilRt LoadLibrarytCGMainDisplayIDtGetCurrentProcesstSetFrontProcesstTkintertButtontTclErrortunittesttSkipTest( RRRRt app_servicesRtpsntpsn_pRtmsg((Rs./usr/lib64/python2.7/lib-tk/test/runtktests.pytcheck_tk_availabilitys, "     cCs.x'tj|ƒD]}|dkrtSqWtS(Ns __init__.pys __init__.pycs __init.pyo(s __init__.pys __init__.pycs __init.pyo(tostlistdirtTrueR(tpathtname((s./usr/lib64/python2.7/lib-tk/test/runtktests.pyt is_package<s c #s-d‰x tj|ƒD]\}}}x4t|ƒD]&}|ddkr2|j|ƒq2q2Wt|ƒr|r|t|ƒttjƒjddƒ}|r¯||kr¯qnt‡fd†|ƒ}x[|D]P}y$t j d|tˆƒ |ƒVWqÎt j j k r|r‚qqÎXqÎWqqWdS(sêThis will import and yield modules whose names start with test_ and are inside packages found in the path starting at basepath. If packages is specified it should contain package names that want their tests colleted. s.pyit.t/cs|jdƒo|jˆƒS(Nttest_(t startswithtendswith(tx(tpy_ext(s./usr/lib64/python2.7/lib-tk/test/runtktests.pytVss.%sN(R"twalktlisttremoveR'tlentseptreplacetfiltert importlibt import_modulettestt test_supporttResourceDenied( tbasepathtguitpackagestdirpathtdirnamest filenamestdirnametpkg_nameR&((R.s./usr/lib64/python2.7/lib-tk/test/runtktests.pytget_tests_modulesBs&)   ccs‰g}|r|jdƒn|r2|jdƒnxPtd|d|ƒD]9}x0|D](}xt||dƒD] }|VqnWqUWqHWdS(sYield all the tests in the modules found by get_tests_modules. If nogui is True, only tests that do not require a GUI will be returned.t tests_noguit tests_guiR=R>N((tappendRDtgetattr(ttextR=R>tattrstmoduletattrR9((s./usr/lib64/python2.7/lib-tk/test/runtktests.pyt get_testsas t__main__R=(t__doc__R"RRR7ttest.test_supportR9R%tabspathRBt__file__t this_dir_pathRR R!R'R$RDRMR R:t use_resourcest run_unittest(((s./usr/lib64/python2.7/lib-tk/test/runtktests.pyts      )