[totem-pl-parser] build: Fix quvi related tests when distchecking



commit e46104a7524577867843a5430139a8b99f3e489e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 21 16:08:11 2017 +0200

    build: Fix quvi related tests when distchecking
    
    As we're don't want to run a "distcheck" with a specific command-line
    option, use an environment variable instead for the tests to tell the
    videosite code where to find the helper.

 meson.build                         |    7 -------
 meson_options.txt                   |    2 --
 plparse/meson.build                 |   14 +++++++-------
 plparse/tests/meson.build           |    7 ++++++-
 plparse/totem-pl-parser-videosite.c |    9 +++++----
 5 files changed, 18 insertions(+), 21 deletions(-)
---
diff --git a/meson.build b/meson.build
index 71ef9c7..30de5e9 100644
--- a/meson.build
+++ b/meson.build
@@ -222,13 +222,6 @@ if enable_libgcrypt != 'no'
   endif
 endif
 
-# uninstalled tests
-enable_uninstalled_tests = get_option('enable-uninstalled-tests')
-if enable_uninstalled_tests
-  cdata.set('UNINSTALLED_TESTS', true,
-    description: 'Uninstalled tests')
-endif
-
 # subdirs
 
 plparser_inc = include_directories('plparse')
diff --git a/meson_options.txt b/meson_options.txt
index 00f66a3..8888ba8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,7 +6,5 @@ option('enable-libarchive', type: 'combo', choices : ['yes', 'no', 'auto'], valu
   description : 'Enable libarchive support.')
 option('enable-libgcrypt', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto',
   description : 'Enable libgcrypt support.')
-option('enable-uninstalled-tests', type: 'boolean', value: 'false',
-  description : 'Enable uninstalled tests.')
 option('enable-gtk-doc', type: 'boolean', value: 'false',
   description : 'Generate the API reference (depends on GTK-Doc)')
diff --git a/plparse/meson.build b/plparse/meson.build
index 52384ec..bfc95c5 100644
--- a/plparse/meson.build
+++ b/plparse/meson.build
@@ -107,13 +107,13 @@ plparser_mini_lib = library('totem-plparser-mini',
                             install: true)
 
 if have_quvi
-  executable('99-totem-pl-parser-videosite',
-             'videosite-parser.c', totem_pl_parser_builtins_h,
-             c_args: '-DLIBEXECDIR="@0@"'.format(libexecdir),
-             include_directories: [config_inc, totemlib_inc],
-             dependencies: [quvi_dep, glib_dep],
-             install_dir: join_paths(libexecdir, 'totem-pl-parser'),
-             install: true)
+  videosite_exe = executable('99-totem-pl-parser-videosite',
+                             'videosite-parser.c', totem_pl_parser_builtins_h,
+                             c_args: '-DLIBEXECDIR="@0@"'.format(libexecdir),
+                             include_directories: [config_inc, totemlib_inc],
+                             dependencies: [quvi_dep, glib_dep],
+                             install_dir: join_paths(libexecdir, 'totem-pl-parser'),
+                             install: true)
 endif
 
 # Introspection
diff --git a/plparse/tests/meson.build b/plparse/tests/meson.build
index 80faec2..3611613 100644
--- a/plparse/tests/meson.build
+++ b/plparse/tests/meson.build
@@ -8,5 +8,10 @@ foreach test_name : tests
                    include_directories: [config_inc, totemlib_inc],
                    dependencies: plparser_dep)
 
-  test(test_name, exe)
+  env = environment()
+  if have_quvi
+    env.set('TOTEM_PL_PARSER_VIDEOSITE_SCRIPT', videosite_exe.full_path())
+  endif
+
+  test(test_name, exe, env: env, timeout: 3 * 60)
 endforeach
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index 61d4597..90a40e2 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -28,19 +28,21 @@
 #include "totem-pl-parser-videosite.h"
 #include "totem-pl-parser-private.h"
 
+#define SCRIPT_ENVVAR "TOTEM_PL_PARSER_VIDEOSITE_SCRIPT"
+
 /* The helper script will be either the one shipped in totem-pl-parser,
  * when running tests, or the first non-hidden file in the totem-pl-parser
  * libexec directory, when sorted by lexicographic ordering (through strcmp) */
 static char *
 find_helper_script (void)
 {
-#ifdef UNINSTALLED_TESTS
-       return g_strdup ("../99-totem-pl-parser-videosite");
-#else
        GDir *dir;
        const char *name;
        char *script_name = NULL;
 
+       if (g_getenv (SCRIPT_ENVVAR) != NULL)
+               return g_strdup (g_getenv (SCRIPT_ENVVAR));
+
        dir = g_dir_open (LIBEXECDIR "/totem-pl-parser", 0, NULL);
        if (!dir)
                goto bail;
@@ -65,7 +67,6 @@ find_helper_script (void)
 
 bail:
        return NULL;
-#endif
 }
 
 gboolean


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