Skip to content

Commit

Permalink
Remove XML filter from testlog.{json,txt} and std streams
Browse files Browse the repository at this point in the history
This was an unintended consequence of the original patch in mesonbuild#11977.

Co-authored-by: Benoit Pierre <benoit.pierre@gmail.com>
  • Loading branch information
tristan957 and benoit-pierre committed Aug 14, 2023
1 parent 90ce084 commit d0bf173
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mesonbuild/mtest.py
Expand Up @@ -869,10 +869,10 @@ def log(self, harness: 'TestHarness', test: 'TestRun') -> None:
et.SubElement(testcase, 'system-out').text = subtest.explanation
if test.stdo:
out = et.SubElement(suite, 'system-out')
out.text = test.stdo.rstrip()
out.text = replace_unencodable_xml_chars(test.stdo.rstrip())
if test.stde:
err = et.SubElement(suite, 'system-err')
err.text = test.stde.rstrip()
err.text = replace_unencodable_xml_chars(test.stde.rstrip())
else:
if test.project not in self.suites:
suite = self.suites[test.project] = et.Element(
Expand All @@ -895,10 +895,10 @@ def log(self, harness: 'TestHarness', test: 'TestRun') -> None:
suite.attrib['failures'] = str(int(suite.attrib['failures']) + 1)
if test.stdo:
out = et.SubElement(testcase, 'system-out')
out.text = test.stdo.rstrip()
out.text = replace_unencodable_xml_chars(test.stdo.rstrip())
if test.stde:
err = et.SubElement(testcase, 'system-err')
err.text = test.stde.rstrip()
err.text = replace_unencodable_xml_chars(test.stde.rstrip())

async def finish(self, harness: 'TestHarness') -> None:
"""Calculate total test counts and write out the xml result."""
Expand Down Expand Up @@ -1182,9 +1182,9 @@ def decode(stream: T.Union[None, bytes]) -> str:
if stream is None:
return ''
try:
return replace_unencodable_xml_chars(stream.decode('utf-8'))
return stream.decode('utf-8')
except UnicodeDecodeError:
return replace_unencodable_xml_chars(stream.decode('iso-8859-1', errors='ignore'))
return stream.decode('iso-8859-1', errors='ignore')

async def read_decode(reader: asyncio.StreamReader,
queue: T.Optional['asyncio.Queue[T.Optional[str]]'],
Expand Down

0 comments on commit d0bf173

Please sign in to comment.