[glib: 1/2] Meson: Run in TAP mode installed tests that support it



commit 8391219e4c4741d6d60b79741e8b373083f0392d
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Sun Sep 23 13:44:15 2018 -0400

    Meson: Run in TAP mode installed tests that support it

 gio/tests/meson.build     | 2 +-
 glib/tests/meson.build    | 2 +-
 gobject/tests/meson.build | 2 +-
 meson.build               | 1 +
 template-tap.test.in      | 4 ++++
 tests/gobject/meson.build | 7 ++++---
 tests/meson.build         | 5 +++--
 7 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 913da26a0..c05233aaa 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -464,7 +464,7 @@ foreach test_dict : gio_tests
       test_conf.set('installed_tests_dir', installed_tests_execdir)
       test_conf.set('program', test_name)
       configure_file(
-        input: installed_tests_template,
+        input: installed_tests_template_tap,
         output: test_name + '.test',
         install_dir: installed_tests_metadir,
         configuration: test_conf
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
index e88d3a104..1f2644ff7 100644
--- a/glib/tests/meson.build
+++ b/glib/tests/meson.build
@@ -170,7 +170,7 @@ foreach test_name, extra_args : glib_tests
       test_conf.set('installed_tests_dir', installed_tests_execdir)
       test_conf.set('program', test_name)
       configure_file(
-        input: installed_tests_template,
+        input: installed_tests_template_tap,
         output: test_name + '.test',
         install_dir: installed_tests_metadir,
         configuration: test_conf
diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build
index cc83c5f46..48d2c858e 100644
--- a/gobject/tests/meson.build
+++ b/gobject/tests/meson.build
@@ -73,7 +73,7 @@ foreach test_name, extra_args : gobject_tests
     test_conf.set('installed_tests_dir', installed_tests_execdir)
     test_conf.set('program', test_name)
     configure_file(
-      input: installed_tests_template,
+      input: installed_tests_template_tap,
       output: test_name + '.test',
       install_dir: installed_tests_metadir,
       configuration: test_conf
diff --git a/meson.build b/meson.build
index 7c59300b7..8192ddc69 100644
--- a/meson.build
+++ b/meson.build
@@ -71,6 +71,7 @@ installed_tests_metadir = join_paths(glib_datadir, 'installed-tests', meson.proj
 installed_tests_execdir = join_paths(glib_libexecdir, 'installed-tests', meson.project_name())
 installed_tests_enabled = get_option('installed_tests')
 installed_tests_template = files('template.test.in')
+installed_tests_template_tap = files('template-tap.test.in')
 
 add_project_arguments('-D_GNU_SOURCE', language: 'c')
 
diff --git a/template-tap.test.in b/template-tap.test.in
new file mode 100644
index 000000000..6adf73f03
--- /dev/null
+++ b/template-tap.test.in
@@ -0,0 +1,4 @@
+[Test]
+Type=session
+Exec=@installed_tests_dir@/@program@ --tap
+Output=TAP
diff --git a/tests/gobject/meson.build b/tests/gobject/meson.build
index 4da5a7a94..28f7828db 100644
--- a/tests/gobject/meson.build
+++ b/tests/gobject/meson.build
@@ -27,8 +27,8 @@ testmarshal_c = custom_target('testmarshal_c',
 )
 
 gobject_tests = {
-  'gvalue-test' : {},
-  'paramspec-test' : {},
+  'gvalue-test' : {'tap' : true},
+  'paramspec-test' : {'tap' : true},
   'deftype' : {},
   'defaultiface' : {
     'extra_sources' : ['testmodule.c'],
@@ -53,13 +53,14 @@ foreach test_name, extra_args : gobject_tests
   source = extra_args.get('source', test_name + '.c')
   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
 
   if install
     test_conf = configuration_data()
     test_conf.set('installed_tests_dir', installed_tests_execdir)
     test_conf.set('program', test_name)
     configure_file(
-      input: installed_tests_template,
+      input: template,
       output: test_name + '.test',
       install_dir: installed_tests_metadir,
       configuration: test_conf
diff --git a/tests/meson.build b/tests/meson.build
index b054a1732..87110fd47 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -18,7 +18,7 @@ subdir('refcount')
 # FIXME: We are using list of dictionnaries until we can depend on Meson 0.48.0
 # that supports '+=' operator on dictionnaries.
 tests = [{
-  'testglib' : {},
+  'testglib' : {'tap' : true},
   'testgdate' : {},
   'datetime' : {},
   'atomic-test' : {},
@@ -101,13 +101,14 @@ foreach test_dict : tests
     source = extra_args.get('source', test_name + '.c')
     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
 
     if install
       test_conf = configuration_data()
       test_conf.set('installed_tests_dir', installed_tests_execdir)
       test_conf.set('program', test_name)
       configure_file(
-        input: installed_tests_template,
+        input: template,
         output: test_name + '.test',
         install_dir: installed_tests_metadir,
         configuration: test_conf


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