gio: use TAPTestRunner in the memory monitor tests

There are two memory monitor tests that use Python's unittest module directly,
but GLib tests should be outputting TAP.  Use the embedded TAPTestRunner to
ensure that TAP is output for these tests too.
This commit is contained in:
Ross Burton 2020-04-07 15:45:06 +01:00
parent 1a3a1865eb
commit 1fcd32a159
3 changed files with 8 additions and 5 deletions

View File

@ -21,6 +21,8 @@ import fcntl
import os
import time
import taptestrunner
from gi.repository import GLib
from gi.repository import Gio
@ -98,5 +100,4 @@ class TestLowMemoryMonitor(dbusmock.DBusTestCase):
if __name__ == '__main__':
# avoid writing to stderr
unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout, verbosity=2))
unittest.main(testRunner=taptestrunner.TAPTestRunner())

View File

@ -21,6 +21,8 @@ import fcntl
import os
import time
import taptestrunner
from gi.repository import GLib
from gi.repository import Gio
@ -114,5 +116,4 @@ class TestLowMemoryMonitorPortal(dbusmock.DBusTestCase):
if __name__ == '__main__':
# avoid writing to stderr
unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout, verbosity=2))
unittest.main(testRunner=taptestrunner.TAPTestRunner())

View File

@ -531,8 +531,9 @@ if installed_tests_enabled
cdata = configuration_data()
cdata.set('installed_tests_dir', installed_tests_execdir)
cdata.set('program', memory_monitor_test + '.py')
cdata.set('env', '')
configure_file(
input: installed_tests_template,
input: installed_tests_template_tap,
output: memory_monitor_test + '.test',
install_dir: installed_tests_metadir,
configuration: cdata