B t `@sddlZyddlZddlZWn&ek rBededYnXyddlZddlZdZWnek rtdZYnXyddl Z ddl ZdZ Wnek rdZ YnXddl Z ddl Z ddlZddlZddlZddlZddlmZde _GdddejjZd d Zdd d ZdS)Nzdd|tjd|dg} tr| dddd|g} |js`|jrx|D]} | d | qfWt |d krx*|D]"} | |kr| d |d | qW|j r| d g} | d |g} | S)Nz --with-xunitz --xunit-filezTEST-z.xmlz--with-coveragez --cover-erasez--cover-inclusivez--cover-packagez--cover-filter=r.z --verbosity=3z--where) typelistxunitr sepcoverage_installed filtering filtering_allappendlenverbose) packagepackages subpackagesfilterr testdirxunitdirrtmpnewargsitemrrrgenerate_options;s*        r*testc Cs*t}|jdddddd|jddd d d d d|jd ddd dd d|jdddd dd dd|_d|_d|_|j|d\}}x [...]zA utility to run Pyomo tests. A particular feature of this tool is the ability to filter coverage information, using a customized installation of the nose utility.zgThe customized nose utility that supports filtering can be obtained from Bill Hart (wehart@sandia.gov).)argsrrzERROR: no subpackage 'z .coverageZ COVERAGE_FILEz TEST*.xmlZruntestszNose Arguments:z Test Dir:zTest Packages:zIgnored Packages:)argvZ addpluginszPackage Coverage Tests: z^.*TEST-(.+)\.xmlz TEST-*.xmlr+rrztestsuite name="nosetests"ztestsuite name=""w)'r add_optionusage descriptionepilog parse_argsrangerr rcopyprintsysexitremoverexistsenvironglobmkdirrrr*chdirr r5noserunstdoutrecompilematchgroupopenjoin readlinesclosesubwrite)r5r!r#r$r%rparserr r2irargZ coverage_filer&filepluginsr(Zarglistr'pZoldnamesuffixFILEZtext0ZptmpZtext1rrrmainWs        0                  r^)r+)rArIZ nose.plugins ImportErrorr@rBZ nosexunitZnosexunit.pluginZnose_xunit_installedZcoverageZnose.plugins.coverrrLloggingr os.pathrFr?optparserraiseExceptionsrZZPluginrr*r^rrrr s: