From 1bec288c62eca5f608e047c009730a43da7df725 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 9 Jan 2010 20:57:37 -0500 Subject: XML output file is configurable in .rc file. --HG-- rename : test/farm/html/run_a_xml.py => test/farm/html/run_a_xml_1.py --- coverage/control.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 3a1b7f0f..5c253808 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -366,14 +366,21 @@ class coverage(object): """Generate an XML report of coverage results. The report is compatible with Cobertura reports. + + Each module in `morfs` is included in the report. `outfile` is the + path to write the file to, "-" will write to stdout. """ self.config.from_args( ignore_errors=ignore_errors, - omit_prefixes=omit_prefixes + omit_prefixes=omit_prefixes, + xml_output=outfile, ) - if outfile: - outfile = open(outfile, "w") + if self.config.xml_output: + if self.config.xml_output == '-': + outfile = sys.stdout + else: + outfile = open(self.config.xml_output, "w") try: reporter = XmlReporter(self, self.config.ignore_errors) reporter.report( -- cgit v1.2.1