diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-06-30 14:20:40 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-06-30 14:20:40 +0200 |
commit | 7581ff7a8d006d482a85ae1e3ad340c8aa9a237e (patch) | |
tree | 7a65bd70f9afc249e031ec953434ccaf8f7011f0 | |
parent | 5a0c6f238757bf7b7236a88a2ae1f9b43a5ad17a (diff) | |
download | geocode-glib-7581ff7a8d006d482a85ae1e3ad340c8aa9a237e.tar.gz |
build: Fix tests not being enabled if not installed
We should always have been building the tests, and allow them to be run
uninstalled with "meson test" even if the builder didn't want to have
them available as installed-tests.
-rw-r--r-- | geocode-glib/meson.build | 4 | ||||
-rw-r--r-- | geocode-glib/tests/meson.build | 42 |
2 files changed, 23 insertions, 23 deletions
diff --git a/geocode-glib/meson.build b/geocode-glib/meson.build index 2a880d1..8df0569 100644 --- a/geocode-glib/meson.build +++ b/geocode-glib/meson.build @@ -132,6 +132,4 @@ geocode_glib_dep = declare_dependency(link_with: libgcglib, dependencies: deps, sources: generated_sources) -if get_option('enable-installed-tests') - subdir('tests') -endif +subdir('tests') diff --git a/geocode-glib/tests/meson.build b/geocode-glib/tests/meson.build index c5a9547..6a90206 100644 --- a/geocode-glib/tests/meson.build +++ b/geocode-glib/tests/meson.build @@ -3,7 +3,7 @@ install_dir = get_option('libexecdir') + '/installed-tests/' + library_name e = executable('geo-uri', 'geo-uri.c', dependencies: geocode_glib_dep, - install: true, + install: get_option('enable-installed-tests'), install_dir: install_dir) test('Geo URI', e) @@ -12,7 +12,7 @@ e = executable('geocode-glib', 'geocode-nominatim-test.c', 'geocode-glib.c', dependencies: geocode_glib_dep, - install: true, + install: get_option('enable-installed-tests'), install_dir: install_dir) env = ['G_TEST_SRCDIR=' + meson.current_source_dir()] test('API test', e, env: env) @@ -20,24 +20,26 @@ test('API test', e, env: env) e = executable('mock-backend', 'mock-backend.c', dependencies: geocode_glib_dep, - install: true, + install: get_option('enable-installed-tests'), install_dir: install_dir) test('Test mock backend', e) -install_data('locale_format.json', - 'locale_name.json', - 'nominatim-area.json', - 'nominatim-data-type-change.json', - 'nominatim-no-results.json', - 'nominatim-place_rank.json', - 'nominatim-rio.json', - 'osm_type0.json', - 'osm_type1.json', - 'osm_type2.json', - 'pub.json', - 'rev.json', - 'rev_fail.json', - 'search.json', - 'search_lat_long.json', - 'xep.json', - install_dir: install_dir) +if get_option('enable-installed-tests') + install_data('locale_format.json', + 'locale_name.json', + 'nominatim-area.json', + 'nominatim-data-type-change.json', + 'nominatim-no-results.json', + 'nominatim-place_rank.json', + 'nominatim-rio.json', + 'osm_type0.json', + 'osm_type1.json', + 'osm_type2.json', + 'pub.json', + 'rev.json', + 'rev_fail.json', + 'search.json', + 'search_lat_long.json', + 'xep.json', + install_dir: install_dir) +endif |