summaryrefslogtreecommitdiff
path: root/tests/farm/html/run_a_xml_1.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/farm/html/run_a_xml_1.py')
-rw-r--r--tests/farm/html/run_a_xml_1.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/farm/html/run_a_xml_1.py b/tests/farm/html/run_a_xml_1.py
index 3d187023..04fdfd4b 100644
--- a/tests/farm/html/run_a_xml_1.py
+++ b/tests/farm/html/run_a_xml_1.py
@@ -1,3 +1,5 @@
+relative_path = None
+
def html_it():
"""Run coverage and make an XML report for a."""
import coverage
@@ -6,6 +8,8 @@ def html_it():
import a # pragma: nested
cov.stop() # pragma: nested
cov.xml_report(a, outfile="../xml_1/coverage.xml")
+ global relative_path
+ relative_path = cov.file_locator.relative_dir.rstrip('/')
import os
if not os.path.exists("xml_1"):
@@ -16,6 +20,8 @@ runfunc(html_it, rundir="src")
compare("gold_x_xml", "xml_1", scrubs=[
(r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
(r' version="[-.\w]+"', ' version="VERSION"'),
+ (r'<source>(\s)*?(.*)(\s)*?</source>',
+ '<source>%s</source>' % relative_path),
(r'/code/coverage/?[-.\w]*', '/code/coverage/VER'),
])
clean("xml_1")