Skip to content

Commit

Permalink
Updates to test with new XML format changes.
Browse files Browse the repository at this point in the history
These changes add a date attribute, which needs to be
ignored robustly when doing baseline differences.
  • Loading branch information
whart222 committed May 5, 2013
1 parent 3f3212c commit b6fdb47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cxxtest/XmlFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ class XmlFormatter : public TestListener
os << totaltime;
(*_o) << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl;
(*_o) << "<testsuite name=\"" << desc.worldName() << "\" ";
(*_o) << " date=\"" << current_date_string << "\" ";
(*_o) << " tests=\"" << ntests
(*_o) << "date=\"" << current_date_string;
(*_o) << "\" tests=\"" << ntests
<< "\" errors=\"" << nerror
<< "\" failures=\"" << nfail
<< "\" time=\"" << os.str().c_str() << "\" >";
Expand Down
2 changes: 1 addition & 1 deletion test/normal.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite name="cxxtest" tests="35" errors="0" failures="28" time="0" >
<testsuite name="cxxtest" date="Tue Apr 23 23:28:43 2013" tests="35" errors="0" failures="28" time="0" >
<testcase classname="LessThanEquals" name="testLessThanEquals" line="11">
LessThanEquals.h" line="16" type="failedAssertLessThanEquals" >Error: Expected (1 &lt;= 0), found (1 &gt; 0)
Test failed: 1 &lt;=? 0
Expand Down
3 changes: 3 additions & 0 deletions test/test_cxxtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
compilerre = re.compile("^(?P<path>[^:]+)(?P<rest>:.*)$")
dirre = re.compile("^([^%s]*/)*" % re.escape(os.sep))
xmlre = re.compile("\"(?P<path>[^\"]*/[^\"]*)\"")
datere = re.compile("date=\"[^\"]*\"")

# Headers from the cxxtest/sample directory
samples = ' '.join(file for file in sorted(glob.glob(sampledir+'*.h')))
Expand Down Expand Up @@ -136,6 +137,8 @@ def normalize_line_for_diff(line):
lambda match: '"'+re.sub("^[^/]+/", "", match.group(1))+'"',
line
)
# Remove date info
line = datere.sub( lambda match: 'date=""', line)
return line

def make_diff_readable(diff):
Expand Down

0 comments on commit b6fdb47

Please sign in to comment.