From 58031feb17659a8d24ff4e2eeebe70f10fcce5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 15 Dec 2022 21:40:35 +0100 Subject: [PATCH] meson: Use 'tap' test protocol by default Meson supports tap protocol results parsing, allowing us to track better the tests that are running (and the ones that are actually skipped) without manually parsing the test output. However this also implies that using the verbose mode for a test doesn't show its output by default (unless there are failures). --- gio/tests/meson.build | 2 ++ glib/tests/meson.build | 2 ++ gmodule/tests/meson.build | 1 + gobject/tests/meson.build | 9 ++++++++- gthread/tests/meson.build | 8 +++++++- meson.build | 4 ++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 13a1775ce..16478f69b 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -1035,6 +1035,7 @@ foreach test_name, extra_args : gio_tests endif test(test_name, exe, + protocol : extra_args.get('protocol', test_protocol), env : local_test_env, timeout : timeout, suite : suite, @@ -1059,6 +1060,7 @@ foreach test_name, extra_args : python_tests test( test_name, python, + protocol : extra_args.get('protocol', test_protocol), depends: depends, args: ['-B', files(test_name)], env: test_env, diff --git a/glib/tests/meson.build b/glib/tests/meson.build index e1b12e368..16ba33492 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -398,6 +398,7 @@ foreach test_name, extra_args : glib_tests endforeach test(test_name, exe, + protocol : extra_args.get('protocol', test_protocol), depends : depends, env : test_env, timeout : timeout, @@ -444,6 +445,7 @@ foreach test_name, extra_args : python_tests test( test_name, python, + protocol : extra_args.get('protocol', test_protocol), depends: depends, args: ['-B', files(test_name)], env: test_env, diff --git a/gmodule/tests/meson.build b/gmodule/tests/meson.build index a78887529..513ea4213 100644 --- a/gmodule/tests/meson.build +++ b/gmodule/tests/meson.build @@ -115,6 +115,7 @@ foreach test_name, extra_args : gmodule_tests test(test_name, exe, + protocol : extra_args.get('protocol', test_protocol), depends : depends, env : test_env, timeout : timeout, diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build index a880dfb33..96a7b40d3 100644 --- a/gobject/tests/meson.build +++ b/gobject/tests/meson.build @@ -186,7 +186,13 @@ foreach test_name, extra_args : gobject_tests timeout = timeout * 10 endif - test(test_name, exe, env : test_env, timeout : timeout, suite : suite) + test(test_name, + exe, + protocol : extra_args.get('protocol', test_protocol), + env : test_env, + timeout : timeout, + suite : suite, + ) endforeach foreach test_name, extra_args : python_tests @@ -200,6 +206,7 @@ foreach test_name, extra_args : python_tests test( test_name, python, + protocol : extra_args.get('protocol', test_protocol), depends: depends, args: ['-B', files(test_name)], env: test_env, diff --git a/gthread/tests/meson.build b/gthread/tests/meson.build index 86da67413..53fb78e18 100644 --- a/gthread/tests/meson.build +++ b/gthread/tests/meson.build @@ -44,5 +44,11 @@ foreach test_name, extra_args : gthread_tests suite += 'failing' endif - test(test_name, exe, env : test_env, timeout : timeout, suite : suite) + test(test_name, + exe, + protocol : extra_args.get('protocol', test_protocol), + env : test_env, + timeout : timeout, + suite : suite, + ) endforeach diff --git a/meson.build b/meson.build index 8d3500ad7..74173e060 100644 --- a/meson.build +++ b/meson.build @@ -151,6 +151,10 @@ common_test_env = [ 'MALLOC_CHECK_=2', ] +# Note: this may cause the tests output not to be printed when running in +# verbose mode, see https://github.com/mesonbuild/meson/issues/11185 +# Can be changed it to 'exitcode' if required during development. +test_protocol = 'tap' test_timeout = 30 test_timeout_slow = 90