[pango/install-test-option] Make installed tests optional



commit 4b6081a22e6ca7b8035ee169c871173064b1a2d6
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 6 09:22:56 2019 -0400

    Make installed tests optional
    
    Closes: https://gitlab.gnome.org/GNOME/pango/issues/354

 meson_options.txt |  4 ++++
 tests/meson.build | 14 ++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index 95d7edb8..d2f5f302 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,3 +6,7 @@ option('introspection',
        description: 'Build the GObject introspection data for Pango',
        type: 'boolean',
        value: true)
+option('install-tests',
+       description : 'Install tests',
+       type: 'boolean',
+       value: 'false')
diff --git a/tests/meson.build b/tests/meson.build
index ef97970f..7df7a999 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -94,9 +94,11 @@ endforeach
 installed_test_datadir = join_paths(pango_datadir, 'installed-tests', 'pango')
 installed_test_bindir = join_paths(pango_libexecdir, 'installed-tests', 'pango')
 
-install_data(installed_test_data, install_dir: installed_test_bindir)
-install_data(installed_test_layouts_data, install_dir: join_paths(installed_test_bindir, 'layouts'))
-install_data(installed_test_markups_data, install_dir: join_paths(installed_test_bindir, 'markups'))
+if get_option('install-tests')
+  install_data(installed_test_data, install_dir: installed_test_bindir)
+  install_data(installed_test_layouts_data, install_dir: join_paths(installed_test_bindir, 'layouts'))
+  install_data(installed_test_markups_data, install_dir: join_paths(installed_test_bindir, 'markups'))
+endif
 
 python = import('python3').find_python()
 gen_installed_test = files([ 'gen-installed-test.py' ])
@@ -107,7 +109,7 @@ custom_target('all-unicode',
               command: [
                 python, gen_all_unicode, '@OUTPUT@'
               ],
-              install: true,
+              install: get_option('install-tests'),
               install_dir: installed_test_bindir)
 
 foreach t: tests
@@ -123,7 +125,7 @@ foreach t: tests
                   name,
                   '@OUTDIR@',
                 ],
-                install: true,
+                install: get_option('install-tests'),
                 install_dir: installed_test_datadir)
 
   bin = executable(name, src,
@@ -131,7 +133,7 @@ foreach t: tests
                    include_directories: root_inc,
                    c_args: common_cflags + pango_debug_cflags + test_cflags,
                    cpp_args: common_cppflags + pango_debug_cflags + test_cflags,
-                   install: true,
+                   install: get_option('install-tests'),
                    install_dir: installed_test_bindir)
 
   test(name, bin, env: test_env)


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