@@ -1,34 +1,31 @@
1−From c550bf4a41e9f86351b0a65ea3d6c9ab616e27c0 Mon Sep 17 00:00:00 2001
1+From 2bf6614a6d7516e194e39eb691c05b486860153c Mon Sep 17 00:00:00 2001
22From: worldofpeace <worldofpeace@protonmail.ch>
33Date: Thu, 16 May 2019 21:15:15 -0400
44Subject: [PATCH] meson: add options for tests installation dirs
55
66---
7− meson_options.txt | 6 ++++++
8− src/tests/meson.build | 19 ++++++++++++++-----
7+ meson_options.txt | 6 ++++++
8+ tests/meson.build | 19 ++++++++++++++-----
99 2 files changed, 20 insertions(+), 5 deletions(-)
1010
1111diff --git a/meson_options.txt b/meson_options.txt
12−index c938805..c1e9e95 100644
12+index 578bdae..6f5fa23 100644
1313--- a/meson_options.txt
1414+++ b/meson_options.txt
15−@@ -19,6 +19,12 @@ option('arm_neon', type: 'boolean',
16− option('tests', type: 'boolean',
15+@@ -22,3 +22,9 @@ option('tests', type: 'boolean',
16+ option('installed_tests', type: 'boolean',
1717 value: true,
18− description: 'Build the test suite (requires GObject)')
18+ description: 'Install tests')
1919+option('installed_test_datadir', type: 'string',
2020+ value: '',
2121+ description: 'Installation directory for data files in tests')
2222+option('installed_test_bindir', type: 'string',
2323+ value: '',
2424+ description: 'Installation directory for binary files in tests')
25− option('benchmarks', type: 'boolean',
26− value: true,
27− description: 'Build the benchmarks suite (requires GObject)')
28−diff --git a/src/tests/meson.build b/src/tests/meson.build
29−index 62129c6..0186400 100644
30−--- a/src/tests/meson.build
31−+++ b/src/tests/meson.build
25+diff --git a/tests/meson.build b/tests/meson.build
26+index 1f9bd0e..0253ac3 100644
27+--- a/tests/meson.build
28++++ b/tests/meson.build
3229@@ -22,8 +22,17 @@ unit_tests = [
3330 python = python3.find_python()
3431 gen_installed_test = join_paths(meson.current_source_dir(), 'gen-installed-test.py')
@@ -47,33 +44,33 @@ index 62129c6..0186400 100644
4744+ test_bindir = join_paths(get_option('prefix'), get_option('libexecdir'), test_suffix)
4845+endif
4946
50− foreach unit: unit_tests
51− wrapper = '@0@.test'.format(unit)
52−@@ -32,13 +41,13 @@ foreach unit: unit_tests
53− command: [
54− python,
55− gen_installed_test,
56−- '--testdir=@0@'.format(installed_test_bindir),
57−+ '--testdir=@0@'.format(test_bindir),
58− '--testname=@0@'.format(unit),
59− '--outdir=@OUTDIR@',
60− '--outfile=@0@'.format(wrapper),
61− ],
62− install: true,
63−- install_dir: installed_test_datadir)
64−+ install_dir: test_datadir)
65−
66− exe = executable(unit, unit + '.c',
67− dependencies: graphene_dep,
68−@@ -50,7 +59,7 @@ foreach unit: unit_tests
69− '-DGLIB_DISABLE_DEPRECATION_WARNINGS',
70− ],
71− install: true,
72−- install_dir: installed_test_bindir)
73−+ install_dir: test_bindir)
47+ # Make tests conditional on having mutest-1 installed system-wide, or
48+ # available as a subproject
49+@@ -42,13 +51,13 @@ if mutest_dep.found()
50+ command: [
51+ python,
52+ gen_installed_test,
53+- '--testdir=@0@'.format(installed_test_bindir),
54++ '--testdir=@0@'.format(test_bindir),
55+ '--testname=@0@'.format(unit),
56+ '--outdir=@OUTDIR@',
57+ '--outfile=@0@'.format(wrapper),
58+ ],
59+ install: get_option('installed_tests'),
60+- install_dir: installed_test_datadir,
61++ install_dir: test_datadir,
62+ )
7463
75− test(unit, exe, args: [ '--tap', '-k' ])
76− endforeach
64+ test(unit,
65+@@ -57,7 +66,7 @@ if mutest_dep.found()
66+ include_directories: graphene_inc,
67+ c_args: common_cflags,
68+ install: get_option('installed_tests'),
69+- install_dir: installed_test_bindir,
70++ install_dir: test_bindir,
71+ ),
72+ env: ['MUTEST_OUTPUT=tap'],
73+ protocol: 'tap',
7774--
78−2.21.0
75+2.22.0
7976