[libmediaart: 1/3] meson: add tests option




commit 1b0be1d5bea76c1d02a7afebc431844e933ed4a8
Author: Fabrice Fontaine <fontaine fabrice gmail com>
Date:   Wed Jun 1 06:48:23 2022 +0000

    meson: add tests option
    
    Signed-off-by: Fabrice Fontaine <fontaine fabrice gmail com>

 meson_options.txt |  2 ++
 tests/meson.build | 14 ++++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index c97c054..3146b1f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,6 +3,8 @@ option('image_library', type: 'combo', choices: ['auto', 'gdk-pixbuf', 'qt4', 'q
 option('introspection', type : 'boolean', value : 'true',
        description : 'Enable / disable the GObject-Introspection integration')
 option('vapi', type : 'boolean', value : 'true')
+option('tests', type : 'boolean', value : 'true',
+       description : 'Enable / disable unit tests')
 option('gtk_doc',
   type: 'boolean',
   value: 'false',
diff --git a/tests/meson.build b/tests/meson.build
index 28834c0..2e7ddf1 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,7 +1,9 @@
-mediaart_test = executable('mediaart-test',
-  'mediaarttest.c',
-  dependencies: libmediaart_dep,
-)
+if get_option('tests')
+  mediaart_test = executable('mediaart-test',
+    'mediaarttest.c',
+    dependencies: libmediaart_dep,
+  )
 
-test('mediaart', mediaart_test,
-     env: 'G_TEST_SRCDIR=' + meson.current_source_dir())
+  test('mediaart', mediaart_test,
+       env: 'G_TEST_SRCDIR=' + meson.current_source_dir())
+endif


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