Commit 27369def authored by Philip Withnall's avatar Philip Withnall

Merge branch 'mkenums' into 'master'

tests: Minor improvements to mkenums.py and taptestrunner.py used by it

See merge request !530
parents 0f508c7b 6b0ad94f
Pipeline #45741 failed with stages
in 8 minutes and 54 seconds
......@@ -285,7 +285,7 @@ comment: {standard_bottom_comment}
"""Test running with no arguments at all."""
result = self.runMkenums()
self.assertEqual('', result.err)
self.assertEquals('''/* {standard_top_comment} */
self.assertEqual('''/* {standard_top_comment} */
/* {standard_bottom_comment} */'''.format(**result.subs),
......@@ -295,7 +295,7 @@ comment: {standard_bottom_comment}
"""Test running with an empty template and no header files."""
result = self.runMkenumsWithTemplate('')
self.assertEqual('', result.err)
self.assertEquals('''/* {standard_top_comment} */
self.assertEqual('''/* {standard_top_comment} */
/* {standard_bottom_comment} */'''.format(**result.subs),
......@@ -305,7 +305,7 @@ comment: {standard_bottom_comment}
"""Test running with a complete template, but no header files."""
result = self.runMkenumsWithAllSubstitutions()
self.assertEqual('', result.err)
self.assertEquals('''
self.assertEqual('''
comment
comment: {standard_top_comment}
......
......@@ -28,10 +28,7 @@
import unittest
import sys
import base64
if sys.hexversion >= 0x03000000:
from io import StringIO
else:
from StringIO import StringIO
from io import StringIO
# Log modes
class LogMode(object) :
......@@ -124,6 +121,9 @@ class TAPTestResult(unittest.TestResult):
self.print_raw(" ...\n")
else:
self.print_raw("# " + output.rstrip().replace("\n", "\n# ") + "\n")
# Truncate doesn't change the current stream position.
# Seek to the beginning to avoid extensions on subsequent writes.
log.seek(0)
log.truncate(0)
def addSuccess(self, test):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment