summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/farm/html/run_a_xml_1.py6
-rw-r--r--tests/farm/html/run_a_xml_2.py6
-rw-r--r--tests/farm/html/run_y_xml_branch.py6
3 files changed, 15 insertions, 3 deletions
diff --git a/tests/farm/html/run_a_xml_1.py b/tests/farm/html/run_a_xml_1.py
index 21d83d55..8b5aa97b 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,7 +20,7 @@ runfunc(html_it, rundir="src")
compare("gold_x_xml", "xml_1", scrubs=[
(r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
(r' version="[-.\w]+"', ' version="VERSION"'),
- (r'<source>(.*)</source>', '<source></source>'),
+ (r'<source></source>', '<source>%s</source>' % relative_path),
(r'/code/coverage/?[-.\w]*', '/code/coverage/VER'),
])
clean("xml_1")
diff --git a/tests/farm/html/run_a_xml_2.py b/tests/farm/html/run_a_xml_2.py
index e63e7ead..1d6b8394 100644
--- a/tests/farm/html/run_a_xml_2.py
+++ b/tests/farm/html/run_a_xml_2.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)
+ global relative_path
+ relative_path = cov.file_locator.relative_dir.rstrip('/')
import os
if not os.path.exists("xml_2"):
@@ -16,7 +20,7 @@ runfunc(html_it, rundir="src")
compare("gold_x_xml", "xml_2", scrubs=[
(r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
(r' version="[-.\w]+"', ' version="VERSION"'),
- (r'<source>(.*)</source>', '<source></source>'),
+ (r'<source></source>', '<source>%s</source>' % relative_path),
(r'/code/coverage/?[-.\w]*', '/code/coverage/VER'),
])
clean("xml_2")
diff --git a/tests/farm/html/run_y_xml_branch.py b/tests/farm/html/run_y_xml_branch.py
index ab8deef4..b8feab64 100644
--- a/tests/farm/html/run_y_xml_branch.py
+++ b/tests/farm/html/run_y_xml_branch.py
@@ -1,3 +1,5 @@
+relative_path = None
+
def xml_it():
"""Run coverage and make an XML report for y."""
import coverage
@@ -6,6 +8,8 @@ def xml_it():
import y # pragma: nested
cov.stop() # pragma: nested
cov.xml_report(y, outfile="../xml_branch/coverage.xml")
+ global relative_path
+ relative_path = cov.file_locator.relative_dir.rstrip('/')
import os
if not os.path.exists("xml_branch"):
@@ -16,7 +20,7 @@ runfunc(xml_it, rundir="src")
compare("gold_y_xml_branch", "xml_branch", scrubs=[
(r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
(r' version="[-.\w]+"', ' version="VERSION"'),
- (r'<source>(.*)</source>', '<source></source>'),
+ (r'<source></source>', '<source>%s</source>' % relative_path),
(r'/code/coverage/?[-.\w]*', '/code/coverage/VER'),
])
clean("xml_branch")