[libshumate] tests: Use a foreach loop in meson.build
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libshumate] tests: Use a foreach loop in meson.build
- Date: Wed, 3 Mar 2021 12:41:56 +0000 (UTC)
commit 0b3febb32ce5e9c33d1563ce6a705c41af8fff17
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Mar 2 14:41:48 2021 -0300
tests: Use a foreach loop in meson.build
We'll add new tests there, and open coding each test is not really
scalable, so add a foreach loop that generate tests automatically.
tests/meson.build | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/tests/meson.build b/tests/meson.build
index d94c44a..739b2b5 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -6,15 +6,16 @@ test_env = [
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
]
-coordinate = executable(
+tests = [
'coordinate',
- 'coordinate.c',
- dependencies: libshumate_dep,
-)
+]
-test(
- 'coordinate',
- coordinate,
- env: test_env
-)
+foreach test : tests
+ executable = executable(
+ test,
+ '@0@.c'.format(test),
+ dependencies: libshumate_dep,
+ )
+ test(test, executable, env: test_env)
+endforeach
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]