[glib: 1/2] meson: Run build-time tests with --tap where supported



commit cbc7fbbf7d9ffca2eb653ae8bf529adfb7758bb0
Author: Simon McVittie <smcv collabora com>
Date:   Mon Sep 24 22:49:34 2018 +0100

    meson: Run build-time tests with --tap where supported
    
    This makes it easier to debug test failures, by ensuring that g_debug()
    and g_test_message() are printed as TAP diagnostics.
    
    Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1528
    Signed-off-by: Simon McVittie <smcv collabora com>

 gio/tests/meson.build      | 3 ++-
 glib/tests/meson.build     | 3 ++-
 gobject/tests/meson.build  | 3 ++-
 tests/gobject/meson.build  | 4 +++-
 tests/meson.build          | 4 +++-
 tests/refcount/meson.build | 3 ++-
 6 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index c05233aaa..0760c5592 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -480,7 +480,8 @@ foreach test_dict : gio_tests
 
     suite = ['gio'] + extra_args.get('suite', [])
     timeout = suite.contains('slow') ? 120 : 30
-    test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
+    test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
+      args : ['--tap'])
   endforeach
 endforeach
 
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
index 1f2644ff7..ad0139df6 100644
--- a/glib/tests/meson.build
+++ b/glib/tests/meson.build
@@ -186,7 +186,8 @@ foreach test_name, extra_args : glib_tests
 
     suite = ['glib'] + extra_args.get('suite', [])
     timeout = suite.contains('slow') ? 120 : 30
-    test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
+    test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
+      args : ['--tap'])
   endif
 endforeach
 
diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build
index 48d2c858e..74521abeb 100644
--- a/gobject/tests/meson.build
+++ b/gobject/tests/meson.build
@@ -89,7 +89,8 @@ foreach test_name, extra_args : gobject_tests
 
   suite = ['gobject'] + extra_args.get('suite', [])
   timeout = suite.contains('slow') ? 120 : 30
-  test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
+  test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
+    args: ['--tap'])
 endforeach
 
 test(
diff --git a/tests/gobject/meson.build b/tests/gobject/meson.build
index 89b6eee5e..2a58766df 100644
--- a/tests/gobject/meson.build
+++ b/tests/gobject/meson.build
@@ -63,6 +63,7 @@ foreach test_dict : gobject_tests
     extra_sources = extra_args.get('extra_sources', [])
     install = installed_tests_enabled and extra_args.get('install', true)
     template = extra_args.get('tap', false) ? installed_tests_template_tap : installed_tests_template
+    test_command_args = extra_args.get('tap', false) ? ['--tap'] : []
 
     if install
       test_conf = configuration_data()
@@ -87,7 +88,8 @@ foreach test_dict : gobject_tests
     suite = ['gobject'] + extra_args.get('suite', [])
     timeout = suite.contains('slow') ? 120 : 30
     # FIXME? TESTS_ENVIRONMENT = LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset
-    test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
+    test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
+      args : test_command_args)
   endforeach
 endforeach
 
diff --git a/tests/meson.build b/tests/meson.build
index 87110fd47..778d20ce3 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -102,6 +102,7 @@ foreach test_dict : tests
     extra_sources = extra_args.get('extra_sources', [])
     install = installed_tests_enabled and extra_args.get('install', true)
     template = extra_args.get('tap', false) ? installed_tests_template_tap : installed_tests_template
+    test_command_args = extra_args.get('tap', false) ? ['--tap'] : []
 
     if install
       test_conf = configuration_data()
@@ -128,7 +129,8 @@ foreach test_dict : tests
     suite = ['glib'] + extra_args.get('suite', [])
     timeout = suite.contains('slow') ? 120 : 30
     # FIXME? TESTS_ENVIRONMENT = LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset
-    test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
+    test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
+      args : test_command_args)
   endforeach
 endforeach
 
diff --git a/tests/refcount/meson.build b/tests/refcount/meson.build
index 3a2072d08..fe341cac4 100644
--- a/tests/refcount/meson.build
+++ b/tests/refcount/meson.build
@@ -55,5 +55,6 @@ foreach test_name, extra_args : refcount_tests
   suite = ['refcount'] + extra_args.get('suite', [])
   timeout = suite.contains('slow') ? 120 : 30
   # FIXME? TESTS_ENVIRONMENT = LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset
-  test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
+  test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
+    args : ['--tap'])
 endforeach


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]