Mercurial > hg
changeset 32715:a4d0e816a672
run-tests: add information about skipped tests to XUnit output
The XUnit spec supports skipped tests.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 07 Jun 2017 15:47:06 -0700 |
parents | ef8d24539612 |
children | 2146f01a2577 |
files | tests/run-tests.py tests/test-run-tests.t |
diffstat | 2 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Wed Jun 07 15:47:06 2017 -0700 +++ b/tests/run-tests.py Wed Jun 07 15:47:06 2017 -0700 @@ -2061,6 +2061,17 @@ failelem.appendChild(cd) t.appendChild(failelem) s.appendChild(t) + for tc, message in result.skipped: + # According to the schema, 'skipped' has no attributes. So store + # the skip message as a text node instead. + t = doc.createElement('testcase') + t.setAttribute('name', tc.name) + message = cdatasafe(message).decode('utf-8', 'replace') + cd = doc.createCDATASection(message) + skipelem = doc.createElement('skipped') + skipelem.appendChild(cd) + t.appendChild(skipelem) + s.appendChild(t) outf.write(doc.toprettyxml(indent=' ', encoding='utf-8')) @staticmethod
--- a/tests/test-run-tests.t Wed Jun 07 15:47:06 2017 -0700 +++ b/tests/test-run-tests.t Wed Jun 07 15:47:06 2017 -0700 @@ -676,6 +676,10 @@ <?xml version="1.0" encoding="utf-8"?> <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2"> <testcase name="test-success.t" time="*"/> (glob) + <testcase name="test-skip.t"> + <skipped> + <![CDATA[missing feature: nail clipper]]> </skipped> + </testcase> </testsuite> Missing skips or blacklisted skips don't count as executed: