summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/farm/html/gold_a_xml/coverage.xml18
-rw-r--r--test/farm/html/run_a_xml.py17
2 files changed, 35 insertions, 0 deletions
diff --git a/test/farm/html/gold_a_xml/coverage.xml b/test/farm/html/gold_a_xml/coverage.xml
new file mode 100644
index 00000000..9c67a55c
--- /dev/null
+++ b/test/farm/html/gold_a_xml/coverage.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<!DOCTYPE coverage
+ SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'>
+<coverage>
+ <packages>
+ <package branch-rate="0.0" complexity="0.0" line-rate="0.666666666667" name=".">
+ <classes>
+ <class branch-rate="0.0" complexity="0.0" filename="c:\ned\coverage\trunk\test\farm\html\src\a.py" line-rate="0.666666666667" name="a">
+ <lines>
+ <line branch="false" hits="1" number="3"/>
+ <line branch="false" hits="1" number="5"/>
+ <line branch="false" hits="0" number="7"/>
+ </lines>
+ </class>
+ </classes>
+ </package>
+ </packages>
+</coverage>
diff --git a/test/farm/html/run_a_xml.py b/test/farm/html/run_a_xml.py
new file mode 100644
index 00000000..6df7dcd4
--- /dev/null
+++ b/test/farm/html/run_a_xml.py
@@ -0,0 +1,17 @@
+def html_it():
+ """Run coverage and make an XML report for a."""
+ import coverage
+ cov = coverage.coverage()
+ cov.start()
+ import a
+ cov.stop()
+ cov.xml_report(a, outfile=open("../xml/coverage.xml", 'w'))
+
+import os
+if not os.path.exists("xml"):
+ os.makedirs("xml")
+
+runfunc(html_it, rundir="src")
+
+compare("xml", "gold_a_xml")
+clean("xml")