[Proctor-checkins] CVS: Proctor/proctorlib cui.py,1.19,1.20
Status: Alpha
Brought to you by:
doughellmann
|
From: Doug H. <dou...@us...> - 2006-05-01 12:47:36
|
Update of /cvsroot/proctor/Proctor/proctorlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1010 Modified Files: cui.py Log Message: Update to work with the new coverage module Index: cui.py =================================================================== RCS file: /cvsroot/proctor/Proctor/proctorlib/cui.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** cui.py 4 May 2003 22:37:22 -0000 1.19 --- cui.py 1 May 2006 12:47:22 -0000 1.20 *************** *** 66,69 **** --- 66,70 ---- # import proctorlib + import proctorlib.coverage from proctorlib.trace import trace *************** *** 84,94 **** shortArgumentsDescription = "[<directory name> ...]" ! list_mode = 0 ! list_categories_mode = 0 ! run_mode = 1 ! parsable_mode = 0 ! coverage_filename = None ! coverage = 1 ! interleaved = 0 category = 'All' --- 85,96 ---- shortArgumentsDescription = "[<directory name> ...]" ! list_mode = False ! list_categories_mode = False ! run_mode = True ! parsable_mode = False ! coverage_filename = proctorlib.coverage.coverage.cache_default ! coverage = True ! coverage_exclude_patterns = [] ! interleaved = False category = 'All' *************** *** 96,100 **** """List tests. """ ! self.list_mode = 1 return --- 98,102 ---- """List tests. """ ! self.list_mode = True return *************** *** 102,106 **** """List test categories. """ ! self.list_categories_mode = 1 return --- 104,108 ---- """List test categories. """ ! self.list_categories_mode = True return *************** *** 108,112 **** """Do not run the tests """ ! self.run_mode = 0 return --- 110,114 ---- """Do not run the tests """ ! self.run_mode = False return *************** *** 125,129 **** with the test list. """ ! self.interleaved = 1 return --- 127,131 ---- with the test list. """ ! self.interleaved = True return *************** *** 131,136 **** """Format output to make it easier to parse. """ ! self.interleaved = 1 ! self.parsable_mode = 1 return --- 133,138 ---- """Format output to make it easier to parse. """ ! self.interleaved = True ! self.parsable_mode = True return *************** *** 144,148 **** """Disable coverage analysis. """ ! self.coverage = 0 return --- 146,158 ---- """Disable coverage analysis. """ ! self.coverage = False ! return ! ! def optionHandler_coverage_exclude(self, pattern): ! """Add a line exclude pattern ! (can be a regular expression). ! """ ! self.statusMessage('Excluding "%s" from coverage analysis' % pattern) ! self.coverage_exclude_patterns.append(pattern) return *************** *** 260,264 **** # print that here. # ! if self.list_categories_mode: success = self.listCategories(module_tree) --- 270,274 ---- # print that here. # ! elif self.list_categories_mode: success = self.listCategories(module_tree) *************** *** 267,271 **** # last. # ! if self.run_mode: # --- 277,281 ---- # last. # ! elif self.run_mode: # *************** *** 273,276 **** --- 283,287 ---- # if self.coverage_filename: + self.statusMessage('Writing coverage output to %s' % self.coverage_filename) import os os.environ['COVERAGE_FILE'] = self.coverage_filename *************** *** 278,290 **** if self.coverage: # ! # Wait to do the import of this module until right here, ! # in case the filename was specified via the command line. ! # An API to the coverage module would be nice... # ! from proctorlib import coverage # # Start code coverage counter # ! coverage.start() # --- 289,304 ---- if self.coverage: # ! # Clean up in case we have previous coverage data # ! proctorlib.coverage.erase() ! # ! # Add exclude patterns ! # ! for pattern in self.coverage_exclude_patterns: ! proctorlib.coverage.exclude(pattern) # # Start code coverage counter # ! proctorlib.coverage.start() # *************** *** 304,309 **** # Stop coverage counter and save its results # ! coverage.stop() ! coverage.the_coverage.save() # --- 318,323 ---- # Stop coverage counter and save its results # ! proctorlib.coverage.stop() ! proctorlib.coverage.the_coverage.save() # |