mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 14:06:15 +01:00
Merge branch 'mkenums' into 'master'
tests: Minor improvements to mkenums.py and taptestrunner.py used by it See merge request GNOME/glib!530
This commit is contained in:
commit
27369def50
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user