[gom] meson: Simplify handling of the tests
- From: Mathieu Bridon <mbridon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gom] meson: Simplify handling of the tests
- Date: Tue, 16 May 2017 16:53:05 +0000 (UTC)
commit 2a4e822e023a3eb8bea331ca3f71c517dc7ef5d8
Author: Mathieu Bridon <bochecha daitauha fr>
Date: Sat Apr 29 14:39:06 2017 +0200
meson: Simplify handling of the tests
Most tests are declared the exact same way: they have a name, which
corresponds to the source file, and they depend on libgom, without
anything special.
We can factorize these to simplify the build system.
https://bugzilla.gnome.org/show_bug.cgi?id=781944
tests/meson.build | 49 ++++++++++++++++++-------------------------------
1 files changed, 18 insertions(+), 31 deletions(-)
---
diff --git a/tests/meson.build b/tests/meson.build
index 6e419f3..340e8c1 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,36 +1,27 @@
-test_adapter = executable('test-gom-adapter', 'test-gom-adapter.c',
- dependencies: [libgom_dep])
-test('test-gom-adapter', test_adapter)
-
-test_constraints = executable('test-gom-constraints', 'test-gom-constraints.c',
- dependencies: [libgom_dep])
-test('test-gom-constraints', test_constraints)
+tests = [
+ 'test-gom-adapter',
+ 'test-gom-constraints',
+ 'test-gom-find-specific',
+ 'test-gom-insert',
+ 'test-gom-migration',
+ 'test-gom-repository',
+ 'test-gom-sorting',
+ 'test-gom-update',
+]
+
+foreach test_name: tests
+ exe = executable(test_name, '@0@.c'.format(test_name),
+ dependencies: [libgom_dep])
+ test(test_name, exe)
+endforeach
+
+# Some more tests requiring special handling
test_find = executable('test-gom-find', 'test-gom-find.c',
c_args: '-DDB="@0@/grl-bookmarks.db"'.format(meson.current_source_dir()),
dependencies: [libgom_dep])
test('test-gom-find', test_find)
-test_find_specific = executable('test-gom-find-specific', 'test-gom-find-specific.c',
- dependencies: [libgom_dep])
-test('test-gom-find-specific', test_find_specific)
-
-test_insert = executable('test-gom-insert', 'test-gom-insert.c',
- dependencies: [libgom_dep])
-test('test-gom-insert', test_insert)
-
-test_migration = executable('test-gom-migration', 'test-gom-migration.c',
- dependencies: [libgom_dep])
-test('test-gom-migration', test_migration)
-
-test_repository = executable('test-gom-repository', 'test-gom-repository.c',
- dependencies: [libgom_dep])
-test('test-gom-repository', test_repository)
-
-test_sorting = executable('test-gom-sorting', 'test-gom-sorting.c',
- dependencies: [libgom_dep])
-test('test-gom-sorting', test_sorting)
-
test_stress = executable('test-gom-stress', 'test-gom-stress.c',
dependencies: [libgom_dep])
test('test-gom-stress', test_stress, timeout: 300)
@@ -39,7 +30,3 @@ test_transform = executable('test-gom-transform', 'test-gom-transform.c',
c_args: '-DIMAGE="@0@/gnome.png"'.format(meson.current_source_dir()),
dependencies: [libgom_dep, gdkpixbuf_dep])
test('test-gom-transform', test_transform)
-
-test_update = executable('test-gom-update', 'test-gom-update.c',
- dependencies: [libgom_dep])
-test('test-gom-update', test_update)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]