From 1fcd32a1596da364008aeeafb191f4b1508e6bed Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Tue, 7 Apr 2020 15:45:06 +0100 Subject: [PATCH] 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. --- gio/tests/memory-monitor-dbus.py.in | 5 +++-- gio/tests/memory-monitor-portal.py.in | 5 +++-- gio/tests/meson.build | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in index 675024a50..bb9d7d5b7 100755 --- a/gio/tests/memory-monitor-dbus.py.in +++ b/gio/tests/memory-monitor-dbus.py.in @@ -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()) diff --git a/gio/tests/memory-monitor-portal.py.in b/gio/tests/memory-monitor-portal.py.in index 37c206fd4..214e18c93 100755 --- a/gio/tests/memory-monitor-portal.py.in +++ b/gio/tests/memory-monitor-portal.py.in @@ -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()) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 755033be8..c7c3e3035 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -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