Show More
@@ -267,6 +267,8 b' class IPTester(object):' | |||
|
267 | 267 | call_args = None |
|
268 | 268 | #: list, process ids of subprocesses we start (for cleanup) |
|
269 | 269 | pids = None |
|
270 | #: str, coverage xml output file | |
|
271 | coverage_xml = None | |
|
270 | 272 | |
|
271 | 273 | def __init__(self, runner='iptest', params=None): |
|
272 | 274 | """Create new test runner.""" |
@@ -285,10 +287,15 b' class IPTester(object):' | |||
|
285 | 287 | # Assemble call |
|
286 | 288 | self.call_args = self.runner+self.params |
|
287 | 289 | |
|
288 | if '--with-xunit' in self.call_args: | |
|
289 | 290 |
|
|
291 | if '--with-xunit' in self.call_args: | |
|
290 | 292 | self.call_args.append('--xunit-file=%s' % path.abspath(sect+'.xunit.xml')) |
|
291 | 293 | |
|
294 | if '--with-coverage' in self.call_args: | |
|
295 | self.coverage_xml = path.abspath(sect+".coverage.xml") | |
|
296 | self.call_args.remove('--with-coverage') | |
|
297 | self.call_args = ["python-coverage", "run", "--source="+sect] + self.call_args[1:] | |
|
298 | ||
|
292 | 299 | # Store pids of anything we start to clean up on deletion, if possible |
|
293 | 300 | # (on posix only, since win32 has no os.kill) |
|
294 | 301 | self.pids = [] |
@@ -319,12 +326,16 b' class IPTester(object):' | |||
|
319 | 326 | def run(self): |
|
320 | 327 | """Run the stored commands""" |
|
321 | 328 | try: |
|
322 |
ret |
|
|
329 | retcode = self._run_cmd() | |
|
323 | 330 | except: |
|
324 | 331 | import traceback |
|
325 | 332 | traceback.print_exc() |
|
326 | 333 | return 1 # signal failure |
|
327 | 334 | |
|
335 | if self.coverage_xml: | |
|
336 | subprocess.check_call(["python-coverage", "xml", "-o", self.coverage_xml]) | |
|
337 | return retcode | |
|
338 | ||
|
328 | 339 | def __del__(self): |
|
329 | 340 | """Cleanup on exit by killing any leftover processes.""" |
|
330 | 341 |
General Comments 0
You need to be logged in to leave comments.
Login now