[pacman-dev] meson: add configure-time option to run tests with valgrind

Message ID 20191112063722.436943-1-eschwartz@archlinux.org
State Rejected, archived
Headers show
Series [pacman-dev] meson: add configure-time option to run tests with valgrind | expand

Commit Message

Eli Schwartz Nov. 12, 2019, 6:37 a.m. UTC
ninja doesn't support dynamic modification of commands via command-line
defines the way Make does.

Resolves a major blocker for FS#64394

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 meson_options.txt       | 4 ++++
 test/pacman/meson.build | 3 +++
 2 files changed, 7 insertions(+)

Comments

Allan McRae Nov. 25, 2019, 11:50 p.m. UTC | #1
On 12/11/19 4:37 pm, Eli Schwartz wrote:
> ninja doesn't support dynamic modification of commands via command-line
> defines the way Make does.
> 
> Resolves a major blocker for FS#64394

It was discussed on the mailing list to instead allow pactest to detect
environmental variables to do this.  That would be a better approach, as
you could decide on individual runs of the test suite whether to use
valgrind.

> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
> ---
>  meson_options.txt       | 4 ++++
>  test/pacman/meson.build | 3 +++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/meson_options.txt b/meson_options.txt
> index 4d8cc300..80d9422a 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -54,3 +54,7 @@ option('i18n', type : 'boolean', value : true,
>  # tools
>  option('file-seccomp', type: 'feature', value: 'auto',
>  	   description: 'determine whether file is seccomp-enabled')
> +
> +# test options
> +option('valgrind', type : 'boolean', value : false,
> +       description : 'run pacman tests using valgrind')
> diff --git a/test/pacman/meson.build b/test/pacman/meson.build
> index 4e87b4f3..2e0a2f5f 100644
> --- a/test/pacman/meson.build
> +++ b/test/pacman/meson.build
> @@ -346,6 +346,9 @@ foreach input : pacman_tests
>    if not conf.get('HAVE_LIBGPGME')
>      args += '--without-gpg'
>    endif
> +  if get_option('valgrind')
> +    args += '--valgrind'
> +  endif
>  
>    test(
>      test_name,
>

Patch

diff --git a/meson_options.txt b/meson_options.txt
index 4d8cc300..80d9422a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -54,3 +54,7 @@  option('i18n', type : 'boolean', value : true,
 # tools
 option('file-seccomp', type: 'feature', value: 'auto',
 	   description: 'determine whether file is seccomp-enabled')
+
+# test options
+option('valgrind', type : 'boolean', value : false,
+       description : 'run pacman tests using valgrind')
diff --git a/test/pacman/meson.build b/test/pacman/meson.build
index 4e87b4f3..2e0a2f5f 100644
--- a/test/pacman/meson.build
+++ b/test/pacman/meson.build
@@ -346,6 +346,9 @@  foreach input : pacman_tests
   if not conf.get('HAVE_LIBGPGME')
     args += '--without-gpg'
   endif
+  if get_option('valgrind')
+    args += '--valgrind'
+  endif
 
   test(
     test_name,