diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2017-10-02 17:59:54 +0200 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-02-11 23:17:12 +0000 |
commit | 11fb4717a26fa036af5ef8e3c7891cedc1b75ead (patch) | |
tree | c1715b1b281a9b01f4a61324613b04cb5c503522 /tests | |
parent | edbb4e5b860802b73a7e981332dcbae8325d7759 (diff) | |
download | gnome-calendar-11fb4717a26fa036af5ef8e3c7891cedc1b75ead.tar.gz |
tests: Fix GCalManager test
The unit test that checks GCalManager test fails due to missing
schemas.
This patch allows schemas to be compiled in the build tree and also
sets the environment variables so tests can found them and run
properly.
Additional code and testing from Mohammed Sadiq <sadiq@sadiqpk.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/meson.build | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/meson.build b/tests/meson.build index 6d02aaec..c0ede244 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,19 +1,26 @@ -test_incs = [ - include_directories('.'), - src_inc -] - -tests_deps = gcal_deps + [ libgcal_dep ] +test_deps = gcal_deps + [ libgcal_dep ] ########### # Manager # ########### +test_env = [ + 'G_TEST_SRCDIR=' + meson.current_source_dir(), + 'G_TEST_BUILDDIR=' + meson.current_build_dir(), + 'GSETTINGS_SCHEMA_DIR=' + join_paths(meson.build_root(), 'data'), + 'GSETTINGS_BACKEND=memory', + 'MALLOC_CHECK_=2' +] + +test_cflags = '-DTEST_DATA_DIR="@0@"'.format(join_paths(meson.source_root(), 'data')) + +test_unit = 'test-manager' + test_manager = executable( - 'test-manager', - 'test-manager.c', - dependencies: tests_deps, - include_directories: test_incs + test_unit, + [test_unit + '.c', compiled_schemas], + c_args: test_cflags, + dependencies: test_deps ) -test('test-manager', test_manager) +test(test_unit, test_manager, env: test_env) |