mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-28 23:16:14 +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."""
|
"""Test running with no arguments at all."""
|
||||||
result = self.runMkenums()
|
result = self.runMkenums()
|
||||||
self.assertEqual('', result.err)
|
self.assertEqual('', result.err)
|
||||||
self.assertEquals('''/* {standard_top_comment} */
|
self.assertEqual('''/* {standard_top_comment} */
|
||||||
|
|
||||||
|
|
||||||
/* {standard_bottom_comment} */'''.format(**result.subs),
|
/* {standard_bottom_comment} */'''.format(**result.subs),
|
||||||
@ -295,7 +295,7 @@ comment: {standard_bottom_comment}
|
|||||||
"""Test running with an empty template and no header files."""
|
"""Test running with an empty template and no header files."""
|
||||||
result = self.runMkenumsWithTemplate('')
|
result = self.runMkenumsWithTemplate('')
|
||||||
self.assertEqual('', result.err)
|
self.assertEqual('', result.err)
|
||||||
self.assertEquals('''/* {standard_top_comment} */
|
self.assertEqual('''/* {standard_top_comment} */
|
||||||
|
|
||||||
|
|
||||||
/* {standard_bottom_comment} */'''.format(**result.subs),
|
/* {standard_bottom_comment} */'''.format(**result.subs),
|
||||||
@ -305,7 +305,7 @@ comment: {standard_bottom_comment}
|
|||||||
"""Test running with a complete template, but no header files."""
|
"""Test running with a complete template, but no header files."""
|
||||||
result = self.runMkenumsWithAllSubstitutions()
|
result = self.runMkenumsWithAllSubstitutions()
|
||||||
self.assertEqual('', result.err)
|
self.assertEqual('', result.err)
|
||||||
self.assertEquals('''
|
self.assertEqual('''
|
||||||
comment
|
comment
|
||||||
comment: {standard_top_comment}
|
comment: {standard_top_comment}
|
||||||
|
|
||||||
|
@ -28,10 +28,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import sys
|
import sys
|
||||||
import base64
|
import base64
|
||||||
if sys.hexversion >= 0x03000000:
|
from io import StringIO
|
||||||
from io import StringIO
|
|
||||||
else:
|
|
||||||
from StringIO import StringIO
|
|
||||||
|
|
||||||
# Log modes
|
# Log modes
|
||||||
class LogMode(object) :
|
class LogMode(object) :
|
||||||
@ -124,6 +121,9 @@ class TAPTestResult(unittest.TestResult):
|
|||||||
self.print_raw(" ...\n")
|
self.print_raw(" ...\n")
|
||||||
else:
|
else:
|
||||||
self.print_raw("# " + output.rstrip().replace("\n", "\n# ") + "\n")
|
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)
|
log.truncate(0)
|
||||||
|
|
||||||
def addSuccess(self, test):
|
def addSuccess(self, test):
|
||||||
|
Loading…
Reference in New Issue
Block a user