summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-07-12 16:30:51 +0200
committerMichael Catanzaro <mcatanzaro@igalia.com>2017-10-17 16:32:41 -0500
commitf7a71bd57254912547256045b747f9181eef3529 (patch)
treee7278e8dc0fdddc5b2e6acbd74e72c7626c5f497 /tests
parent8ff1b86cb8f6c848be82d99dbb593a50713ce6ad (diff)
downloaddconf-f7a71bd57254912547256045b747f9181eef3529.tar.gz
build: Port to meson build system
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. https://bugzilla.gnome.org/show_bug.cgi?id=784910
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/meson.build40
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0a53ee6..136160a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -94,3 +94,5 @@ client_LDADD = \
libdconf-mock.a \
$(gio_LIBS)
client_SOURCES = client.c
+
+EXTRA_DIST += meson.build
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..6737a97
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,40 @@
+sources = files(
+ 'dconf-mock-dbus.c',
+ 'dconf-mock-gvdb.c',
+ 'dconf-mock-shm.c'
+)
+
+libdconf_mock = static_library(
+ meson.project_name() + '-mock',
+ sources: sources,
+ dependencies: glib_dep
+)
+
+test_dir = meson.current_source_dir()
+
+dl_dep = cc.find_library('dl', required: false)
+m_dep = cc.find_library('m')
+
+unit_tests = [
+ # [name, sources, c_args, dependencies, link_with]
+ ['paths', 'paths.c', [], glib_dep, libdconf_common],
+ ['changeset', 'changeset.c', [], glib_dep, libdconf_common],
+ ['shm', ['shm.c', 'tmpdir.c'], [], [glib_dep, dl_dep], libdconf_shm],
+ ['gvdb', 'gvdb.c', '-DSRCDIR="@0@"'.format(test_dir), glib_dep, libgvdb],
+ ['gdbus-thread', 'dbus.c', '-DDBUS_BACKEND="/gdbus/thread"', gio_unix_dep, libdconf_gdbus_thread],
+ ['gdbus-filter', 'dbus.c', '-DDBUS_BACKEND="/gdbus/filter"', gio_unix_dep, libdconf_gdbus_filter],
+ ['engine', 'engine.c', '-DSRCDIR="@0@"'.format(test_dir), [glib_dep, dl_dep, m_dep], [libdconf_engine, libdconf_common, libdconf_mock]],
+ ['client', 'client.c', '-DSRCDIR="@0@"'.format(test_dir), gio_unix_dep, [libdconf_client, libdconf_engine, libdconf_common, libdconf_mock]]
+]
+
+foreach unit_test: unit_tests
+ exe = executable(
+ unit_test[0],
+ unit_test[1],
+ c_args: unit_test[2],
+ dependencies: unit_test[3],
+ link_with: unit_test[4]
+ )
+
+ test(unit_test[0], exe, is_parallel: false)
+endforeach